odant-work 1.0.104 → 1.0.106

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 (60) hide show
  1. package/$server/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js +15 -12
  2. package/$server/$folder/$class/$module/$mcp/handlers/pages/form/system/mcp/$handler/class.js +17 -24
  3. package/$server/$folder/$class/$module/$provider/handlers/pages/form/system/ai/$handler/class.js +15 -12
  4. package/$server/$folder/$class/$structure/$project/class.js +39 -5
  5. package/$server/$folder/$class/$structure/$project/handlers/pages/form/system/modules/$handler/class.js +40 -25
  6. package/$server/$folder/$class/$structure/$project/handlers/pages/form/system/requisites/$handler/class.js +1 -0
  7. package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/license/$handler/class.js +13 -12
  8. package/$server/$folder/$class/$structure/$user/handlers/pages/form/calendar/$handler/class.js +12 -0
  9. package/$server/$folder/$class/$structure/$user/handlers/pages/form/email/$handler/class.js +12 -0
  10. package/$server/$folder/$class/$structure/$user/handlers/pages/form/folder/$handler/class.js +12 -0
  11. package/$server/$folder/$class/$structure/$user/handlers/pages/form/profile/$handler/class.js +30 -0
  12. package/$server/$folder/$class/$structure/$user/handlers/pages/form/search/$handler/class.js +12 -0
  13. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/class.js +14 -0
  14. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/agent/$handler/class.js +5 -4
  15. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/profile/$handler/class.js +1 -0
  16. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/requisites/$handler/class.js +3 -0
  17. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/settings/$handler/class.js +6 -37
  18. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/skills/$handler/class.js +5 -4
  19. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/tokens/$handler/class.js +10 -2
  20. package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/users/$handler/class.js +1 -0
  21. package/$server/$folder/$class/$structure/class.js +15 -0
  22. package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +82 -23
  23. package/$server/$folder/$class/$structure/handlers/pages/form/system/agent/$handler/class.js +5 -29
  24. package/$server/$folder/$class/$structure/handlers/pages/form/system/database/$handler/class.js +1 -0
  25. package/$server/$folder/$class/$structure/handlers/pages/form/system/messengers/$handler/class.js +1 -0
  26. package/$server/$folder/$class/$structure/handlers/pages/form/system/skills/$handler/class.js +276 -179
  27. package/$server/$folder/$class/$structure/handlers/pages/form/system/staff/$handler/class.js +1 -0
  28. package/$server/$folder/$class/ai/system.md +2 -2
  29. package/$server/$folder/$class/class.js +5 -1
  30. package/$server/$folder/$class/handlers/pages/form/system/requisites/$handler/class.js +39 -45
  31. package/$server/$folder/handlers/pages/form/$handler/class.js +194 -2
  32. package/$server/$folder/handlers/pages/form/folder/$handler/class.js +2 -611
  33. package/$server/$folder/lib/consultant/consultant.js +123 -66
  34. package/$server/$folder/lib/explorer/explorer.js +9 -21
  35. package/$server/$folder/lib/folder-browser/folder-browser.js +793 -0
  36. package/$server/$folder/lib/folder-browser/readme.md +5 -0
  37. package/$server/$folder/lib/prompt-bar/prompt-bar.js +24 -1
  38. package/$server/$folder/lib/tree/tree.js +16 -6
  39. package/AGENTS.md +2 -2
  40. package/MODULES/$domain/class.js +1 -0
  41. package/MODULES/$domain/handlers/pages/form/system/mcp/$handler/class.js +10 -21
  42. package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/engine/$handler/class.js +1 -0
  43. package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/models/$handler/class.js +5 -10
  44. package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/training/$handler/class.js +1 -0
  45. 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/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/241/321/207/321/221/321/202 /320/275/320/260 /320/276/320/277/320/273/320/260/321/202/321/203.html" +5 -1
  46. 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/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/242/320/276/320/262/320/260/321/200/320/275/320/260/321/217 /320/275/320/260/320/272/320/273/320/260/320/264/320/275/320/260/321/217.html" +1 -1
  47. package/oda/components/layouts/editor-form/editor-form.js +54 -9
  48. package/package.json +1 -1
  49. package/sources/client.js +1 -1
  50. package/sources/data/print.js +27 -3
  51. package/sources/host/websocket.js +11 -1
  52. package/sources/modules/user-profile/user-tokens.js +0 -46
  53. package/sources/server/access/gateway.js +32 -6
  54. package/sources/server/chat-threads.js +32 -3
  55. package/sources/server/class/base-template.js +18 -18
  56. package/sources/server/class/feed.js +24 -12
  57. package/sources/server/class/security.js +97 -31
  58. package/sources/server/class.js +9 -0
  59. package/sources/server/handler.js +6 -0
  60. package/sources/server/user.js +12 -4
@@ -1,5 +1,6 @@
1
1
  export default {
2
2
  label: 'Описание и тестирование',
3
+ description: 'Параметры модели ИИ, контекстное окно, возможности и быстрая проверка',
3
4
  icon: 'carbon:machine-learning-model',
4
5
  order: 5,
5
6
  default: true,
@@ -194,19 +195,12 @@ export default {
194
195
  }
195
196
  </style>
196
197
 
197
- <div class="header-card" ~if="info">
198
- <div class="header-left">
199
- <oda-icon :icon="info.icon || 'carbon:machine-learning-model'" icon-size="30"></oda-icon>
200
- <div>
201
- <div class="title">{{info.label || info.id}}</div>
202
- <div class="subtitle">Провайдер: {{providerName}} · Путь: {{info.path}}</div>
203
- </div>
204
- </div>
198
+ <div class="header-card" ~if="info" style="padding:10px 14px;">
199
+ <span class="badge" ~class="info.aiActive ? 'active' : 'inactive'">
200
+ <span class="dot" ~class="info.aiActive ? 'on' : 'off'"></span>
201
+ <span>{{info.aiActive ? 'Активна' : ('Неактивна: ' + (info.aiStatusReason || 'не настроена'))}}</span>
202
+ </span>
205
203
  <div class="toolbar">
206
- <span class="badge" ~class="info.aiActive ? 'active' : 'inactive'">
207
- <span class="dot" ~class="info.aiActive ? 'on' : 'off'"></span>
208
- <span>{{info.aiActive ? 'Активна' : ('Неактивна: ' + (info.aiStatusReason || 'не настроена'))}}</span>
209
- </span>
210
204
  <label class="toolbar" style="cursor:pointer;font-weight:600;">
211
205
  <input type="checkbox" :checked="modelEnabled" @change="toggleEnabled($event.target.checked)">
212
206
  <span>Включена</span>
@@ -549,6 +543,15 @@ export default {
549
543
  this.testTtsInstructions = p.value || '';
550
544
  if (p.speaker) this.testTtsVoice = p.speaker;
551
545
  },
546
+ get headerIcon() {
547
+ return this.info?.icon || 'carbon:machine-learning-model';
548
+ },
549
+ get headerTitle() {
550
+ return this.info?.label || this.info?.id || 'Описание и тестирование';
551
+ },
552
+ get headerDescription() {
553
+ return this.info ? `Провайдер: ${this.providerName} · Путь: ${this.info.path}` : '';
554
+ },
552
555
  get testModalityLabel() {
553
556
  const map = {
554
557
  llm: 'Чат / LLM',
@@ -1,5 +1,6 @@
1
1
  export default {
2
2
  label: 'MCP и инструменты',
3
+ description: 'Параметры подключения MCP-коннектора, используемые секреты и список инструментов',
3
4
  icon: 'carbon:plug',
4
5
  order: 5,
5
6
  tag: 'work-mcp-connector',
@@ -13,10 +14,6 @@ export default {
13
14
  font-family: var(--font-family, system-ui, -apple-system, sans-serif);
14
15
  color: var(--content-color, #1f2937);
15
16
  }
16
- .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
17
- .title { display: flex; align-items: center; gap: 10px; }
18
- h2 { margin: 0; font-size: 18px; font-weight: 700; }
19
- .sub { font-size: 13px; opacity: 0.75; margin-top: 2px; }
20
17
  .card {
21
18
  border: 1px solid var(--border-color, rgba(128,128,128,0.22));
22
19
  border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
@@ -32,32 +29,12 @@ export default {
32
29
  background: color-mix(in srgb, var(--accent-color, #2563eb) 10%, transparent);
33
30
  color: var(--accent-color, #2563eb);
34
31
  }
35
- .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
36
- .btn {
37
- border: 1px solid var(--border-color, rgba(128,128,128,0.3));
38
- background: var(--content-background, transparent); color: inherit;
39
- padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
40
- }
41
- .btn-primary { background: var(--accent-color, #2563eb); color: #fff; border-color: transparent; }
42
32
  .notice { padding: 10px 14px; border-radius: 10px; font-size: 13px; background: rgba(16,185,129,0.12); color: #047857; }
43
33
  .notice[error] { background: rgba(239,68,68,0.12); color: #b91c1c; }
44
34
  .tool { padding: 8px 10px; border-radius: 8px; background: rgba(128,128,128,0.06); display: flex; flex-direction: column; gap: 3px; }
45
35
  .tool-desc { font-size: 12px; opacity: 0.8; }
46
36
  </style>
47
37
 
48
- <div class="head">
49
- <div class="title">
50
- <oda-icon icon="carbon:plug" icon-size="24"></oda-icon>
51
- <div>
52
- <h2>{{$item?.label || $item?.id || 'MCP-коннектор'}}</h2>
53
- <div class="sub">{{description || $item?.path}}</div>
54
- </div>
55
- </div>
56
- <div class="btn-row">
57
- <button class="btn btn-primary" :disabled="busy" @tap="inspect">{{busy ? 'Проверка...' : '🔍 Проверить tools/list'}}</button>
58
- </div>
59
- </div>
60
-
61
38
  <div ~if="noticeText" class="notice" :error="noticeError">{{noticeText}}</div>
62
39
 
63
40
  <div class="card">
@@ -95,6 +72,22 @@ export default {
95
72
  attached() {
96
73
  this.loadCfg();
97
74
  },
75
+ get headerTitle() {
76
+ return this.$item?.label || this.$item?.id || 'MCP-коннектор';
77
+ },
78
+ get headerDescription() {
79
+ return this.description || this.$item?.path || 'Параметры подключения MCP-коннектора и список инструментов';
80
+ },
81
+ get headerActions() {
82
+ return [{
83
+ id: 'inspect',
84
+ icon: 'icons:search',
85
+ label: this.busy ? 'Проверка…' : 'Проверить tools/list',
86
+ primary: true,
87
+ disabled: Boolean(this.busy),
88
+ onClick: () => this.inspect(),
89
+ }];
90
+ },
98
91
  get transportLine() {
99
92
  const c = this.mcpCfg || {};
100
93
  if (c.url) return 'HTTP: ' + c.url;
@@ -1,5 +1,6 @@
1
1
  export default {
2
2
  label: 'Провайдер и модели',
3
+ description: 'Ключ подключения к провайдеру, доступные модели ИИ и проверка связи',
3
4
  icon: 'carbon:api',
4
5
  order: 5,
5
6
  default: true,
@@ -171,19 +172,12 @@ export default {
171
172
  }
172
173
  </style>
173
174
 
174
- <div class="header-card" ~if="state">
175
- <div class="header-left">
176
- <oda-icon :icon="state.icon || 'carbon:api'" icon-size="32"></oda-icon>
177
- <div>
178
- <div class="title">{{state.label}}</div>
179
- <div class="desc" ~if="state.description">{{state.description}}</div>
180
- </div>
181
- </div>
175
+ <div class="header-card" ~if="state" style="padding:10px 14px;">
176
+ <span class="badge" ~class="state.active ? 'active' : 'inactive'">
177
+ <span class="dot" ~class="state.active ? 'on' : 'off'"></span>
178
+ <span>{{state.active ? 'Активен' : ('Неактивен: ' + (state.statusReason || 'Не настроен ключ'))}}</span>
179
+ </span>
182
180
  <div class="toolbar">
183
- <span class="badge" ~class="state.active ? 'active' : 'inactive'">
184
- <span class="dot" ~class="state.active ? 'on' : 'off'"></span>
185
- <span>{{state.active ? 'Активен' : ('Неактивен: ' + (state.statusReason || 'Не настроен ключ'))}}</span>
186
- </span>
187
181
  <label class="toolbar" style="cursor:pointer;font-weight:600;">
188
182
  <input type="checkbox" :checked="state.enabled !== false" @change="toggleProviderEnabled($event.target.checked)">
189
183
  <span>Провайдер включён</span>
@@ -503,6 +497,15 @@ export default {
503
497
  } catch (e) {
504
498
  this.error = String(e?.message || e);
505
499
  }
500
+ },
501
+ get headerIcon() {
502
+ return this.state?.icon || 'carbon:api';
503
+ },
504
+ get headerTitle() {
505
+ return this.state?.label || 'Провайдер и модели';
506
+ },
507
+ get headerDescription() {
508
+ return this.state?.description || 'Ключ подключения к провайдеру, доступные модели ИИ и проверка связи';
506
509
  }
507
510
  }
508
511
  };
@@ -9,16 +9,50 @@ export default {
9
9
  allowTypes: '$department $project $domain $module $catalog $struct $operation $register',
10
10
  METADATA: {
11
11
  STATIC: [
12
+ { id: 'full_name', label: 'Полное наименование', type: 'string' },
12
13
  { id: 'inn', label: 'ИНН', type: 'string' },
13
14
  { id: 'kpp', label: 'КПП', type: 'string' },
14
- { id: 'ogrn', label: 'ОГРН', type: 'string' },
15
+ { id: 'ogrn', label: 'ОГРН / ОГРНИП', type: 'string' },
16
+ { id: 'okpo', label: 'ОКПО', type: 'string' },
17
+ { id: 'okato', label: 'ОКАТО / ОКТМО', type: 'string' },
15
18
  { id: 'address', label: 'Юр. адрес', type: 'string' },
19
+ { id: 'actual_address', label: 'Фактический / почтовый адрес', type: 'string' },
16
20
  { id: 'phone', label: 'Телефон', type: 'string' },
17
21
  { id: 'email', label: 'E-mail', type: 'string' },
18
- { id: 'bank', label: 'Банк', type: 'string' },
19
- { id: 'bik', label: 'БИК', type: 'string' },
20
- { id: 'account', label: 'Р/с', type: 'string' },
21
- { id: 'corr', label: 'К/с', type: 'string' },
22
+ { id: 'director_title', label: 'Должность руководителя', type: 'string' },
23
+ { id: 'director', label: 'Руководитель (ФИО)', type: 'string' },
24
+ { id: 'chief_accountant', label: 'Главный бухгалтер (ФИО)', type: 'string' },
25
+ {
26
+ id: 'bank_accounts',
27
+ label: 'Расчётные счета',
28
+ type: 'table',
29
+ fields: [
30
+ { id: 'name', label: 'Назначение', type: 'string', width: 150 },
31
+ { id: 'bank', label: 'Банк', type: 'string', required: true, width: 220 },
32
+ { id: 'bik', label: 'БИК', type: 'string', required: true, width: 110 },
33
+ { id: 'account', label: 'Р/с', type: 'string', required: true, width: 190 },
34
+ { id: 'corr', label: 'К/с', type: 'string', width: 190 },
35
+ { id: 'is_default', label: 'Основной', type: 'boolean', width: 80 },
36
+ ],
37
+ },
38
+ ],
39
+ STATIC_LAYOUT: [
40
+ { id: 'label', kind: 'field', span: 4 },
41
+ { id: 'full_name', kind: 'field', span: 8 },
42
+ { id: 'inn', kind: 'field', span: 3 },
43
+ { id: 'kpp', kind: 'field', span: 3 },
44
+ { id: 'ogrn', kind: 'field', span: 3 },
45
+ { id: 'okpo', kind: 'field', span: 3 },
46
+ { id: 'okato', kind: 'field', span: 4 },
47
+ { id: 'phone', kind: 'field', span: 4 },
48
+ { id: 'email', kind: 'field', span: 4 },
49
+ { id: 'address', kind: 'field', span: 12 },
50
+ { id: 'actual_address', kind: 'field', span: 12 },
51
+ { id: 'hdr_signers', kind: 'header', label: 'Подписанты для печатных бланков', span: 12 },
52
+ { id: 'director_title', kind: 'field', span: 4 },
53
+ { id: 'director', kind: 'field', span: 4 },
54
+ { id: 'chief_accountant', kind: 'field', span: 4 },
55
+ { id: 'bank_accounts', kind: 'field', span: 12 },
22
56
  ],
23
57
  },
24
58
  };
@@ -38,6 +38,7 @@ async function findTypeNode(folder, targetId) {
38
38
  }
39
39
  export default {
40
40
  label: 'Классы и модули',
41
+ description: 'Подключённые модули, классы данных и настройка дерева структуры',
41
42
  icon: 'odant:module',
42
43
  order: 30,
43
44
  component: {
@@ -51,21 +52,6 @@ export default {
51
52
  background: var(--content-background);
52
53
  color: var(--content-color);
53
54
  }
54
- .bar {
55
- @apply --horizontal;
56
- align-items: center;
57
- gap: 8px;
58
- padding: 10px 16px;
59
- border-bottom: 1px solid var(--subtle-border, var(--border-color));
60
- background: var(--subtle-background);
61
- flex-wrap: wrap;
62
- flex-shrink: 0;
63
- }
64
- .title {
65
- font-weight: 700;
66
- font-size: 14px;
67
- margin-right: auto;
68
- }
69
55
  .tree-wrap {
70
56
  @apply --vertical;
71
57
  @apply --flex;
@@ -80,14 +66,6 @@ export default {
80
66
  }
81
67
  </style>
82
68
 
83
- <div class="bar">
84
- <span class="title">{{barTitle}}</span>
85
- <oda-button ~if="isModuleItem" :icon="isModuleEnabled ? 'icons:check-box' : 'icons:check-box-outline-blank'" @tap="toggleModuleEnabled()">{{isModuleEnabled ? 'Модуль активен' : 'Модуль заблокирован'}}</oda-button>
86
- <oda-button ~if="!isModuleItem" icon="icons:add" @tap="openInstallModule($event)">Подключить модуль</oda-button>
87
- <oda-button icon="icons:create-new-folder" @tap="openCreateClass($event)">Создать класс</oda-button>
88
- <oda-button icon="icons:open-in-new" @tap="openFocusedClass()">Открыть</oda-button>
89
- </div>
90
-
91
69
  <div ~if="error" style="padding:8px 16px;color:var(--error-color, #dc2626);font-size:12.5px;">{{error}}</div>
92
70
 
93
71
  <div class="tree-wrap">
@@ -128,9 +106,46 @@ export default {
128
106
  this.$item?.__version;
129
107
  return this.$item?.DATA?.enabled !== false && this.$item?.DATA?.blocked !== true && this.$item?.DATA?.systemBlocked !== true;
130
108
  },
131
- get barTitle() {
109
+ get headerTitle() {
110
+ return this.isModuleItem ? 'Классы модуля' : 'Классы и модули';
111
+ },
112
+ get headerDescription() {
132
113
  const name = this.$item?.DATA?.label || this.$item?.label || this.$item?.id || '';
133
- return this.isModuleItem ? `Классы модуля (${name})` : `Классы и модули (${name})`;
114
+ return this.isModuleItem
115
+ ? `Классы данных и обработчики модуля «${name}»`
116
+ : `Подключённые модули и классы структуры «${name}»`;
117
+ },
118
+ get headerActions() {
119
+ const acts = [];
120
+ if (this.isModuleItem) {
121
+ acts.push({
122
+ id: 'toggle',
123
+ icon: this.isModuleEnabled ? 'icons:check-box' : 'icons:check-box-outline-blank',
124
+ label: this.isModuleEnabled ? 'Модуль активен' : 'Модуль заблокирован',
125
+ active: this.isModuleEnabled,
126
+ onClick: () => this.toggleModuleEnabled(),
127
+ });
128
+ } else {
129
+ acts.push({
130
+ id: 'install',
131
+ icon: 'icons:add',
132
+ label: 'Подключить модуль',
133
+ onClick: () => this.openInstallModule(),
134
+ });
135
+ }
136
+ acts.push({
137
+ id: 'create',
138
+ icon: 'icons:create-new-folder',
139
+ label: 'Создать класс',
140
+ onClick: () => this.openCreateClass(),
141
+ });
142
+ acts.push({
143
+ id: 'open',
144
+ icon: 'icons:open-in-new',
145
+ label: 'Открыть',
146
+ onClick: () => this.openFocusedClass(),
147
+ });
148
+ return acts;
134
149
  },
135
150
  get emptyText() {
136
151
  return this.isModuleItem ? 'В модуле пока нет классов. Нажмите «Создать класс».' : 'Раздел модулей ещё не создан. Нажмите «Подключить модуль».';
@@ -1,3 +1,4 @@
1
1
  export default {
2
2
  label: 'Реквизиты',
3
+ description: 'Название, коды, адреса, подписанты и расчётные счета организации для печатных бланков',
3
4
  };
@@ -1,5 +1,7 @@
1
1
  export default {
2
2
  label: 'Лицензия',
3
+ title: 'Лицензирование ODANT-WORK',
4
+ description: 'Привязка токена владельца, активные рабочие места и статус агентской ИИ-системы',
3
5
  icon: 'carbon:certificate',
4
6
  order: 85,
5
7
  group: 'infra',
@@ -237,18 +239,9 @@ export default {
237
239
  <div class="container">
238
240
  <div class="card">
239
241
  <div class="card-head">
240
- <div class="card-title">
241
- <oda-icon icon="carbon:certificate" :icon-size="22"></oda-icon>
242
- <span>Лицензирование ODANT-WORK</span>
243
- <span class="badge" :class="status?.baseLicensed ? '' : 'warn'">
244
- {{status?.baseLicensed ? 'Лицензия активна · ИИ-агенты включены' : 'Базовая лицензия не установлена'}}
245
- </span>
246
- </div>
247
- <div class="head-actions">
248
- <button type="button" class="btn-portal" @tap="openPortal">
249
- <span>Личный кабинет ({{portalHost}}) ↗</span>
250
- </button>
251
- </div>
242
+ <span class="badge" :class="status?.baseLicensed ? '' : 'warn'">
243
+ {{status?.baseLicensed ? 'Лицензия активна · ИИ-агенты включены' : 'Базовая лицензия не установлена'}}
244
+ </span>
252
245
  </div>
253
246
 
254
247
  <div class="alert-box" ~if="!status?.baseLicensed">
@@ -372,6 +365,14 @@ export default {
372
365
  get portalHost() {
373
366
  return String(this.portalUrl || 'https://work.odant.org').replace(/^https?:\/\//i, '').replace(/\/+$/, '');
374
367
  },
368
+ get headerActions() {
369
+ return [{
370
+ id: 'portal',
371
+ icon: 'icons:open-in-new',
372
+ label: `Личный кабинет (${this.portalHost})`,
373
+ onClick: () => this.openPortal(),
374
+ }];
375
+ },
375
376
  openPortal() {
376
377
  window.open(this.portalCabinetUrl, '_blank', 'noopener');
377
378
  },
@@ -0,0 +1,12 @@
1
+ export default {
2
+ async allowUse($context, params) {
3
+ if (!$context?.id || $context?.DATA?.usersContainer)
4
+ return false;
5
+ const uid = $context?.constructor?.resolveUid?.(params) || params?.session?.uid || '';
6
+ if (uid && $context.id === uid)
7
+ return true;
8
+ if (globalThis.WORK?.DEV_MODE)
9
+ return true;
10
+ return Boolean(await globalThis.WORK?._isWorkBoss?.(params).catch(() => false));
11
+ },
12
+ };
@@ -0,0 +1,12 @@
1
+ export default {
2
+ async allowUse($context, params) {
3
+ if (!$context?.id || $context?.DATA?.usersContainer)
4
+ return false;
5
+ const uid = $context?.constructor?.resolveUid?.(params) || params?.session?.uid || '';
6
+ if (uid && $context.id === uid)
7
+ return true;
8
+ if (globalThis.WORK?.DEV_MODE)
9
+ return true;
10
+ return Boolean(await globalThis.WORK?._isWorkBoss?.(params).catch(() => false));
11
+ },
12
+ };
@@ -0,0 +1,12 @@
1
+ export default {
2
+ async allowUse($context, params) {
3
+ if (!$context?.id || $context?.DATA?.usersContainer)
4
+ return false;
5
+ const uid = $context?.constructor?.resolveUid?.(params) || params?.session?.uid || '';
6
+ if (uid && $context.id === uid)
7
+ return true;
8
+ if (globalThis.WORK?.DEV_MODE)
9
+ return true;
10
+ return Boolean(await globalThis.WORK?._isWorkBoss?.(params).catch(() => false));
11
+ },
12
+ };
@@ -0,0 +1,30 @@
1
+ import '/sources/modules/user-profile/user-profile.js';
2
+ export default {
3
+ label: 'Профиль',
4
+ description: 'Личные данные и контактная информация пользователя',
5
+ icon: 'icons:account-circle',
6
+ order: 15,
7
+ async allowUse($context, params) {
8
+ if (!$context?.id || $context?.DATA?.usersContainer)
9
+ return false;
10
+ const uid = $context?.constructor?.resolveUid?.(params) || params?.session?.uid || '';
11
+ if (!uid || $context.id === uid)
12
+ return false;
13
+ if (globalThis.WORK?.DEV_MODE)
14
+ return false;
15
+ const isBoss = await globalThis.WORK?._isWorkBoss?.(params).catch(() => false);
16
+ return !isBoss;
17
+ },
18
+ component: {
19
+ template: /* html */`
20
+ <style>
21
+ :host {
22
+ @apply --vertical;
23
+ @apply --flex;
24
+ overflow: hidden;
25
+ }
26
+ </style>
27
+ <user-profile :$item flex></user-profile>
28
+ `
29
+ }
30
+ };
@@ -0,0 +1,12 @@
1
+ export default {
2
+ async allowUse($context, params) {
3
+ if (!$context?.id || $context?.DATA?.usersContainer)
4
+ return false;
5
+ const uid = $context?.constructor?.resolveUid?.(params) || params?.session?.uid || '';
6
+ if (uid && $context.id === uid)
7
+ return true;
8
+ if (globalThis.WORK?.DEV_MODE)
9
+ return true;
10
+ return Boolean(await globalThis.WORK?._isWorkBoss?.(params).catch(() => false));
11
+ },
12
+ };
@@ -0,0 +1,14 @@
1
+ export default {
2
+ async allowUse($context, params) {
3
+ if (!$context?.id)
4
+ return false;
5
+ if ($context?.DATA?.usersContainer)
6
+ return true;
7
+ const uid = $context?.constructor?.resolveUid?.(params) || params?.session?.uid || '';
8
+ if (uid && $context.id === uid)
9
+ return true;
10
+ if (globalThis.WORK?.DEV_MODE)
11
+ return true;
12
+ return Boolean(await globalThis.WORK?._isWorkBoss?.(params).catch(() => false));
13
+ },
14
+ };
@@ -3,11 +3,12 @@ export default {
3
3
  if (!$context?.id || $context?.DATA?.usersContainer)
4
4
  return false;
5
5
  const uid = $context?.constructor?.resolveUid?.(params) || params?.session?.uid || '';
6
- if (uid && $context.id === uid)
7
- return true;
8
6
  if (globalThis.WORK?.DEV_MODE)
9
7
  return true;
10
- const roles = await globalThis.WORK?.roles?.(params).catch(() => []);
11
- return Array.isArray(roles) && roles.includes('BOSS');
8
+ if (uid && $context.id === uid) {
9
+ const scope = await globalThis.WORK?.my_scope?.(params).catch(() => null);
10
+ return Boolean(scope?.hasAnyRole || scope?.isWorkBoss);
11
+ }
12
+ return Boolean(await globalThis.WORK?._isWorkBoss?.(params).catch(() => false));
12
13
  },
13
14
  };
@@ -1,6 +1,7 @@
1
1
  import '/sources/modules/user-profile/user-profile.js';
2
2
  export default {
3
3
  label: 'Профиль',
4
+ description: 'Личные данные, фотография и контактный e-mail учётной записи',
4
5
  icon: 'icons:account-circle',
5
6
  order: 15,
6
7
  allowUse($context) {
@@ -1,6 +1,8 @@
1
1
  export default {
2
2
  label: 'Настройки',
3
- icon: 'icons:tune',
3
+ title: 'Личные настройки',
4
+ description: 'Индивидуальные параметры интерфейса и работы ИИ-ассистента',
5
+ icon: 'image:tune',
4
6
  order: 16,
5
7
  async allowUse($context, params) {
6
8
  if (!$context?.id || $context?.DATA?.usersContainer)
@@ -36,32 +38,6 @@ export default {
36
38
  flex-direction: column;
37
39
  gap: 16px;
38
40
  }
39
- .header {
40
- display: flex;
41
- align-items: center;
42
- gap: 12px;
43
- }
44
- .title-ico {
45
- width: 40px;
46
- height: 40px;
47
- border-radius: 10px;
48
- display: flex;
49
- align-items: center;
50
- justify-content: center;
51
- background: color-mix(in srgb, var(--accent-color, #2563eb) 14%, transparent);
52
- color: var(--accent-color, #2563eb);
53
- flex-shrink: 0;
54
- }
55
- h2 {
56
- margin: 0;
57
- font-size: 18px;
58
- font-weight: 700;
59
- }
60
- .subtitle {
61
- margin: 3px 0 0;
62
- font-size: 13px;
63
- opacity: 0.75;
64
- }
65
41
  .card {
66
42
  border: 1px solid var(--subtle-border, var(--border-color, rgba(128, 128, 128, 0.25)));
67
43
  border-radius: 12px;
@@ -128,16 +104,6 @@ export default {
128
104
  </style>
129
105
 
130
106
  <div class="page">
131
- <div class="header">
132
- <div class="title-ico">
133
- <oda-icon icon="icons:tune" icon-size="22"></oda-icon>
134
- </div>
135
- <div>
136
- <h2>Личные настройки</h2>
137
- <p class="subtitle">{{targetTitle}} · Индивидуальные параметры интерфейса и работы ИИ-ассистента.</p>
138
- </div>
139
- </div>
140
-
141
107
  <div class="card">
142
108
  <div class="card-title">Искусственный интеллект</div>
143
109
  <div class="field">
@@ -178,6 +144,9 @@ export default {
178
144
  settingChatSound: true,
179
145
  statusText: '',
180
146
  statusError: false,
147
+ get headerDescription() {
148
+ return `${this.targetTitle} · Индивидуальные параметры интерфейса и работы ИИ-ассистента.`;
149
+ },
181
150
  get targetUid() {
182
151
  return this.$item?.id || WORK?.uid || '';
183
152
  },
@@ -3,11 +3,12 @@ export default {
3
3
  if (!$context?.id || $context?.DATA?.usersContainer)
4
4
  return false;
5
5
  const uid = $context?.constructor?.resolveUid?.(params) || params?.session?.uid || '';
6
- if (uid && $context.id === uid)
7
- return true;
8
6
  if (globalThis.WORK?.DEV_MODE)
9
7
  return true;
10
- const roles = await globalThis.WORK?.roles?.(params).catch(() => []);
11
- return Array.isArray(roles) && roles.includes('BOSS');
8
+ if (uid && $context.id === uid) {
9
+ const scope = await globalThis.WORK?.my_scope?.(params).catch(() => null);
10
+ return Boolean(scope?.hasAnyRole || scope?.isWorkBoss);
11
+ }
12
+ return Boolean(await globalThis.WORK?._isWorkBoss?.(params).catch(() => false));
12
13
  },
13
14
  };
@@ -1,13 +1,21 @@
1
1
  import '/sources/modules/user-profile/user-tokens.js';
2
2
  export default {
3
3
  label: 'Токены',
4
+ title: 'Токены подключений',
5
+ description: 'Персональные токены для расширения WORK Chrome Bridge и внешних ИИ-клиентов (MCP: OpenCode, Claude Code, Cursor).',
4
6
  icon: 'communication:vpn-key',
5
7
  order: 18,
6
- allowUse($context, params) {
8
+ async allowUse($context, params) {
7
9
  if (!$context?.id || $context?.DATA?.usersContainer)
8
10
  return false;
9
11
  const uid = $context?.constructor?.resolveUid?.(params) || params?.session?.uid || '';
10
- return Boolean(uid && $context.id === uid);
12
+ if (globalThis.WORK?.DEV_MODE)
13
+ return true;
14
+ if (uid && $context.id === uid) {
15
+ const scope = await globalThis.WORK?.my_scope?.(params).catch(() => null);
16
+ return Boolean(scope?.hasAnyRole || scope?.isWorkBoss);
17
+ }
18
+ return Boolean(await globalThis.WORK?._isWorkBoss?.(params).catch(() => false));
11
19
  },
12
20
  component: {
13
21
  template: /* html */`
@@ -1,5 +1,6 @@
1
1
  export default {
2
2
  label: 'Пользователи',
3
+ description: 'Учётные записи пользователей системы, статусы активности и быстрый вход в профиль',
3
4
  icon: 'social:people',
4
5
  order: 15,
5
6
  default: true,