@consilium108/mcp-module-experts 0.0.0-stage → 1.0.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 (unreleased)
4
+
5
+ <!-- generated by Claude (Opus 5.5), 2026-11-20; Konsilium #442, SDD flows/sdd-consilium-mcp-modules -->
6
+
7
+ - First release: the Experts module moved out of `@consilium108/mcp` 0.6.x (groups `experts`, `outside`,
8
+ code moved verbatim; catalog texts in `i18n/*.json`, en, ru, th, zh). Tools: `list_experts`, `get_expert`, `suggest_experts`, `ask_expert`, `get_answer`, `withdraw_question`, `edit_question`, `publish_open_question`, `list_open_questions`, `get_open_answers`, `list_questions`, `ask_expert_outside`. Peer host `@consilium108/mcp`
9
+ `>=0.7.0 <1`; module contract `@nativemind108/mcp` `^1.13.0` (`defineMcpModule`).
package/LICENSE ADDED
@@ -0,0 +1,289 @@
1
+ # ข้อตกลงสิทธิการใช้งาน NativeMindNONC (ประเทศไทย)
2
+
3
+ ### 1. ข้อกำหนดทั่วไป
4
+
5
+ ข้อตกลงนี้อยู่ภายใต้บังคับของพระราชบัญญัติลิขสิทธิ์ พ.ศ. 2537 และแก้ไขเพิ่มเติม รวมถึงประมวลกฎหมายแพ่งและพาณิชย์แห่งราชอาณาจักรไทย
6
+
7
+ ผู้ถือลิขสิทธิ์: บริษัทผู้พัฒนาซอฟต์แวร์
8
+
9
+ เครื่องหมายการค้าของผลิตภัณฑ์ได้รับการจดทะเบียนและถือครองโดยผู้ถือลิขสิทธิ์
10
+
11
+ ลิขสิทธิ์ © 2010-2025 ผู้ถือลิขสิทธิ์ สงวนลิขสิทธิ์
12
+
13
+ ### 2. เงื่อนไขการใช้งาน
14
+
15
+ การใช้งานโปรแกรมซอฟต์แวร์ ("ผลิตภัณฑ์") ถือว่าท่านยอมรับข้อกำหนดและเงื่อนไขตามข้อตกลงฉบับนี้ หากท่านไม่ยอมรับ โปรดหยุดใช้งานผลิตภัณฑ์โดยทันที
16
+
17
+ #### 2.1. การเผยแพร่ซอร์สโค้ด
18
+
19
+ เมื่อท่านใช้งานซอร์สโค้ดของผลิตภัณฑ์ ท่านมีหน้าที่:
20
+
21
+ - เผยแพร่ซอร์สโค้ดของท่านผ่าน GitHub โดยทำเป็น Fork ของ Repository อย่างเป็นทางการ
22
+ - ปรับปรุงให้เป็นปัจจุบันอยู่เสมอเพื่อสะท้อนการเปลี่ยนแปลงจากต้นฉบับ
23
+ - ระบุให้ชัดเจนว่าซอร์สโค้ดของท่านเป็น Fork ของ Repository ดั้งเดิม
24
+
25
+ #### 2.2. การเผยแพร่อัตโนมัติ
26
+
27
+ การเผยแพร่ทุกครั้งต้องดำเนินการผ่าน GitHub Actions เท่านั้น
28
+
29
+ #### 2.3. การให้เครดิต (Attribution)
30
+
31
+ เมื่อเผยแพร่ผลิตภัณฑ์ที่ดัดแปลงจากผลิตภัณฑ์ต้นฉบับ ท่านต้อง:
32
+
33
+ - ระบุเครดิตของผู้ถือลิขสิทธิ์พร้อมลิงก์ไปที่ Repository ดั้งเดิม
34
+ - แสดงลิงก์ไปยังข้อตกลงสิทธิ์ดั้งเดิม
35
+ - บันทึกการเปลี่ยนแปลงใน README ของ Repository ของท่าน
36
+
37
+ #### 2.4. ห้ามการใส่มัลแวร์
38
+
39
+ ห้ามอย่างเด็ดขาดที่จะเพิ่มมัลแวร์หรือรหัสอันตรายใด ๆ ลงในผลิตภัณฑ์
40
+
41
+ #### 2.5. ข้อจำกัดการใช้ชื่อและอินเทอร์เฟซ
42
+
43
+ ห้ามเผยแพร่แอปพลิเคชันในร้านค้าแอปใดๆ เช่น Google Play, App Store, F-Droid, Microsoft Store, Huawei AppGallery หรือแพลตฟอร์มอื่นใดด้วยชื่อหรือหน้าตาที่คล้ายกับผลิตภัณฑ์ต้นฉบับจนอาจทำให้เกิดความเข้าใจผิด
44
+
45
+ #### 2.6. การใช้งานเชิงพาณิชย์
46
+
47
+ **ฟรีสำหรับการใช้งานที่ไม่ใช่เชิงพาณิชย์**: ผลิตภัณฑ์นี้ฟรีสำหรับการใช้งานที่ไม่ใช่เชิงพาณิชย์ รวมถึง:
48
+ - สถาบันการศึกษา (โรงเรียน มหาวิทยาลัย วิทยาลัย)
49
+ - วัตถุประสงค์ทางการศึกษาและการฝึกอบรม
50
+ - การวิจัยและพัฒนาสำหรับโครงการที่ไม่ใช่เชิงพาณิชย์
51
+ - การเรียนรู้และการพัฒนาส่วนบุคคล
52
+
53
+ **การใช้งานเชิงพาณิชย์ต้องมีใบอนุญาต**: การใช้งานเชิงพาณิชย์ของผลิตภัณฑ์นี้ต้องได้รับอนุญาตเป็นลายลักษณ์อักษรจากผู้ถือลิขสิทธิ์ก่อนดำเนินการเชิงพาณิชย์ใดๆ รวมถึง:
54
+ - การขายหรือจำหน่ายเพื่อหากำไร
55
+ - การใช้งานในผลิตภัณฑ์หรือบริการเชิงพาณิชย์
56
+ - แอปพลิเคชันทางธุรกิจ
57
+ - กิจกรรมใดๆ ที่สร้างรายได้
58
+
59
+ #### 2.7. สิทธิของนักพัฒนาและโครงสร้างบริษัท
60
+
61
+ สิทธิทั้งหมดเป็นของนักพัฒนาที่เฉพาะเจาะจงซึ่งเป็นส่วนหนึ่งของบริษัทที่พัฒนาซอฟต์แวร์นี้ นักพัฒนาอาจ:
62
+ - นำเสนอโค้ดและผลงานในงานแสดงสินค้าและงานประชุม
63
+ - แสดงความสำเร็จทางเทคนิคของตนต่อสาธารณะ
64
+ - ใช้ผลงานของตนเพื่อพอร์ตโฟลิโอทางวิชาชีพและการพัฒนาอาชีพ
65
+
66
+ อย่างไรก็ตาม นักพัฒนาไม่สามารถ:
67
+ - ใช้โค้ดหรือผลงานเพื่อวัตถุประสงค์เชิงพาณิชย์ส่วนตัว
68
+ - อนุญาตให้ใช้ซอฟต์แวร์อย่างอิสระนอกเหนือจากโครงสร้างบริษัท
69
+ - โอนสิทธิเชิงพาณิชย์โดยไม่ได้รับอนุญาตจากบริษัท
70
+
71
+ การอนุญาตเชิงพาณิชย์ทั้งหมดต้องดำเนินการผ่านบริษัทที่จ้างนักพัฒนาเหล่านี้
72
+
73
+ #### 2.8. การเผยแพร่ภายใต้เงื่อนไขเดียวกัน (ShareAlike)
74
+
75
+ ผลงานที่สร้างจากผลิตภัณฑ์นี้ต้องถูกเผยแพร่ภายใต้ข้อตกลงสิทธิ์เดียวกันและในรูปแบบ Open Source ผ่านการ Fork จาก Repository ดั้งเดิม
76
+
77
+ ### 3. การใช้งานส่วนประกอบ Open Source
78
+
79
+ ผลิตภัณฑ์ประกอบด้วยส่วนประกอบ Open Source ที่ได้รับอนุญาตตามเงื่อนไขอื่นๆ การใช้งานผลิตภัณฑ์หมายถึงท่านยอมรับเงื่อนไขของแต่ละส่วนประกอบด้วย รายละเอียดระบุไว้ในไฟล์ LICENSE.md ที่แนบมาพร้อมผลิตภัณฑ์
80
+
81
+ ### 4. การปฏิเสธความรับผิด
82
+
83
+ ผลิตภัณฑ์นี้ให้บริการ "ตามสภาพ" โดยไม่มีการรับประกันใดๆ ทั้งสิ้น ไม่ว่าจะแจ้งชัดหรือโดยนัย รวมถึงการรับประกันด้านความเหมาะสมกับวัตถุประสงค์เฉพาะใดๆ และผู้ถือลิขสิทธิ์จะไม่รับผิดชอบต่อความเสียหายใดๆ อันเกิดจากการใช้งานผลิตภัณฑ์นี้
84
+
85
+ ### 5. การละเมิดข้อตกลง
86
+
87
+ ในกรณีที่มีการละเมิดข้อตกลงนี้ ผู้ถือลิขสิทธิ์มีสิทธิ์ขอให้หยุดเผยแพร่ผลิตภัณฑ์ และอาจดำเนินการทางกฎหมายหรือแจ้งไปยังร้านค้าแอปพลิเคชันเพื่อให้มีการลบหรือระงับการเผยแพร่ผลิตภัณฑ์ที่ละเมิด
88
+
89
+ ข้อพิพาทใดๆ จะต้องได้รับการตัดสินตามกฎหมายแห่งราชอาณาจักรไทย
90
+
91
+ ---
92
+
93
+ การใช้งานผลิตภัณฑ์หมายถึงท่านได้อ่าน เข้าใจ และยอมรับข้อกำหนดและเงื่อนไขทั้งหมดตามข้อตกลงนี้แล้ว
94
+
95
+ ---
96
+
97
+ ## Лицензионное соглашение (Российская Федерация)
98
+
99
+ ### 1. Общие положения
100
+
101
+ Настоящая лицензия регулируется нормами Гражданского кодекса Российской Федерации (часть IV, статьи 1225-1301) и иных применимых законодательных актов РФ.
102
+
103
+ Правообладатель: Компания-разработчик программного обеспечения
104
+
105
+ Товарный знак продукта зарегистрирован и принадлежит правообладателю.
106
+
107
+ © 2010-2025 Правообладатель. Все права защищены.
108
+
109
+ ### 2. Условия использования
110
+
111
+ Используя программный продукт ("Продукт"), вы подтверждаете согласие с условиями настоящей лицензии. В случае несогласия вы обязаны немедленно прекратить использование и распространение Продукта.
112
+
113
+ #### 2.1. Доступность исходного кода
114
+
115
+ При использовании исходного кода Продукта вы обязаны:
116
+
117
+ - Опубликовать производный код исключительно в виде публичного репозитория на платформе GitHub в виде форка официального репозитория
118
+ - Своевременно обновлять свой репозиторий, отражая изменения в официальных релизах
119
+ - Указывать в репозитории, что он является форком официального репозитория
120
+
121
+ #### 2.2. Автоматизация релизов
122
+
123
+ Все релизы Продукта должны осуществляться исключительно через GitHub Actions.
124
+
125
+ #### 2.3. Обязательная атрибуция
126
+
127
+ При распространении производного Продукта вы обязаны:
128
+
129
+ - Указывать автора и давать соответствующую ссылку на официальный репозиторий
130
+ - Размещать ссылку на оригинальную лицензию
131
+ - Документировать изменения, сделанные вами в README вашего репозитория
132
+
133
+ #### 2.4. Запрет вредоносного ПО
134
+
135
+ Категорически запрещается встраивать любое вредоносное программное обеспечение (вирусы, трояны и т.п.).
136
+
137
+ #### 2.5. Ограничения на использование имени и интерфейса
138
+
139
+ Запрещается публикация производных продуктов под названием или с пользовательским интерфейсом, сходным до степени смешения с оригинальным продуктом, на любых площадках распространения программного обеспечения (например, Google Play, App Store, RuStore, NashStore, AppGallery, VK Play и других площадках).
140
+
141
+ #### 2.6. Некоммерческое использование
142
+
143
+ **Бесплатно для некоммерческого использования**: Данный продукт бесплатен для некоммерческого использования, включая:
144
+ - Образовательные учреждения (школы, университеты, колледжи)
145
+ - Образовательные и обучающие цели
146
+ - Исследования и разработки для некоммерческих проектов
147
+ - Личное обучение и развитие
148
+
149
+ **Коммерческое использование требует лицензии**: Использование Продукта в коммерческих целях (продажа, реклама, иные коммерческие операции) допускается исключительно после письменного согласия правообладателя.
150
+
151
+ #### 2.7. Права разработчиков и структура компании
152
+
153
+ Все права принадлежат конкретным разработчикам, которые входят в состав компании, разрабатывающей данное программное обеспечение. Разработчики могут:
154
+ - Представлять код и результаты работы на выставках и конференциях
155
+ - Демонстрировать свои технические достижения публично
156
+ - Использовать свою работу для профессионального портфолио и развития карьеры
157
+
158
+ Однако разработчики не могут:
159
+ - Использовать код или результаты работы для личных коммерческих целей
160
+ - Лицензировать программное обеспечение независимо вне структуры компании
161
+ - Передавать коммерческие права без разрешения компании
162
+
163
+ Все коммерческое лицензирование должно проводиться через компанию, которая нанимает этих разработчиков.
164
+
165
+ #### 2.8. Условие аналогичного распространения (ShareAlike)
166
+
167
+ Любое изменение, адаптация или создание производных работ на основе Продукта должно распространяться исключительно на условиях настоящей лицензии и с открытым исходным кодом через форк официального репозитория.
168
+
169
+ ### 3. Использование компонентов с открытым исходным кодом
170
+
171
+ Продукт содержит компоненты с открытым исходным кодом, лицензируемые отдельно. Пользуясь Продуктом, вы принимаете условия лицензий каждого компонента. Подробности указаны в файле LICENSE.md, входящем в комплект поставки.
172
+
173
+ ### 4. Ответственность сторон
174
+
175
+ Продукт предоставляется «как есть», без каких-либо гарантий, явных или подразумеваемых, в том числе гарантий пригодности для определённых целей и отсутствия нарушений прав третьих лиц. Правообладатель не несёт ответственности за убытки, возникающие вследствие использования или невозможности использования Продукта.
176
+
177
+ ### 5. Нарушение условий лицензии
178
+
179
+ При нарушении условий настоящей лицензии правообладатель вправе требовать прекращения распространения Продукта, а также обратиться в суд или обратиться с жалобой в соответствующие площадки распространения программного обеспечения для удаления или ограничения доступа к нарушающим продуктам.
180
+
181
+ Споры разрешаются в порядке, установленном законодательством Российской Федерации.
182
+
183
+ ---
184
+
185
+ Используя Продукт, вы подтверждаете, что прочитали, поняли и полностью принимаете условия настоящей лицензии.
186
+
187
+ ---
188
+
189
+ ## License Agreement (English)
190
+
191
+ ### 1. General Provisions
192
+
193
+ This agreement is governed by copyright laws and intellectual property regulations of the jurisdiction where the software is used.
194
+
195
+ Copyright Holder: Software Development Company
196
+
197
+ The product trademark is registered and owned by the copyright holder.
198
+
199
+ Copyright © 2010-2025 Copyright Holder. All rights reserved.
200
+
201
+ ### 2. Usage Terms
202
+
203
+ By using the software product ("Product"), you agree to accept the terms and conditions of this agreement. If you do not agree, please stop using the product immediately.
204
+
205
+ #### 2.1. Source Code Publication
206
+
207
+ When using the source code of the Product, you are obligated to:
208
+
209
+ - Publish your source code through GitHub by creating a Fork of the official Repository
210
+ - Keep it updated to reflect changes from the original
211
+ - Clearly indicate that your source code is a Fork of the original Repository
212
+
213
+ #### 2.2. Automatic Publication
214
+
215
+ All publications must be conducted through GitHub Actions only.
216
+
217
+ #### 2.3. Attribution
218
+
219
+ When publishing products derived from the original Product, you must:
220
+
221
+ - Credit the copyright holder with a link to the original Repository
222
+ - Display a link to the original license agreement
223
+ - Record changes in the README of your Repository
224
+
225
+ #### 2.4. Malware Prohibition
226
+
227
+ It is strictly prohibited to add malware or any dangerous code to the product.
228
+
229
+ #### 2.5. Name and Interface Usage Restrictions
230
+
231
+ It is prohibited to publish applications in any app store (Google Play, App Store, F-Droid, Microsoft Store, Huawei AppGallery, or other platforms) with names or interfaces similar to the original product that may cause confusion.
232
+
233
+ #### 2.6. Commercial Use
234
+
235
+ **Free for Non-Commercial Use**: This product is free for non-commercial use including:
236
+ - Educational institutions (schools, universities, colleges)
237
+ - Educational and training purposes
238
+ - Research and development for non-commercial projects
239
+ - Personal learning and development
240
+
241
+ **Commercial Use Requires License**: Commercial use of this product requires a written license agreement from the copyright holder before any commercial activities including:
242
+ - Selling or distributing for profit
243
+ - Using in commercial products or services
244
+ - Business applications
245
+ - Any revenue-generating activities
246
+
247
+ #### 2.7. Developer Rights and Company Structure
248
+
249
+ All rights belong to specific developers who are part of the company that develops this software. Developers may:
250
+ - Present code and work results at exhibitions and conferences
251
+ - Showcase their technical achievements publicly
252
+ - Use their work for professional portfolio and career development
253
+
254
+ However, developers cannot:
255
+ - Use the code or work results for personal commercial purposes
256
+ - License the software independently outside the company structure
257
+ - Transfer commercial rights without company authorization
258
+
259
+ All commercial licensing must be conducted through the company that employs these developers.
260
+
261
+ #### 2.8. License Standardization
262
+
263
+ This license may become a standard and other companies may copy the license text for their own use, similar to MIT, Apache, or GPL licenses.
264
+
265
+ #### 2.9. ShareAlike Requirement
266
+
267
+ Any work created from this product must be published under the same license terms and in open source format through a Fork from the original Repository.
268
+
269
+ ### 3. Open Source Components
270
+
271
+ The Product includes Open Source components licensed under different terms. Using the Product means you accept the terms of each component as well. Details are specified in the LICENSE.md file included with the product.
272
+
273
+ ### 4. Disclaimer
274
+
275
+ This product is provided "as is" without any warranties, whether express or implied, including warranties of merchantability, fitness for a particular purpose, and non-infringement. The copyright holder shall not be liable for any damages arising from the use of this product.
276
+
277
+ ### 5. License Violations
278
+
279
+ In case of violation of this agreement, the copyright holder has the right to request cessation of product distribution and may take legal action or notify app stores to remove or suspend distribution of violating products.
280
+
281
+ Any disputes shall be resolved according to the laws of the jurisdiction where the copyright holder is incorporated.
282
+
283
+ ---
284
+
285
+ Using the Product means you have read, understood, and accepted all terms and conditions of this agreement.
286
+
287
+ ---
288
+
289
+ # NativeMindNONC License Agreement
package/README.md CHANGED
@@ -1,3 +1,28 @@
1
- # Temporary Holding Version
1
+ # @consilium108/mcp-module-experts
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <!-- generated by Claude (Opus 5.5), 2026-11-20; Konsilium #442, SDD flows/sdd-consilium-mcp-modules. Раздел составлен ассистентом. -->
4
+
5
+ Модуль **Эксперты** (Experts) MCP Консилиума: Поиск экспертов команды, вопросы им и их ответы; открытые вопросы; внешние эксперты.
6
+
7
+ - Хост — [`@consilium108/mcp`](https://www.npmjs.com/package/@consilium108/mcp) `>=0.7.0 <1` (peer). В 0.x хост сам ставит и
8
+ загружает все пять модулей, поэтому `npx @consilium108/mcp` и облачный `/mcp` дают прежний набор инструментов.
9
+ - Контракт модуля — `defineMcpModule` из [`@nativemind108/mcp`](https://www.npmjs.com/package/@nativemind108/mcp)
10
+ `^1.13.0`; хост проверяет совместимость (`ModuleHost`), дубли инструментов и сливает тексты.
11
+ - Модуль не получает учётных данных: только помощники хоста `h` (тексты, REST с ключом пользователя, формы).
12
+ - Человек включает или выключает модуль для каждого подключения (страница согласия OAuth, «Подключённые приложения»);
13
+ сервер проверяет модуль на каждом вызове (MCP, REST/GraphQL по ключу, события) — ошибка `module_disabled`.
14
+ Права (scopes) не меняются: доступ = модуль включён И право есть.
15
+
16
+ Инструменты сервера: `list_experts`, `get_expert`, `suggest_experts`, `ask_expert`, `get_answer`, `withdraw_question`, `edit_question`, `publish_open_question`, `list_open_questions`, `get_open_answers`, `list_questions`, `ask_expert_outside`.
17
+
18
+ Локальные инструменты (только локальный runtime; код пока в ядре): —.
19
+
20
+ Права: `experts:read`, `questions:ask`, `questions:read`, `me:ask_outside`. Промпты: `ask_expert`.
21
+
22
+ ```js
23
+ import mod from '@consilium108/mcp-module-experts';
24
+ mod.id; // 'experts'
25
+ Object.keys(mod.groups);
26
+ ```
27
+
28
+ Лицензия: NativeMindNONC (см. LICENSE).
package/i18n/en.json ADDED
@@ -0,0 +1,117 @@
1
+ {
2
+ "tools": {
3
+ "list_experts": {
4
+ "title": "List experts",
5
+ "description": "List published Konsilium experts. Filter by category id (e.g. db, security, backend, design, legal, marketing, business_th), free-text query, language (ru/en/th) or country. `inTeam` shows whether the expert is already in this project's team (only team experts can be asked).",
6
+ "params": {
7
+ "category": "Area id, e.g. db, security, analyst, feedback_th.",
8
+ "query": "Free-text search over name, role and bio.",
9
+ "lang": "Language the expert speaks: ru, en, th, zh …",
10
+ "country": "Country of the expert."
11
+ }
12
+ },
13
+ "get_expert": {
14
+ "title": "Expert profile",
15
+ "description": "Full profile of an expert: bio, areas, languages, location, experience (role, client, market, period, result) and portfolio/case links.",
16
+ "params": {
17
+ "expert_id": "Expert id from list_experts / suggest_experts."
18
+ }
19
+ },
20
+ "suggest_experts": {
21
+ "title": "Suggest experts",
22
+ "description": "Suggest up to 5 experts for a task description (keyword match over areas, role and bio). With `level` up to 2 experts from the learning stream of that area may be added, marked `learner: true` (they answer for experience — tell the user).",
23
+ "params": {
24
+ "task": "What needs to be decided or done, in a sentence or two.",
25
+ "level": "How deep the answer must be: basic | medium | advanced | expert (optional)."
26
+ }
27
+ },
28
+ "ask_expert": {
29
+ "title": "Ask an expert",
30
+ "description": "Send a question to human experts of this project. Pass either `expert_id` (one person) or `category` (an area such as analyst, db, security, design, feedback_th): with `category` the question goes to ALL team experts of that area at once, the first answer wins and the question disappears for the others — prefer this when several experts share the area. Or pass `invite_name` for a person invited to this project who has not joined yet: the question waits (status waiting_invite, same question_id from the start; options, deadline and urgency work; editable with edit_question until delivered) and is delivered when they accept. Returns question_id immediately; the answer is asynchronous — call get_answer later (optionally with wait_seconds). Provide concise context (code, constraints) in `context`. Mark `stage` (SDD: requirements → business/owner and domain experts, specifications → analysts + technical expert, plan → tech lead/DevOps/QA, implementation → narrow specialist, review → QA/security) and `kind` (expertise question | feedback/review request | coordination of plans between people). Ask humans when: the decision belongs to a person (priorities, money, commitments, legal liability); you need a private/current fact about people or organizations; a mistake is costly or irreversible; local knowledge is needed; you are not confident or sources conflict; at an SDD stage gate. Answer yourself when the fact is verifiable in code/docs/open sources, the decision is cheap and reversible, or it is standard practice. Before asking, search the project knowledge base. Keep questions short, offer options and your own draft (\"I propose X — correct?\"), batch questions of one stage into one message. Pass `options` (2–20 short strings) for a multiple-choice question — the expert answers with one button tap; get_answer returns `answer_option` (index) and the option text. Experts declare accepted types (`accepts`: open | choice in list_experts/get_expert): if an expert accepts only `choice`, you must pass options; an expert who accepts only `open` cannot get options. Several experts at once: pass `expert_ids` (and optionally `want_answers` = how many opinions you need, default 1 — then the question is withdrawn from the others). Every question has a deadline: `deadline_hours` in the expert's working hours (default — the project setting, 24), `urgent` = 2 clock hours. If nobody answers by the deadline, the project may publish it as an open question (get_answer → `escalated`). A repeated call with the same question within 10 minutes returns the existing question (deduplicated: true), so a retry after a 502 / timeout does not reach the expert twice.",
31
+ "params": {
32
+ "expert_id": "One expert of the project team.",
33
+ "category": "An area: the question goes to all team experts of it, the first answer wins.",
34
+ "include_invitees": "With `category`: also send to people invited to this project with this area who haven't joined yet (they get it on accepting; the first answer closes it for them too). Default: true for questions with options, false for open questions.",
35
+ "invite_name": "Name of an invited person who has not joined yet; the question waits for them.",
36
+ "stage": "SDD stage of the question.",
37
+ "kind": "expertise — a question; feedback — a review request; coordination — agreeing plans between people.",
38
+ "question": "The question itself: short, with options and your proposal.",
39
+ "context": "Concise context: code, constraints, links.",
40
+ "options": "2–20 short answer variants for a multiple-choice question.",
41
+ "device": "Recommended device for answering: phone (quick, options), desktop (code review, long context, attachments), tablet, or any. Omit to auto-detect; it is a recommendation, the expert may answer from anywhere.",
42
+ "expert_ids": "Several experts at once (ids); the first want_answers answers close the question for the others.",
43
+ "want_answers": "How many opinions you need from expert_ids (default 1).",
44
+ "deadline_hours": "Deadline in the experts' working hours (default: project setting, 24).",
45
+ "urgent": "Urgent: 2 clock hours, may wake the expert (if they allow it).",
46
+ "purpose": "With invite_name: profile = a clarifying question about the person themself (what they do now, links, contacts, logistics, is the invitation clear): not shown on the invitation card, delivered after onboarding, no deadline, price or rating. expertise = a question on their profession (default; detected automatically when omitted)."
47
+ }
48
+ },
49
+ "get_answer": {
50
+ "title": "Get answer",
51
+ "description": "Get the status/answer of a question (or of an area question group). wait_seconds (0–50) long-polls until an expert answers or the wait ends. Statuses: pending, answered, declined, redirected. Also returns deadline_at, expired, escalated (open question id and url when the deadline passed and the question went public) and, for several opinions, answers[].",
52
+ "params": {
53
+ "question_id": "Question (or group) id from ask_expert.",
54
+ "invite_question_id": "Id of a question waiting for an invitee.",
55
+ "wait_seconds": "Wait up to this many seconds (0–50) for an answer."
56
+ }
57
+ },
58
+ "withdraw_question": {
59
+ "title": "Withdraw question",
60
+ "description": "Take back your own pending question (e.g. merged into a summary or no longer relevant). The expert sees it was withdrawn.",
61
+ "params": {
62
+ "question_id": "Your pending question.",
63
+ "reason": "Why it is withdrawn (shown to the expert).",
64
+ "silent": "Withdraw without notifying the expert (e.g. the person is overloaded)."
65
+ }
66
+ },
67
+ "edit_question": {
68
+ "title": "Edit question",
69
+ "description": "Change your question while the addressee has not seen it yet (it waits for an invited person, or is not delivered yet): new text, answer options (2–20, buttons) or context. E.g. turn an open question into a choice question.",
70
+ "params": {
71
+ "question_id": "The #qN.",
72
+ "question": "New text.",
73
+ "options": "Answer options (2–20).",
74
+ "context": "Context."
75
+ }
76
+ },
77
+ "publish_open_question": {
78
+ "title": "Propose an open question",
79
+ "description": "Propose a PUBLIC question of this project: after the owner confirms it in Telegram it is visible to everyone on konsilium.nativemind.net/open and anyone can answer via the bot. Never put private data, secrets or client names into it. Returns status pending until the owner confirms.",
80
+ "params": {
81
+ "text": "The question, short and clear.",
82
+ "context": "Optional background (also public).",
83
+ "options": "Optional answer options (2–20)."
84
+ }
85
+ },
86
+ "list_open_questions": {
87
+ "title": "Open questions",
88
+ "description": "Open (public) questions of this project with answer counts: status pending | open | closed | rejected.",
89
+ "params": {}
90
+ },
91
+ "get_open_answers": {
92
+ "title": "Open question answers",
93
+ "description": "All answers to an open question of this project (accepted, new and hidden), with the author display name and channel.",
94
+ "params": {
95
+ "open_question_id": "Open question id."
96
+ }
97
+ },
98
+ "list_questions": {
99
+ "title": "Project questions",
100
+ "description": "Questions of this project, newest first.",
101
+ "params": {
102
+ "status": "Only questions with this status.",
103
+ "limit": "How many (1–100), newest first."
104
+ }
105
+ },
106
+ "ask_expert_outside": {
107
+ "title": "Ask an expert (personal)",
108
+ "description": "Ask a published expert a personal question, not tied to a project. Works only if the expert accepts questions from outside their teams. Kept in the owner's personal inbox project; check answers with my_questions.",
109
+ "params": {
110
+ "expert_id": "Expert id",
111
+ "question": "The question",
112
+ "context": "Optional context",
113
+ "options": "Optional answer options (2–20)"
114
+ }
115
+ }
116
+ }
117
+ }
package/i18n/ru.json ADDED
@@ -0,0 +1,117 @@
1
+ {
2
+ "tools": {
3
+ "list_experts": {
4
+ "title": "Список экспертов",
5
+ "description": "Опубликованные эксперты Консилиума. Фильтры: id области (например, db, security, backend, design, legal, marketing, business_th), поиск по тексту, язык (ru/en/th) или страна. `inTeam` показывает, состоит ли эксперт уже в команде проекта (спрашивать можно только экспертов команды).",
6
+ "params": {
7
+ "category": "Id области, например db, security, analyst, feedback_th.",
8
+ "query": "Поиск по имени, роли и описанию.",
9
+ "lang": "Язык, на котором говорит эксперт: ru, en, th, zh …",
10
+ "country": "Страна эксперта."
11
+ }
12
+ },
13
+ "get_expert": {
14
+ "title": "Профиль эксперта",
15
+ "description": "Полный профиль эксперта: описание, области, языки, местоположение, опыт (роль, клиент, рынок, период, результат) и ссылки на портфолио/кейсы.",
16
+ "params": {
17
+ "expert_id": "Id эксперта из list_experts / suggest_experts."
18
+ }
19
+ },
20
+ "suggest_experts": {
21
+ "title": "Подобрать экспертов",
22
+ "description": "Подобрать до 5 экспертов по описанию задачи (совпадение слов с областями, ролью и описанием). С `level` могут добавиться до 2 экспертов из потока обучения этой области с пометкой `learner: true` (отвечают ради опыта — скажите об этом пользователю).",
23
+ "params": {
24
+ "task": "Что нужно решить или сделать — одно-два предложения.",
25
+ "level": "Насколько глубокий нужен ответ: basic | medium | advanced | expert (необязательно)."
26
+ }
27
+ },
28
+ "ask_expert": {
29
+ "title": "Спросить эксперта",
30
+ "description": "Отправить вопрос людям-экспертам этого проекта. Передай либо `expert_id` (один человек), либо `category` (область, например analyst, db, security, design, feedback_th): с `category` вопрос уходит сразу ВСЕМ экспертам команды в этой области, побеждает первый ответ, у остальных вопрос исчезает — предпочитай это, когда область покрывают несколько экспертов. Или передай `invite_name` для человека, приглашённого в этот проект, который ещё не вошёл: вопрос ждёт (статус waiting_invite, тот же question_id с самого начала; варианты, срок и срочность работают; до доставки можно править через edit_question) и доставляется, когда он примет приглашение. question_id возвращается сразу; ответ асинхронный — вызови get_answer позже (можно с wait_seconds). Дай краткий контекст (код, ограничения) в `context`. Укажи `stage` (SDD: requirements → бизнес/владелец и предметные эксперты, specifications → аналитики + технический эксперт, plan → техлид/DevOps/QA, implementation → узкий специалист, review → QA/безопасность) и `kind` (вопрос по экспертизе | запрос отзыва/ревью | согласование планов между людьми). Спрашивай людей, когда: решение принадлежит человеку (приоритеты, деньги, обязательства, юридическая ответственность); нужен частный/актуальный факт о людях или организациях; ошибка дорогая или необратимая; нужно местное знание; ты не уверен или источники противоречат друг другу; на переходе между стадиями SDD. Отвечай сам, когда факт проверяется по коду/документации/открытым источникам, решение дешёвое и обратимое или это стандартная практика. Перед вопросом поищи в базе знаний проекта. Задавай вопросы коротко, предлагай варианты и свой черновик («Предлагаю X — верно?»), вопросы одной стадии объединяй в одно сообщение. Передай `options` (2–20 коротких строк) для вопроса с вариантами — эксперт отвечает одним нажатием кнопки; get_answer возвращает `answer_option` (индекс) и текст варианта. Эксперты указывают, какие вопросы принимают (`accepts`: open | choice в list_experts/get_expert): если эксперт принимает только `choice`, ты обязан передать options; эксперту, который принимает только `open`, варианты передавать нельзя. Несколько экспертов сразу: передайте `expert_ids` (и при желании `want_answers` — сколько мнений нужно, по умолчанию 1 — после этого вопрос снимается у остальных). У каждого вопроса есть срок: `deadline_hours` в рабочих часах эксперта (по умолчанию — настройка проекта, 24), `urgent` — 2 астрономических часа. Если к сроку никто не ответил, проект может опубликовать вопрос как открытый (get_answer → `escalated`). Повторный вызов с тем же вопросом в течение 10 минут возвращает уже созданный вопрос (deduplicated: true), поэтому повтор после 502 / таймаута не дойдёт до эксперта дважды.",
31
+ "params": {
32
+ "expert_id": "Один эксперт из команды проекта.",
33
+ "category": "Область: вопрос уходит всем экспертам команды в ней, побеждает первый ответ.",
34
+ "include_invitees": "С `category`: также отправить приглашённым в этот проект людям этой области, которые ещё не присоединились (получат при принятии; первый ответ закрывает вопрос и для них). По умолчанию: да для вопросов с вариантами, нет для открытых.",
35
+ "invite_name": "Имя приглашённого, который ещё не вошёл; вопрос ждёт его.",
36
+ "stage": "Стадия SDD, к которой относится вопрос.",
37
+ "kind": "expertise — вопрос; feedback — запрос отзыва; coordination — согласование планов между людьми.",
38
+ "question": "Сам вопрос: коротко, с вариантами и твоим предложением.",
39
+ "context": "Краткий контекст: код, ограничения, ссылки.",
40
+ "options": "2–20 коротких вариантов ответа для вопроса с вариантами.",
41
+ "device": "Рекомендуемое устройство для ответа: phone (быстрый вопрос, варианты), desktop (код-ревью, длинный контекст, вложения), tablet или any. Не указывайте — определится автоматически; это рекомендация, эксперт может ответить с любого устройства.",
42
+ "expert_ids": "Несколько экспертов сразу (id); первые want_answers ответов снимают вопрос у остальных.",
43
+ "want_answers": "Сколько мнений нужно от expert_ids (по умолчанию 1).",
44
+ "deadline_hours": "Срок в рабочих часах экспертов (по умолчанию — настройка проекта, 24).",
45
+ "urgent": "Срочно: 2 часа, может разбудить эксперта (если он разрешил).",
46
+ "purpose": "С invite_name: profile — уточняющий вопрос о самом человеке (чем занимается сейчас, ссылки, контакты, логистика, понятно ли приглашение): не показывается в карточке приглашения, приходит после онбординга, без срока, цены и рейтинга. expertise — вопрос по его профессии (по умолчанию; если не указано — определяется автоматически)."
47
+ }
48
+ },
49
+ "get_answer": {
50
+ "title": "Получить ответ",
51
+ "description": "Статус/ответ по вопросу (или по группе вопросов области). wait_seconds (0–50) — ждать, пока эксперт ответит или время ожидания не истечёт. Статусы: pending, answered, declined, redirected. Также возвращает deadline_at, expired, escalated (id и адрес открытого вопроса, если срок истёк и вопрос опубликован) и для нескольких мнений — answers[].",
52
+ "params": {
53
+ "question_id": "Id вопроса (или группы) из ask_expert.",
54
+ "invite_question_id": "Id вопроса, ждущего приглашённого.",
55
+ "wait_seconds": "Ждать ответа до стольких секунд (0–50)."
56
+ }
57
+ },
58
+ "withdraw_question": {
59
+ "title": "Снять вопрос",
60
+ "description": "Забрать свой ожидающий вопрос (например, объединён в сводку или больше не актуален). Эксперт видит, что вопрос снят.",
61
+ "params": {
62
+ "question_id": "Твой ожидающий вопрос.",
63
+ "reason": "Почему снят (увидит эксперт).",
64
+ "silent": "Снять без уведомления эксперту (например, человек перегружен)."
65
+ }
66
+ },
67
+ "edit_question": {
68
+ "title": "Изменить вопрос",
69
+ "description": "Изменить вопрос, пока адресат его не увидел (ждёт приглашённого или ещё не доставлен): новый текст, варианты ответа (2–20, кнопки) или контекст. Например, сделать из открытого вопроса вопрос с вариантами.",
70
+ "params": {
71
+ "question_id": "Номер #qN.",
72
+ "question": "Новый текст.",
73
+ "options": "Варианты ответа (2–20).",
74
+ "context": "Контекст."
75
+ }
76
+ },
77
+ "publish_open_question": {
78
+ "title": "Предложить открытый вопрос",
79
+ "description": "Предложить ПУБЛИЧНЫЙ вопрос этого проекта: после подтверждения владельцем в Telegram он виден всем на konsilium.nativemind.net/open, ответить может любой через бота. Никогда не включай личные данные, секреты и имена клиентов. Возвращает статус pending, пока владелец не подтвердит.",
80
+ "params": {
81
+ "text": "Вопрос, коротко и понятно.",
82
+ "context": "Необязательный контекст (тоже публичный).",
83
+ "options": "Необязательные варианты ответа (2–20)."
84
+ }
85
+ },
86
+ "list_open_questions": {
87
+ "title": "Открытые вопросы",
88
+ "description": "Открытые (публичные) вопросы этого проекта с числом ответов: статус pending | open | closed | rejected.",
89
+ "params": {}
90
+ },
91
+ "get_open_answers": {
92
+ "title": "Ответы на открытый вопрос",
93
+ "description": "Все ответы на открытый вопрос этого проекта (принятые, новые и скрытые) с именем автора и каналом.",
94
+ "params": {
95
+ "open_question_id": "Номер открытого вопроса."
96
+ }
97
+ },
98
+ "list_questions": {
99
+ "title": "Вопросы проекта",
100
+ "description": "Вопросы этого проекта, сначала новые.",
101
+ "params": {
102
+ "status": "Только вопросы с этим статусом.",
103
+ "limit": "Сколько (1–100), сначала новые."
104
+ }
105
+ },
106
+ "ask_expert_outside": {
107
+ "title": "Спросить эксперта (лично)",
108
+ "description": "Задать опубликованному эксперту личный вопрос, без проекта. Работает, только если эксперт принимает вопросы вне команды. Хранится в личном проекте владельца; ответы — в my_questions.",
109
+ "params": {
110
+ "expert_id": "id эксперта",
111
+ "question": "Вопрос",
112
+ "context": "Контекст (необязательно)",
113
+ "options": "Варианты ответа (2–20, необязательно)"
114
+ }
115
+ }
116
+ }
117
+ }
package/i18n/th.json ADDED
@@ -0,0 +1,117 @@
1
+ {
2
+ "tools": {
3
+ "list_experts": {
4
+ "title": "รายชื่อผู้เชี่ยวชาญ",
5
+ "description": "ผู้เชี่ยวชาญของ Konsilium ที่เผยแพร่แล้ว กรองตาม id หมวดหมู่ (เช่น db, security, backend, design, legal, marketing, business_th) ข้อความค้นหา ภาษา (ru/en/th) หรือประเทศ `inTeam` แสดงว่าผู้เชี่ยวชาญอยู่ในทีมของโปรเจกต์นี้แล้วหรือไม่ (ถามได้เฉพาะผู้เชี่ยวชาญในทีม)",
6
+ "params": {
7
+ "category": "Id หมวดหมู่ เช่น db, security, analyst, feedback_th",
8
+ "query": "ค้นหาจากชื่อ บทบาท และประวัติ",
9
+ "lang": "ภาษาที่ผู้เชี่ยวชาญใช้: ru, en, th, zh …",
10
+ "country": "ประเทศของผู้เชี่ยวชาญ"
11
+ }
12
+ },
13
+ "get_expert": {
14
+ "title": "โปรไฟล์ผู้เชี่ยวชาญ",
15
+ "description": "โปรไฟล์เต็มของผู้เชี่ยวชาญ: ประวัติ ความเชี่ยวชาญ ภาษา สถานที่ ประสบการณ์ (บทบาท ลูกค้า ตลาด ช่วงเวลา ผลลัพธ์) และลิงก์ผลงาน/กรณีศึกษา",
16
+ "params": {
17
+ "expert_id": "Id ผู้เชี่ยวชาญจาก list_experts / suggest_experts"
18
+ }
19
+ },
20
+ "suggest_experts": {
21
+ "title": "แนะนำผู้เชี่ยวชาญ",
22
+ "description": "แนะนำผู้เชี่ยวชาญสูงสุด 5 คนตามคำอธิบายงาน (จับคู่คำกับความเชี่ยวชาญ บทบาท และประวัติ) เมื่อระบุ `level` อาจเพิ่มผู้เชี่ยวชาญจากสายการเรียนรู้ของสาขานั้นได้สูงสุด 2 คน โดยมีเครื่องหมาย `learner: true` (ตอบเพื่อหาประสบการณ์ — แจ้งผู้ใช้)",
23
+ "params": {
24
+ "task": "สิ่งที่ต้องตัดสินใจหรือทำ ในหนึ่งหรือสองประโยค",
25
+ "level": "ระดับความลึกของคำตอบ: basic | medium | advanced | expert (ไม่บังคับ)"
26
+ }
27
+ },
28
+ "ask_expert": {
29
+ "title": "ถามผู้เชี่ยวชาญ",
30
+ "description": "ส่งคำถามถึงผู้เชี่ยวชาญที่เป็นมนุษย์ของโปรเจกต์นี้ ส่ง `expert_id` (หนึ่งคน) หรือ `category` (หมวดหมู่ เช่น analyst, db, security, design, feedback_th): เมื่อใช้ `category` คำถามจะถูกส่งถึงผู้เชี่ยวชาญในทีมทุกคนในหมวดนั้นพร้อมกัน คำตอบแรกชนะ และคำถามจะหายไปจากคนอื่น — ควรใช้แบบนี้เมื่อมีผู้เชี่ยวชาญหลายคนในหมวดเดียวกัน หรือส่ง `invite_name` สำหรับคนที่ได้รับเชิญเข้าโปรเจกต์นี้แต่ยังไม่ได้เข้าร่วม: คำถามจะรอ (สถานะ waiting_invite ได้ question_id เดียวกันตั้งแต่ต้น ใช้ตัวเลือก กำหนดเวลา และความเร่งด่วนได้ แก้ไขด้วย edit_question ได้จนกว่าจะส่งถึง) และส่งถึงเมื่อเขาตอบรับคำเชิญ คืนค่า question_id ทันที; คำตอบมาแบบไม่พร้อมกัน — เรียก get_answer ภายหลัง (ใส่ wait_seconds ได้) ใส่บริบทสั้น ๆ (โค้ด ข้อจำกัด) ใน `context` ระบุ `stage` (SDD: requirements → ธุรกิจ/เจ้าของและผู้เชี่ยวชาญเฉพาะด้าน, specifications → นักวิเคราะห์ + ผู้เชี่ยวชาญด้านเทคนิค, plan → หัวหน้าทีมเทคนิค/DevOps/QA, implementation → ผู้เชี่ยวชาญเฉพาะทาง, review → QA/ความปลอดภัย) และ `kind` (คำถามด้านความเชี่ยวชาญ | ขอความคิดเห็น/รีวิว | ประสานแผนระหว่างคน) ถามมนุษย์เมื่อ: การตัดสินใจเป็นของคน (ลำดับความสำคัญ เงิน พันธะ ความรับผิดทางกฎหมาย); ต้องการข้อเท็จจริงส่วนตัว/ล่าสุดเกี่ยวกับคนหรือองค์กร; ความผิดพลาดมีราคาแพงหรือย้อนกลับไม่ได้; ต้องใช้ความรู้ท้องถิ่น; คุณไม่มั่นใจหรือแหล่งข้อมูลขัดแย้งกัน; ที่จุดเปลี่ยนขั้นตอนของ SDD ตอบเองเมื่อข้อเท็จจริงตรวจสอบได้จากโค้ด/เอกสาร/แหล่งข้อมูลเปิด การตัดสินใจมีต้นทุนต่ำและย้อนกลับได้ หรือเป็นแนวปฏิบัติมาตรฐาน ก่อนถาม ให้ค้นหาในฐานความรู้ของโปรเจกต์ ถามสั้น ๆ เสนอตัวเลือกและร่างของคุณเอง (\"ฉันเสนอ X — ถูกต้องไหม?\") รวมคำถามในขั้นตอนเดียวกันไว้ในข้อความเดียว ส่ง `options` (ข้อความสั้น 2–20 ข้อ) สำหรับคำถามแบบมีตัวเลือก — ผู้เชี่ยวชาญตอบด้วยการกดปุ่มครั้งเดียว; get_answer คืนค่า `answer_option` (ลำดับ) และข้อความของตัวเลือก ผู้เชี่ยวชาญระบุประเภทคำถามที่รับ (`accepts`: open | choice ใน list_experts/get_expert): หากผู้เชี่ยวชาญรับเฉพาะ `choice` คุณต้องส่ง options; ผู้เชี่ยวชาญที่รับเฉพาะ `open` จะส่ง options ไม่ได้ ถามผู้เชี่ยวชาญหลายคนพร้อมกัน: ส่ง `expert_ids` (และ `want_answers` = ต้องการกี่ความเห็น ค่าเริ่มต้น 1 — จากนั้นคำถามจะถูกถอนจากคนอื่น) ทุกคำถามมีกำหนดเวลา: `deadline_hours` เป็นชั่วโมงทำงานของผู้เชี่ยวชาญ (ค่าเริ่มต้นตามโปรเจกต์ 24) `urgent` = 2 ชั่วโมง ถ้าไม่มีใครตอบทันเวลา โปรเจกต์อาจเผยแพร่เป็นคำถามสาธารณะ (get_answer → `escalated`) การเรียกซ้ำด้วยคำถามเดิมภายใน 10 นาทีจะคืนคำถามที่สร้างไว้แล้ว (deduplicated: true) การลองใหม่หลัง 502 / หมดเวลาจึงไม่ส่งถึงผู้เชี่ยวชาญซ้ำ",
31
+ "params": {
32
+ "expert_id": "ผู้เชี่ยวชาญหนึ่งคนในทีมของโปรเจกต์",
33
+ "category": "หมวดหมู่: คำถามถูกส่งถึงผู้เชี่ยวชาญในทีมทุกคนในหมวดนั้น คำตอบแรกชนะ",
34
+ "include_invitees": "เมื่อใช้ `category`: ส่งถึงผู้ที่ได้รับเชิญเข้าโปรเจกต์นี้ในสาขานี้แต่ยังไม่เข้าร่วมด้วย (จะได้รับเมื่อตอบรับคำเชิญ คำตอบแรกจะปิดคำถามสำหรับพวกเขาด้วย) ค่าเริ่มต้น: true สำหรับคำถามแบบมีตัวเลือก, false สำหรับคำถามปลายเปิด",
35
+ "invite_name": "ชื่อของผู้ได้รับเชิญที่ยังไม่ได้เข้าร่วม; คำถามจะรอเขา",
36
+ "stage": "ขั้นตอน SDD ของคำถาม",
37
+ "kind": "expertise — คำถาม; feedback — ขอความคิดเห็น; coordination — ประสานแผนระหว่างคน",
38
+ "question": "ตัวคำถาม: สั้น ๆ พร้อมตัวเลือกและข้อเสนอของคุณ",
39
+ "context": "บริบทสั้น ๆ: โค้ด ข้อจำกัด ลิงก์",
40
+ "options": "ตัวเลือกคำตอบสั้น ๆ 2–20 ข้อ สำหรับคำถามแบบมีตัวเลือก",
41
+ "device": "อุปกรณ์ที่แนะนำสำหรับการตอบ: phone (คำถามสั้น มีตัวเลือก), desktop (รีวิวโค้ด บริบทยาว ไฟล์แนบ), tablet หรือ any ไม่ระบุ — ระบบเลือกให้อัตโนมัติ; เป็นเพียงคำแนะนำ ผู้เชี่ยวชาญตอบจากอุปกรณ์ใดก็ได้",
42
+ "expert_ids": "ผู้เชี่ยวชาญหลายคนพร้อมกัน (id) คำตอบ want_answers แรกจะถอนคำถามจากคนอื่น",
43
+ "want_answers": "ต้องการกี่ความเห็นจาก expert_ids (ค่าเริ่มต้น 1)",
44
+ "deadline_hours": "กำหนดเวลาเป็นชั่วโมงทำงานของผู้เชี่ยวชาญ (ค่าเริ่มต้นตามโปรเจกต์ 24)",
45
+ "urgent": "ด่วน: 2 ชั่วโมง อาจปลุกผู้เชี่ยวชาญ (ถ้าอนุญาต)",
46
+ "purpose": "ใช้กับ invite_name: profile = คำถามเพื่อทำความเข้าใจตัวบุคคล (ทำอะไรอยู่ ลิงก์ ช่องทางติดต่อ การนัดหมาย คำเชิญเข้าใจไหม): ไม่แสดงในการ์ดคำเชิญ ส่งหลังการแนะนำการใช้งาน ไม่มีกำหนดเวลา ราคา หรือเรตติ้ง expertise = คำถามด้านอาชีพ (ค่าเริ่มต้น; ถ้าไม่ระบุจะตรวจหาอัตโนมัติ)"
47
+ }
48
+ },
49
+ "get_answer": {
50
+ "title": "รับคำตอบ",
51
+ "description": "สถานะ/คำตอบของคำถาม (หรือกลุ่มคำถามของหมวด) wait_seconds (0–50) รอจนกว่าผู้เชี่ยวชาญจะตอบหรือหมดเวลารอ สถานะ: pending, answered, declined, redirected คืนค่า deadline_at, expired, escalated (id และ url ของคำถามสาธารณะเมื่อหมดเวลาแล้วถูกเผยแพร่) และ answers[] สำหรับหลายความเห็น",
52
+ "params": {
53
+ "question_id": "Id คำถาม (หรือกลุ่ม) จาก ask_expert",
54
+ "invite_question_id": "Id ของคำถามที่รอผู้ได้รับเชิญ",
55
+ "wait_seconds": "รอคำตอบได้สูงสุดกี่วินาที (0–50)"
56
+ }
57
+ },
58
+ "withdraw_question": {
59
+ "title": "ถอนคำถาม",
60
+ "description": "ถอนคำถามที่รอคำตอบของคุณเอง (เช่น รวมเข้ากับสรุปแล้ว หรือไม่เกี่ยวข้องอีกต่อไป) ผู้เชี่ยวชาญจะเห็นว่าคำถามถูกถอน",
61
+ "params": {
62
+ "question_id": "คำถามที่รอคำตอบของคุณ",
63
+ "reason": "เหตุผลที่ถอน (ผู้เชี่ยวชาญจะเห็น)",
64
+ "silent": "ถอนโดยไม่แจ้งผู้เชี่ยวชาญ (เช่น คนนั้นมีภาระมากเกินไป)"
65
+ }
66
+ },
67
+ "edit_question": {
68
+ "title": "แก้ไขคำถาม",
69
+ "description": "แก้ไขคำถามขณะที่ผู้รับยังไม่เห็น (รอผู้ได้รับเชิญ หรือยังไม่ถูกส่ง): ข้อความใหม่ ตัวเลือกคำตอบ (2–20 ปุ่ม) หรือบริบท เช่น เปลี่ยนคำถามปลายเปิดเป็นคำถามแบบเลือก",
70
+ "params": {
71
+ "question_id": "หมายเลข #qN",
72
+ "question": "ข้อความใหม่",
73
+ "options": "ตัวเลือกคำตอบ (2–20)",
74
+ "context": "บริบท"
75
+ }
76
+ },
77
+ "publish_open_question": {
78
+ "title": "เสนอคำถามสาธารณะ",
79
+ "description": "เสนอคำถามแบบสาธารณะของโปรเจกต์นี้: หลังจากเจ้าของยืนยันใน Telegram ทุกคนจะเห็นคำถามที่ konsilium.nativemind.net/open และใครก็ตอบได้ผ่านบอท ห้ามใส่ข้อมูลส่วนตัว ความลับ หรือชื่อลูกค้า สถานะจะเป็น pending จนกว่าเจ้าของจะยืนยัน",
80
+ "params": {
81
+ "text": "คำถาม สั้นและชัดเจน",
82
+ "context": "บริบทเพิ่มเติม (ไม่บังคับ และเป็นสาธารณะเช่นกัน)",
83
+ "options": "ตัวเลือกคำตอบ (ไม่บังคับ 2–20 ข้อ)"
84
+ }
85
+ },
86
+ "list_open_questions": {
87
+ "title": "คำถามสาธารณะ",
88
+ "description": "คำถามสาธารณะของโปรเจกต์นี้พร้อมจำนวนคำตอบ: สถานะ pending | open | closed | rejected",
89
+ "params": {}
90
+ },
91
+ "get_open_answers": {
92
+ "title": "คำตอบของคำถามสาธารณะ",
93
+ "description": "คำตอบทั้งหมดของคำถามสาธารณะในโปรเจกต์นี้ (ยอมรับแล้ว ใหม่ และซ่อน) พร้อมชื่อผู้ตอบและช่องทาง",
94
+ "params": {
95
+ "open_question_id": "หมายเลขคำถามสาธารณะ"
96
+ }
97
+ },
98
+ "list_questions": {
99
+ "title": "คำถามของโปรเจกต์",
100
+ "description": "คำถามของโปรเจกต์นี้ ใหม่สุดก่อน",
101
+ "params": {
102
+ "status": "เฉพาะคำถามที่มีสถานะนี้",
103
+ "limit": "จำนวน (1–100) ใหม่สุดก่อน"
104
+ }
105
+ },
106
+ "ask_expert_outside": {
107
+ "title": "ถามผู้เชี่ยวชาญ (ส่วนตัว)",
108
+ "description": "ถามผู้เชี่ยวชาญที่เผยแพร่เป็นการส่วนตัว ไม่ผูกกับโปรเจกต์ ใช้ได้เฉพาะเมื่อผู้เชี่ยวชาญรับคำถามจากนอกทีม เก็บไว้ในโปรเจกต์ส่วนตัวของเจ้าของ ดูคำตอบที่ my_questions",
109
+ "params": {
110
+ "expert_id": "id ผู้เชี่ยวชาญ",
111
+ "question": "คำถาม",
112
+ "context": "บริบท (ไม่บังคับ)",
113
+ "options": "ตัวเลือกคำตอบ (2–20 ไม่บังคับ)"
114
+ }
115
+ }
116
+ }
117
+ }
package/i18n/zh.json ADDED
@@ -0,0 +1,117 @@
1
+ {
2
+ "tools": {
3
+ "list_experts": {
4
+ "title": "专家列表",
5
+ "description": "已发布的 Konsilium 专家。可按领域 id(如 db、security、backend、design、legal、marketing、business_th)、自由文本、语言(ru/en/th)或国家筛选。`inTeam` 表示该专家是否已在本项目团队中(只能向团队内的专家提问)。",
6
+ "params": {
7
+ "category": "领域 id,例如 db、security、analyst、feedback_th。",
8
+ "query": "按姓名、角色和简介搜索。",
9
+ "lang": "专家使用的语言:ru、en、th、zh …",
10
+ "country": "专家所在国家。"
11
+ }
12
+ },
13
+ "get_expert": {
14
+ "title": "专家资料",
15
+ "description": "专家的完整资料:简介、领域、语言、所在地、经历(角色、客户、市场、时期、成果)以及作品/案例链接。",
16
+ "params": {
17
+ "expert_id": "来自 list_experts / suggest_experts 的专家 id。"
18
+ }
19
+ },
20
+ "suggest_experts": {
21
+ "title": "推荐专家",
22
+ "description": "根据任务描述推荐最多 5 位专家(按领域、角色和简介的关键词匹配)。指定 `level` 时,可能另外加入该领域学习通道中的最多 2 位专家,标记为 `learner: true`(他们为积累经验而回答——请告知用户)。",
23
+ "params": {
24
+ "task": "需要决定或完成的事情,一两句话。",
25
+ "level": "需要多深入的回答:basic | medium | advanced | expert(可选)。"
26
+ }
27
+ },
28
+ "ask_expert": {
29
+ "title": "向专家提问",
30
+ "description": "向本项目的人类专家发送问题。传入 `expert_id`(一个人)或 `category`(领域,如 analyst、db、security、design、feedback_th):使用 `category` 时,问题会同时发给团队中该领域的所有专家,第一个回答胜出,其他人处的问题随即消失——当多位专家覆盖同一领域时优先这样做。或者传入 `invite_name`,用于已被邀请加入本项目但尚未加入的人:问题会等待(状态 waiting_invite,从一开始就是同一个 question_id;支持选项、截止时间和紧急标记;送达前可用 edit_question 修改),在对方接受邀请时送达。立即返回 question_id;回答是异步的——稍后调用 get_answer(可带 wait_seconds)。在 `context` 中提供简洁的背景(代码、约束)。标注 `stage`(SDD:requirements → 业务/负责人和领域专家,specifications → 分析师 + 技术专家,plan → 技术负责人/DevOps/QA,implementation → 专项专家,review → QA/安全)和 `kind`(专业问题 | 请求反馈/评审 | 人与人之间的计划协调)。以下情况请问人:决定权属于某个人(优先级、资金、承诺、法律责任);需要关于人或组织的私有/最新事实;错误代价高或不可逆;需要本地知识;你没有把握或信息来源相互矛盾;在 SDD 阶段关口。以下情况请自己回答:事实可通过代码/文档/公开来源核实,决定成本低且可逆,或属于标准做法。提问前先搜索项目知识库。问题要简短,给出选项和你自己的草案(“我建议 X——对吗?”),同一阶段的问题合并为一条消息。对于选择题,传入 `options`(2–20 个简短字符串)——专家点一下按钮即可回答;get_answer 返回 `answer_option`(序号)和选项文本。专家会声明接受的问题类型(list_experts/get_expert 中的 `accepts`:open | choice):如果专家只接受 `choice`,你必须传入 options;只接受 `open` 的专家不能收到 options。 同时问多位专家:传 `expert_ids`(可选 `want_answers` = 需要几个意见,默认 1——之后其他人的问题撤回)。每个问题都有期限:`deadline_hours` 按专家工作时间计(默认为项目设置 24),`urgent` = 2 小时。若到期无人回答,项目可将其发布为公开问题(get_answer → `escalated`)。 10 分钟内以相同问题重复调用会返回已创建的问题(deduplicated: true),因此在 502 / 超时后重试不会让专家收到两次。",
31
+ "params": {
32
+ "expert_id": "项目团队中的一位专家。",
33
+ "category": "领域:问题发给团队中该领域的所有专家,第一个回答胜出。",
34
+ "include_invitees": "使用 `category` 时:同时发送给已受邀加入本项目、属于该领域但尚未加入的人(接受邀请后收到;第一个回答也会为他们关闭问题)。默认:有选项的问题为 true,开放问题为 false。",
35
+ "invite_name": "尚未加入的受邀者姓名;问题会等待对方。",
36
+ "stage": "问题所属的 SDD 阶段。",
37
+ "kind": "expertise——提问;feedback——请求反馈;coordination——人与人之间协调计划。",
38
+ "question": "问题本身:简短,附选项和你的建议。",
39
+ "context": "简洁背景:代码、约束、链接。",
40
+ "options": "选择题的 2–20 个简短答案选项。",
41
+ "device": "建议的回答设备:phone(简短问题、选项)、desktop(代码审查、长上下文、附件)、tablet 或 any。不填写则自动判断;仅为建议,专家可用任何设备回答。",
42
+ "expert_ids": "同时问多位专家(id);前 want_answers 个回答后其他人的问题撤回。",
43
+ "want_answers": "需要 expert_ids 中几个意见(默认 1)。",
44
+ "deadline_hours": "按专家工作时间计的期限(默认:项目设置,24)。",
45
+ "urgent": "紧急:2 小时,可唤醒专家(若其允许)。",
46
+ "purpose": "与 invite_name 一起使用:profile = 了解对方本人的澄清问题(目前做什么、链接、联系方式、安排、邀请是否清楚):不显示在邀请卡片上,在入门引导后送达,无截止时间、价格和评分。expertise = 关于其专业的问题(默认;未指定时自动判断)。"
47
+ }
48
+ },
49
+ "get_answer": {
50
+ "title": "获取回答",
51
+ "description": "获取问题(或领域问题组)的状态/回答。wait_seconds(0–50)会等待,直到专家回答或等待结束。状态:pending、answered、declined、redirected。 还返回 deadline_at、expired、escalated(到期后发布为公开问题时的 id 和链接),多意见时返回 answers[]。",
52
+ "params": {
53
+ "question_id": "来自 ask_expert 的问题(或问题组)id。",
54
+ "invite_question_id": "等待受邀者的问题 id。",
55
+ "wait_seconds": "最多等待回答的秒数(0–50)。"
56
+ }
57
+ },
58
+ "withdraw_question": {
59
+ "title": "撤回问题",
60
+ "description": "撤回你自己尚未回答的问题(例如已合并到汇总中或不再相关)。专家会看到问题已被撤回。",
61
+ "params": {
62
+ "question_id": "你尚未得到回答的问题。",
63
+ "reason": "撤回原因(专家可见)。",
64
+ "silent": "撤回而不通知专家(例如对方负担过重)。"
65
+ }
66
+ },
67
+ "edit_question": {
68
+ "title": "编辑问题",
69
+ "description": "在收件人尚未看到时修改你的问题(正在等待受邀者,或尚未送达):新文本、答案选项(2–20 个按钮)或上下文。例如把开放式问题改为选择题。",
70
+ "params": {
71
+ "question_id": "#qN 编号。",
72
+ "question": "新文本。",
73
+ "options": "答案选项(2–20)。",
74
+ "context": "上下文。"
75
+ }
76
+ },
77
+ "publish_open_question": {
78
+ "title": "提议公开问题",
79
+ "description": "为本项目提议一个公开问题:负责人在 Telegram 中确认后,所有人都能在 konsilium.nativemind.net/open 看到,任何人都可以通过机器人回答。切勿包含个人数据、机密或客户名称。在负责人确认之前,状态为 pending。",
80
+ "params": {
81
+ "text": "问题,简短清晰。",
82
+ "context": "可选背景(同样公开)。",
83
+ "options": "可选答案选项(2–20 个)。"
84
+ }
85
+ },
86
+ "list_open_questions": {
87
+ "title": "公开问题",
88
+ "description": "本项目的公开问题及回答数量:状态 pending | open | closed | rejected。",
89
+ "params": {}
90
+ },
91
+ "get_open_answers": {
92
+ "title": "公开问题的回答",
93
+ "description": "本项目某个公开问题的所有回答(已采纳、新的和已隐藏),附回答者显示名称和渠道。",
94
+ "params": {
95
+ "open_question_id": "公开问题编号。"
96
+ }
97
+ },
98
+ "list_questions": {
99
+ "title": "项目问题",
100
+ "description": "本项目的问题,最新在前。",
101
+ "params": {
102
+ "status": "仅返回此状态的问题。",
103
+ "limit": "数量(1–100),最新在前。"
104
+ }
105
+ },
106
+ "ask_expert_outside": {
107
+ "title": "向专家提问(个人)",
108
+ "description": "以个人身份向已发布的专家提问,不绑定项目。仅当专家接受团队外问题时可用。问题保存在所有者的个人项目中;用 my_questions 查看回答。",
109
+ "params": {
110
+ "expert_id": "专家 id",
111
+ "question": "问题",
112
+ "context": "上下文(可选)",
113
+ "options": "回答选项(2–20,可选)"
114
+ }
115
+ }
116
+ }
117
+ }
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@consilium108/mcp-module-experts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Experts module of the Konsilium MCP (#442): Find experts of the team, ask them, read their answers; open questions; outside experts. Loaded by the host @consilium108/mcp; enabled or disabled per connection by the person.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "author": "NativeMind",
7
+ "homepage": "https://konsilium.nativemind.net",
8
+ "type": "module",
9
+ "engines": {
10
+ "node": ">=22.12"
11
+ },
12
+ "exports": {
13
+ ".": "./src/index.js",
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "src",
18
+ "i18n",
19
+ "README.md",
20
+ "CHANGELOG.md",
21
+ "LICENSE"
22
+ ],
23
+ "scripts": {
24
+ "test": "node --test test/*.test.js"
25
+ },
26
+ "peerDependencies": {
27
+ "@consilium108/mcp": ">=0.7.0 <1"
28
+ },
29
+ "peerDependenciesMeta": {
30
+ "@consilium108/mcp": {
31
+ "optional": true
32
+ }
33
+ },
34
+ "dependencies": {
35
+ "@nativemind108/mcp": "^1.13.0"
36
+ },
37
+ "devDependencies": {
38
+ "zod": "^4.6.7"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ }
43
+ }
@@ -0,0 +1,177 @@
1
+ // generated by Claude (Opus 5.5), 2026-11-20; Konsilium #442 (SDD flows/sdd-consilium-mcp-modules, Phase 3): experts of the team and questions to them, open questions — moved verbatim from
2
+ // @consilium108/mcp src/core/groups/questions.js (rule «extract, don't rewrite»): the same names, schemas, texts and annotations;
3
+ // handlers use only the host helpers `h` (texts, REST with the caller's credential, forms) — never credentials.
4
+
5
+ /** Tools of `EXPERTS_TOOLS` (the in-process registration order). */
6
+ export const EXPERTS_TOOLS = ['list_experts', 'get_expert', 'suggest_experts', 'ask_expert', 'get_answer', 'withdraw_question', 'edit_question', 'publish_open_question', 'list_open_questions', 'get_open_answers', 'list_questions'];
7
+
8
+ export function registerExpertsTools(server, h) {
9
+ if (h.shape === 'personal') return;
10
+ const { z, L, M, text, fail, safe, call, P, ROOT, NeedsInput } = h;
11
+ const ro = { readOnlyHint: true, openWorldHint: false };
12
+ /** REST answers as the tool: its refusal text, its hints in the session language. */
13
+ const tool = () => ({ as_tool: true, hint_lang: L });
14
+ /** ?shape=mcp — project_info sees the access of the in-process session (one project / several). */
15
+ const shapeQuery = () => ({ shape: 'mcp', ...(h.shape === 'project' && h.session?.default_project_id != null ? { route_project_id: h.session.default_project_id } : {}) });
16
+ /** sdd-consilium-mcp S2.3: «several people / invitations fit» → a choice for the person (= in-process `choose`). */
17
+ const choose = ({ code, field, options }, title) => new NeedsInput({ code, message: title, fields: { [field]: { type: 'enum', title, options } }, fallback: null });
18
+ /** #141: `waiting_unopened` (= server unopenedSummary). */
19
+ const unopenedSummary = (u, status = null) => {
20
+ if (!u?.count || (status && status !== 'pending')) return {};
21
+ return { waiting_unopened: { count: u.count, invitees: u.names, note: M('unopened_waiting', { n: u.count, names: u.names.join(', ') || '—' }) } };
22
+ };
23
+
24
+ server.registerTool(
25
+ 'list_experts',
26
+ {
27
+ title: 'List experts',
28
+ description: 'List published Konsilium experts. Filter by category id (e.g. db, security, backend, design, legal, marketing, business_th), free-text query, language (ru/en/th) or country. `inTeam` shows whether the expert is already in this project\'s team (only team experts can be asked).',
29
+ inputSchema: { category: z.string().optional(), query: z.string().optional(), lang: z.string().optional(), country: z.string().optional() },
30
+ annotations: ro,
31
+ },
32
+ safe(async ({ category, query, lang, country }, ctx) => text(await call(ctx, 'GET', '/api/projects/{id}/experts', { id: P(), category, query, lang, country }))),
33
+ );
34
+
35
+ server.registerTool(
36
+ 'get_expert',
37
+ { title: 'Expert profile', description: 'Full profile of an expert: bio, areas, languages, location, experience (role, client, market, period, result) and portfolio/case links.', inputSchema: { expert_id: z.number().int() }, annotations: ro },
38
+ safe(async ({ expert_id }, ctx) => text(await call(ctx, 'GET', '/api/projects/{id}/experts/{expertId}', { id: P(), expertId: expert_id }))),
39
+ );
40
+
41
+ server.registerTool(
42
+ 'suggest_experts',
43
+ { title: 'Suggest experts', description: 'Suggest up to 5 experts for a task description (keyword match over areas, role and bio). With `level` (basic | medium | advanced | expert — how deep the answer must be) up to 2 experts from the learning stream of that area may be added, marked `learner: true` (they answer for experience; say so to the user).', inputSchema: { task: z.string(), level: z.enum(['basic', 'medium', 'advanced', 'expert']).optional() }, annotations: ro },
44
+ safe(async ({ task, level }, ctx) => text(await call(ctx, 'GET', '/api/projects/{id}/experts/suggest', { id: P(), task, level }))),
45
+ );
46
+
47
+ server.registerTool(
48
+ 'ask_expert',
49
+ {
50
+ title: 'Ask an expert',
51
+ description:
52
+ 'Write for a person, not a system (#369): first line = one sentence «what I need from you»; no service ids (#71, #q72, kb-…), commands (/bind) or jargon; options describe what the person will SEE (e.g. «the bot will write you: “Is this group about FreeDome? ✅”»), not the mechanism. For non-technical experts the server checks this and asks you to rewrite (then resend with plain_ok: true). ' +
53
+ 'Send a question to human experts of this project. Pass either `expert_id` (one person) or `category` (an area such as analyst, db, security, design, feedback_th): ' +
54
+ 'with `category` the question goes to ALL team experts of that area at once, the first answer wins and the question disappears for the others — prefer this when ' +
55
+ 'several experts share the area. Or pass `topic` (a free tag or role: «vastu», «Vastu expert», «jyotish») when you need an expertise and may not have such a person yet: team members whose area, role title or slot fits get it now; if nobody fits, the question WAITS (status waiting_topic, topic_wait_id) and becomes an ordinary question to the first member with that expertise who joins — get_answer(topic_wait_id) then returns it, catch_up shows the answer as usual. Or pass `invite_name` for a person invited to this project who has not joined yet: the question waits (status waiting_invite, same question_id from the start; options, deadline and urgency work; editable with edit_question until delivered) and is delivered when they accept. Returns question_id immediately; the answer is asynchronous — call get_answer later (optionally with wait_seconds). A repeated call with the same question within 10 minutes returns the existing question (deduplicated: true), so a retry after a 502 / timeout does not reach the expert twice. ' +
56
+ 'Provide concise context (code, constraints) in `context`. Mark `stage` (SDD: requirements → business/owner and domain experts, specifications → analysts + technical expert, plan → tech lead/DevOps/QA, implementation → narrow specialist, review → QA/security) and `kind` (expertise question | feedback/review request | coordination of plans between people). ' +
57
+ 'Ask humans when: the decision belongs to a person (priorities, money, commitments, legal liability); you need a private/current fact about people or organizations; a mistake is costly or irreversible; local knowledge is needed; you are not confident or sources conflict; at an SDD stage gate. ' +
58
+ 'Answer yourself when the fact is verifiable in code/docs/open sources, the decision is cheap and reversible, or it is standard practice. Before asking, search the project knowledge base. Keep questions short, offer options and your own draft ("I propose X — correct?"), batch questions of one stage into one message. ' +
59
+ 'Pass `options` (2–20 short strings) for a multiple-choice question — the expert answers with one button tap; get_answer returns `answer_option` (index) and the option text. Experts declare accepted types (`accepts`: open | choice in list_experts/get_expert): if an expert accepts only `choice`, you must pass options; an expert who accepts only `open` cannot get options. ' +
60
+ 'Prices (#q92): an expert may have three public prices (`prices`: simple · detailed · call, ₽; null = free) in list_experts/get_expert — tell the user the price BEFORE asking; pass `price_tier` (default simple). `pay_mode: problem` = a repair-style task: a paid diagnosis (the call price), then the expert sends an estimate and the user approves it in the messenger. The result has `price`.',
61
+ inputSchema: {
62
+ expert_id: z.number().int().optional(),
63
+ expert_ids: z.array(z.number().int()).min(1).max(20).optional(),
64
+ want_answers: z.number().int().min(1).max(20).optional(),
65
+ deadline_hours: z.number().int().min(1).max(720).optional(),
66
+ urgent: z.boolean().optional(),
67
+ category: z.string().optional(),
68
+ invite_name: z.string().max(120).optional(),
69
+ invite_id: z.number().int().optional().describe('Which pending invitation, when several fit invite_name (from a needs_input answer).'),
70
+ topic: z.string().min(2).max(80).optional(),
71
+ include_invitees: z.boolean().optional(),
72
+ stage: z.enum(['requirements', 'specifications', 'plan', 'implementation', 'review']).optional(),
73
+ kind: z.enum(['expertise', 'feedback', 'coordination']).optional(),
74
+ question: z.string().min(3).max(8000),
75
+ context: z.string().max(4000).optional(),
76
+ options: z.array(z.string().min(1).max(100)).min(2).max(20).optional(),
77
+ device: z.enum(['any', 'phone', 'desktop', 'tablet']).optional(),
78
+ // #129 (#q92): payment mode and the price tier (single expert only)
79
+ pay_mode: z.enum(['question', 'problem']).optional(),
80
+ price_tier: z.enum(['simple', 'detailed', 'call']).optional(),
81
+ // sdd-konsilium-expertise (finish-flows): how deep the answer must be — shown to the expert, counted in the
82
+ // expert's depth by level (single expert only)
83
+ level: z.enum(['basic', 'medium', 'advanced', 'expert']).optional().describe('How deep the answer must be: basic | medium | advanced | expert (single expert).'),
84
+ // #141: with invite_name — profile = a clarifying question about the person (not on the invite card, after onboarding)
85
+ purpose: z.enum(['expertise', 'profile']).optional(),
86
+ // #369: set true after rewriting a question for a non-technical expert (skips the plain-language check)
87
+ plain_ok: z.boolean().optional(),
88
+ },
89
+ annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
90
+ },
91
+ safe(async (args, ctx) => {
92
+ const { project_id, subproject_id, ...a } = args; // eslint-disable-line no-unused-vars
93
+ const r = await call(ctx, 'POST', '/api/projects/{id}/expert-questions', { id: P(), ...a, client: h.client(ctx), ...tool(), ...(h.elicitOn() ? { choices: true } : {}) });
94
+ if (r.needs_choice) throw choose(r.needs_choice, M('elicit_invite'));
95
+ return r.fail ? fail(r.fail) : text(r);
96
+ }),
97
+ );
98
+
99
+ server.registerTool(
100
+ 'get_answer',
101
+ {
102
+ title: 'Get answer',
103
+ description: 'Get the status/answer of a question (or of an area question group). wait_seconds (0–50) long-polls until an expert answers or the wait ends. Statuses: pending, answered, declined, redirected.',
104
+ inputSchema: { question_id: z.number().int().optional(), invite_question_id: z.number().int().optional(), topic_wait_id: z.number().int().optional(), wait_seconds: z.number().int().min(0).max(50).optional() },
105
+ annotations: ro,
106
+ },
107
+ safe(async ({ question_id, invite_question_id, topic_wait_id, wait_seconds = 0 }, ctx) => {
108
+ const stop = wait_seconds > 0 ? h.keepAlive(ctx) : () => {};
109
+ try {
110
+ const r = await call(ctx, 'GET', '/api/projects/{id}/answer', { id: P(), question_id, invite_question_id, topic_wait_id, wait_seconds, as_tool: 1, hint_lang: L });
111
+ return r.fail ? fail(r.fail) : text(r);
112
+ } finally {
113
+ stop();
114
+ }
115
+ }),
116
+ );
117
+
118
+ server.registerTool(
119
+ 'withdraw_question',
120
+ { title: 'Withdraw question', description: 'Take back your own pending question (e.g. merged into a summary or no longer relevant) — also one still waiting for an invited person. The question card is removed from the expert\'s chat (older than 48 h — collapsed to one line), with no separate notice; the withdrawal is kept in the history.', inputSchema: { question_id: z.number().int().optional(), invite_question_id: z.number().int().optional(), reason: z.string().max(300).optional(), silent: z.boolean().optional() }, annotations: { readOnlyHint: false } },
121
+ safe(async ({ question_id, invite_question_id, reason, silent }, ctx) => {
122
+ const r = await call(ctx, 'POST', '/api/projects/{id}/tool/withdraw_question', { id: P(), question_id, invite_question_id, reason, silent, ...tool() });
123
+ return r.fail ? fail(r.fail) : text(r);
124
+ }),
125
+ );
126
+
127
+ server.registerTool(
128
+ 'edit_question',
129
+ {
130
+ title: 'Edit question',
131
+ description: 'Change your question while the addressee has not seen it yet (it waits for an invited person, or is not delivered yet): new text, answer options (2–20, buttons) or context. E.g. turn an open question into a choice question.',
132
+ inputSchema: { question_id: z.number().int(), question: z.string().min(3).max(8000).optional(), options: z.array(z.string().min(1).max(100)).min(2).max(20).optional(), context: z.string().max(4000).optional() },
133
+ annotations: { readOnlyHint: false },
134
+ },
135
+ safe(async ({ question_id, question, options, context }, ctx) => text(await call(ctx, 'POST', '/api/projects/{id}/tool/edit_question', { id: P(), question_id, question, options, context }))),
136
+ );
137
+
138
+ server.registerTool(
139
+ 'publish_open_question',
140
+ {
141
+ title: 'Propose an open question',
142
+ description: 'Propose a PUBLIC question of this project: after the owner confirms it in Telegram it is visible to everyone on konsilium.nativemind.net/open and anyone can answer via the bot. With `topic` (e.g. «vastu») experts of that expertise who accept outside questions also get it personally when it is published. Never put private data, secrets or client names into it. Returns status pending until the owner confirms.',
143
+ inputSchema: { text: z.string().min(3).max(4000), context: z.string().max(4000).optional(), options: z.array(z.string().max(100)).max(20).optional(), topic: z.string().min(2).max(80).optional() },
144
+ annotations: { readOnlyHint: false, openWorldHint: true },
145
+ },
146
+ safe(async ({ text: q, context, options, topic }, ctx) => {
147
+ const oq = await call(ctx, 'POST', '/api/projects/{id}/open-questions/proposals', { id: ROOT(), text: q, context, options, topic });
148
+ return text({ open_question_id: oq.open_question_id, status: oq.status, next: 'The owner confirms it in Telegram; then it appears on /open. Check with list_open_questions.' });
149
+ }),
150
+ );
151
+
152
+ server.registerTool(
153
+ 'list_open_questions',
154
+ { title: 'Open questions', description: 'Open (public) questions of this project with answer counts: status pending | open | closed | rejected.', inputSchema: {}, annotations: ro },
155
+ safe(async (_a, ctx) => text(await call(ctx, 'GET', '/api/projects/{id}/tool/list_open_questions', { id: ROOT() }))),
156
+ );
157
+
158
+ server.registerTool(
159
+ 'get_open_answers',
160
+ { title: 'Open question answers', description: 'All answers to an open question of this project (accepted, new and hidden), with the author display name and channel.', inputSchema: { open_question_id: z.number().int() }, annotations: ro },
161
+ safe(async ({ open_question_id }, ctx) => text(await call(ctx, 'GET', '/api/projects/{id}/open-questions/{oqId}/answers', { id: ROOT(), oqId: open_question_id }))),
162
+ );
163
+
164
+ server.registerTool(
165
+ 'list_questions',
166
+ {
167
+ title: 'Project questions',
168
+ description: 'Questions of this project, newest first.',
169
+ inputSchema: { status: z.enum(['pending', 'answered', 'declined', 'redirected']).optional(), limit: z.number().int().min(1).max(100).optional() },
170
+ annotations: ro,
171
+ },
172
+ safe(async ({ status, limit = 20 }, ctx) => {
173
+ const r = await call(ctx, 'GET', '/api/projects/{id}/tool/list_questions', { id: P(), status, limit });
174
+ return text({ questions: r.questions, waiting_invite: r.waiting_invite, ...unopenedSummary(r.unopened, status) });
175
+ }),
176
+ );
177
+ }
@@ -0,0 +1,81 @@
1
+ // generated by Claude (Opus 5.5), 2026-11-20; Konsilium #442 (SDD flows/sdd-consilium-mcp-modules, Phase 3): a personal question to a published expert outside my teams — moved verbatim from
2
+ // @consilium108/mcp src/core/groups/personal.js (rule «extract, don't rewrite»): the same names, schemas, texts and annotations;
3
+ // handlers use only the host helpers `h` (texts, REST with the caller's credential, forms) — never credentials.
4
+
5
+ /** Tools of `OUTSIDE_TOOLS` (the in-process registration order). */
6
+ export const OUTSIDE_TOOLS = ['ask_expert_outside'];
7
+
8
+ /** Compact view of a package (= server/src/mcp/deliverytools.js deliveryBrief). */
9
+ function deliveryBrief(d, { full = false } = {}) {
10
+ return {
11
+ id: d.id,
12
+ role: d.role,
13
+ title: d.title,
14
+ summary: d.summary,
15
+ status: d.waiting ? 'waiting_invite' : d.status,
16
+ from: d.fromName,
17
+ to: d.toName,
18
+ to_user_id: d.toUserId,
19
+ invite_id: d.inviteId,
20
+ accepted_project: d.acceptedProjectName,
21
+ version: d.version,
22
+ docs: d.docs.map((x) => (full ? { title: x.title, body: x.body } : { title: x.title, chars: x.body.length })),
23
+ questions: d.questions.map((q) => ({ text: q.text, options: q.options, ...(q.answeredAt ? { answer: q.answerText } : {}) })),
24
+ tasks: d.tasks.map((x) => ({ text: x.text, lane: x.lane })),
25
+ experts: (d.experts ?? []).map((e) => ({ name: e.name, user_id: e.userId, invite_id: e.inviteId, reason: e.reason, ...(e.note ? { expert_note: e.note } : {}), ...(e.requestStatus ? { request: e.requestStatus } : {}) })),
26
+ view_url: d.viewUrl,
27
+ updated_at: d.updatedAt,
28
+ };
29
+ }
30
+
31
+ /** #196: the recommended expert's view (= deliverytools.js recommendationBrief). */
32
+ function recommendationBrief(r) {
33
+ return {
34
+ recommendation_id: r.itemId,
35
+ delivery_id: r.deliveryId,
36
+ title: r.title,
37
+ summary: r.summary,
38
+ recommended_by: r.fromName,
39
+ recommended_to: r.toName,
40
+ reason: r.reason,
41
+ status: r.status,
42
+ called_into_project: r.callStatus ?? (r.called ? 'requested' : null),
43
+ note: r.note,
44
+ note_editable: r.noteEditable,
45
+ view_url: r.viewUrl,
46
+ };
47
+ }
48
+
49
+ /** `to`: a number = user id, a string = the name in one of my invitations (= deliverytools.js toOf). */
50
+ const toOf = (to, inviteId) => (inviteId != null ? { inviteId } : to == null ? null : typeof to === 'number' ? { userId: to } : /^\d+$/.test(String(to).trim()) ? { userId: Number(to) } : { inviteName: String(to) });
51
+ const noNulls = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v != null));
52
+
53
+ export function registerOutsideTools(server, h) {
54
+ const { z, M, text, fail, safe, call } = h;
55
+ const ro = { readOnlyHint: true, openWorldHint: false };
56
+ const w = { readOnlyHint: false, destructiveHint: false, openWorldHint: true };
57
+
58
+ server.registerTool(
59
+ 'ask_expert_outside',
60
+ {
61
+ title: 'Ask an expert (personal)',
62
+ description:
63
+ 'Ask a published expert a personal question (not tied to a project). Works only if the expert accepts questions from outside their teams (accepts_outside). The question is kept in my personal inbox project. Answers arrive asynchronously — check with my_questions.',
64
+ inputSchema: {
65
+ expert_id: z.number().int(),
66
+ question: z.string().min(3).max(8000),
67
+ context: z.string().max(4000).optional(),
68
+ options: z.array(z.string().max(100)).min(2).max(20).optional(),
69
+ },
70
+ annotations: w,
71
+ },
72
+ safe(async ({ expert_id, question, context, options }, ctx) => text({ ...(await call(ctx, 'POST', '/api/me/questions/outside', { expert_id, question, context, options, client: h.client(ctx) })), next: 'my_questions' })),
73
+ );
74
+
75
+ // sdd-konsilium-handoff: «Передать клиенту» — prepare / send / list delivery packages
76
+ const doc = z.object({ title: z.string().min(1).max(200), body: z.string().min(1).max(100_000) });
77
+ const question = z.union([z.string().min(3).max(4000), z.object({ text: z.string().min(3).max(4000), options: z.array(z.string().max(60)).min(2).max(8).optional() })]);
78
+ const expert = z.object({ user_id: z.number().int().optional(), invite_name: z.string().min(2).max(120).optional(), invite_id: z.number().int().optional(), reason: z.string().min(3).max(500) });
79
+ const expertsOf = (a) => a?.map((e) => noNulls({ userId: e.user_id ?? null, inviteId: e.invite_id ?? null, inviteName: e.invite_name ?? null, reason: e.reason }));
80
+ const task = z.union([z.string().min(3).max(4000), z.object({ text: z.string().min(3).max(4000), title: z.string().max(200).optional(), lane: z.enum(['question', 'quick', 'work']).optional() })]);
81
+ }
package/src/index.js ADDED
@@ -0,0 +1,34 @@
1
+ // generated by Claude (Opus 5.5), 2026-11-20; Konsilium #442 (SDD flows/sdd-consilium-mcp-modules, Tasks 3.2–3.6)
2
+ // The Experts module of the Konsilium MCP: a separately published package the host @consilium108/mcp loads
3
+ // (in 0.x the host loads all five modules, so every client keeps the same tools). A person enables or disables the
4
+ // module per connection (OAuth consent page, Konsilium → Connected apps); the server checks it on every call (the MCP
5
+ // guard, REST / GraphQL by key, events) — hiding a tool is never the protection. Rights (scopes) do not change.
6
+ import { readFileSync } from 'node:fs';
7
+ import { defineMcpModule } from '@nativemind108/mcp';
8
+ import { EXPERTS_TOOLS, registerExpertsTools } from './groups/experts.js';
9
+ import { OUTSIDE_TOOLS, registerOutsideTools } from './groups/outside.js';
10
+
11
+ const PKG = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
12
+ const LANGS = ["en", "ru", "th", "zh"];
13
+ /** Catalog texts of the module's tools (merged into the host's catalog by its ModuleHost). */
14
+ const I18N = Object.fromEntries(LANGS.map((l) => [l, JSON.parse(readFileSync(new URL(`../i18n/${l}.json`, import.meta.url), 'utf8'))]));
15
+
16
+ export default defineMcpModule({
17
+ id: 'experts',
18
+ name: PKG.name,
19
+ version: PKG.version,
20
+ host: PKG.peerDependencies['@consilium108/mcp'],
21
+ title: {"en": "Experts", "ru": "Эксперты", "th": "ผู้เชี่ยวชาญ", "zh": "专家", "ja": "エキスパート"},
22
+ summary: {"en": "Find experts of the team, ask them, read their answers; open questions; outside experts.", "ru": "Поиск экспертов команды, вопросы им и их ответы; открытые вопросы; внешние эксперты.", "th": "ค้นหาผู้เชี่ยวชาญของทีม ถามและอ่านคำตอบ; คำถามเปิด; ผู้เชี่ยวชาญภายนอก", "zh": "查找团队专家、向他们提问并阅读回答;公开问题;外部专家。", "ja": "チームのエキスパート検索、質問と回答、公開質問、外部エキスパート。"},
23
+ groups: {
24
+ experts: { tools: EXPERTS_TOOLS, register: registerExpertsTools },
25
+ outside: { tools: OUTSIDE_TOOLS, register: registerOutsideTools },
26
+ },
27
+ localTools: [],
28
+ prompts: ["ask_expert"],
29
+ requiresScopes: ["experts:read", "questions:ask", "questions:read", "me:ask_outside"],
30
+ i18n: I18N,
31
+ aliases: {},
32
+ });
33
+
34
+ export { EXPERTS_TOOLS, registerExpertsTools, OUTSIDE_TOOLS, registerOutsideTools };