integram-mcp 0.7.87 → 0.7.98
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/README.md +11 -11
- package/index.js +114 -50
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/integram-mcp)
|
|
4
4
|
|
|
5
|
-
MCP-сервер для Integram — даёт доступ к
|
|
5
|
+
MCP-сервер для Integram — даёт доступ к 759 инструментам (таблицы, документы, отчёты, автоматизации, портал, Telegram-боты, граф знаний и т.д.) из Claude Code, Claude Desktop и Cursor.
|
|
6
6
|
|
|
7
7
|
Работает с облачным Integram на **ai2o.online** или с локальным сервером.
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ claude mcp add integram \
|
|
|
15
15
|
-e INTEGRAM_URL=https://ai2o.online \
|
|
16
16
|
-e INTEGRAM_EMAIL=you@example.com \
|
|
17
17
|
-e INTEGRAM_PASSWORD=secret \
|
|
18
|
-
-- npx -y integram-mcp@0.7.
|
|
18
|
+
-- npx -y integram-mcp@0.7.98
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Ставить ничего не нужно: `npx` скачает пакет сам.
|
|
@@ -43,7 +43,7 @@ claude mcp add integram \
|
|
|
43
43
|
-e INTEGRAM_URL=http://localhost:8081 \
|
|
44
44
|
-e INTEGRAM_EMAIL=you@example.com \
|
|
45
45
|
-e INTEGRAM_PASSWORD=secret \
|
|
46
|
-
-- npx -y integram-mcp@0.7.
|
|
46
|
+
-- npx -y integram-mcp@0.7.98
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
Удалить: `claude mcp remove integram`
|
|
@@ -57,7 +57,7 @@ claude mcp add integram \
|
|
|
57
57
|
"mcpServers": {
|
|
58
58
|
"integram": {
|
|
59
59
|
"command": "npx",
|
|
60
|
-
"args": ["-y", "integram-mcp@0.7.
|
|
60
|
+
"args": ["-y", "integram-mcp@0.7.98"],
|
|
61
61
|
"env": {
|
|
62
62
|
"INTEGRAM_URL": "https://ai2o.online",
|
|
63
63
|
"INTEGRAM_EMAIL": "you@example.com",
|
|
@@ -77,7 +77,7 @@ claude mcp add integram \
|
|
|
77
77
|
"mcpServers": {
|
|
78
78
|
"integram": {
|
|
79
79
|
"command": "npx",
|
|
80
|
-
"args": ["-y", "integram-mcp@0.7.
|
|
80
|
+
"args": ["-y", "integram-mcp@0.7.98"],
|
|
81
81
|
"env": {
|
|
82
82
|
"INTEGRAM_URL": "https://ai2o.online",
|
|
83
83
|
"INTEGRAM_EMAIL": "you@example.com",
|
|
@@ -167,27 +167,28 @@ claude mcp add integram -e INTEGRAM_URL=... -e INTEGRAM_EMAIL=... -e INTEGRAM_PA
|
|
|
167
167
|
| Группа | Что делает | Кол-во |
|
|
168
168
|
|---|---|---|
|
|
169
169
|
| **workspace** | Файлы, коннекторы, участники, бэкапы, дашборды, вью, аудит, нормализатор, автоматизации, вебхуки, формы | 132 |
|
|
170
|
-
| **pm** | Управление проектами: задачи, спринты, доски, бэклог, диаграммы |
|
|
171
|
-
| **portal** | Портал: конфиг, каталог, корзины, заказы, тикеты, KB, метрики, Telegram-боты |
|
|
170
|
+
| **pm** | Управление проектами: задачи, спринты, доски, бэклог, диаграммы | 72 |
|
|
171
|
+
| **portal** | Портал: конфиг, каталог, корзины, заказы, тикеты, KB, метрики, Telegram-боты | 67 |
|
|
172
172
|
| **teamchat** | Сообщения, решения, метрики агентов, W-матрица, топики | 58 |
|
|
173
173
|
| **docs** | Документы, блоки, версии, шаринг, папки, теги, шаблоны, PDF | 53 |
|
|
174
174
|
| **nightcall** | Нормативная спецификация и проверяемая генерация: требования, обязательства, свидетельства, базовые линии | 44 |
|
|
175
175
|
| **codespace** | Git-репозитории: ветки, коммиты, файлы, точечная правка (`patch_file`), pull requests; запись с `baseCommit` сливается с чужими изменениями вместо перезаписи | 36 |
|
|
176
176
|
| **schema** | Таблицы, колонки, кнопки (AI/HTTP/script), вычисляемые колонки, валидация | 35 |
|
|
177
|
+
| **orgs** | Организации: участники, области, приглашения | 29 |
|
|
177
178
|
| **memory** | Память агента, инсайты, процедуры, противоречия | 28 |
|
|
178
|
-
| **orgs** | Организации: участники, области, приглашения | 27 |
|
|
179
179
|
| **meta-kb** | Дебаты: параллельные эксперты, LLM-синтез, курирование знаний | 25 |
|
|
180
180
|
| **core** | CRUD объектов, поиск, справочник платформы (docs_map/docs_search), граф, комментарии, bulk-операции | 20 |
|
|
181
181
|
| **objects** | Перемещение, дублирование, переупорядочивание записей, корзина, обратные ссылки | 20 |
|
|
182
|
+
| **agents** | Реестр внешних AI-агентов, делегирование | 16 |
|
|
182
183
|
| **reports** | Отчёты: CRUD, колонки, JOIN, фильтры, экспорт | 16 |
|
|
183
|
-
| **agents** | Реестр внешних AI-агентов, делегирование | 15 |
|
|
184
184
|
| **presentations** | Презентации: PPTX-движок воркспейса (список, чтение, создание из outline, сохранение слайдов, meta и статусы, версии и откат, шаринг, экспорт PPTX/PDF, импорт PPTX, превью биндингов, удаление) | 15 |
|
|
185
185
|
| **grants** | Роли, гранты, row-level правила (только admin) | 13 |
|
|
186
186
|
| **graph** | Граф данных: запросы, окрестности, кратчайший путь | 13 |
|
|
187
187
|
| **kag** | Граф знаний: поиск, обход, вопрос-ответ, ввоз сущностей и связей | 13 |
|
|
188
188
|
| **comments** | Комментарии и реакции к записям | 7 |
|
|
189
|
+
| **video** | обучающие видео (сценарий→запись→озвучка→монтаж) | 6 |
|
|
189
190
|
| **automations** | Детали автоматизации, лог доставки вебхуков | 5 |
|
|
190
|
-
| **
|
|
191
|
+
| **history** | История изменений объектов, откат | 5 |
|
|
191
192
|
| **workspace-tools** | Инструменты уровня области: регистрация, правка, ввоз наборов | 5 |
|
|
192
193
|
| **advisor** | Советы эксперта, возможности платформы | 4 |
|
|
193
194
|
| **bulk** | Массовые операции: создание, обновление, удаление, AI-batch | 4 |
|
|
@@ -196,7 +197,6 @@ claude mcp add integram -e INTEGRAM_URL=... -e INTEGRAM_EMAIL=... -e INTEGRAM_PA
|
|
|
196
197
|
| **finmodel** | Финмодели: посчитанная сетка по периодам и сценариям, граф зависимостей ячеек, подбор параметров (goal-seek) с записью решения | 3 |
|
|
197
198
|
| **normalizer** | Разбор документов: запуск, состояние, подтверждение сопоставления | 3 |
|
|
198
199
|
| **timeseries** | Временные ряды: запись, запрос, список источников | 3 |
|
|
199
|
-
| **history** | История изменений объектов, откат | 2 |
|
|
200
200
|
| **lookups** | Справочники: варианты для dropdown/ref | 2 |
|
|
201
201
|
<!-- END:tool-groups -->
|
|
202
202
|
|
package/index.js
CHANGED
|
@@ -57,7 +57,12 @@ async function apiFetch(path, opts = {}, _retried = false) {
|
|
|
57
57
|
return apiFetch(path, opts, true);
|
|
58
58
|
}
|
|
59
59
|
const text = await res.text().catch(() => '');
|
|
60
|
-
|
|
60
|
+
const err = new Error(`API ${opts.method || 'GET'} ${path} → ${res.status}: ${text}`);
|
|
61
|
+
// TD-065: тело отказа доезжает вместе с ошибкой — конвертация в isError
|
|
62
|
+
// читает code/message/details из err.body, а не из текста «API … → 400: {…}».
|
|
63
|
+
try { err.body = JSON.parse(text); } catch { /* не JSON — остаётся только текст */ }
|
|
64
|
+
err.status = res.status;
|
|
65
|
+
throw err;
|
|
61
66
|
}
|
|
62
67
|
const text = await res.text();
|
|
63
68
|
try {
|
|
@@ -67,6 +72,17 @@ async function apiFetch(path, opts = {}, _retried = false) {
|
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
|
|
75
|
+
// TD-065: отказ бэкенда → результат тула с isError:true (признак протокола MCP).
|
|
76
|
+
// Чистый текст для модели: message + details, без JSON-обёртки всего ответа.
|
|
77
|
+
// Тела нет (не JSON, сеть) — остаётся текст самой ошибки.
|
|
78
|
+
function toolErrorResult(err) {
|
|
79
|
+
const be = err?.body?.error;
|
|
80
|
+
const text = be
|
|
81
|
+
? `Error: ${be.message || err.message}${be.details ? '\n\n' + JSON.stringify(be.details, null, 2) : ''}`
|
|
82
|
+
: `Error: ${err?.message}`;
|
|
83
|
+
return { content: [{ type: 'text', text }], isError: true };
|
|
84
|
+
}
|
|
85
|
+
|
|
70
86
|
async function login() {
|
|
71
87
|
if (!EMAIL || !PASSWORD) throw new Error('INTEGRAM_EMAIL and INTEGRAM_PASSWORD are required');
|
|
72
88
|
const data = await apiFetch('/api/v2/iam/login', {
|
|
@@ -1250,6 +1266,7 @@ const CREATE_WORKSPACE_DEF = {
|
|
|
1250
1266
|
slug: { type: 'string', description: 'URL slug: lowercase, 3-64 chars, a-z start, only a-z0-9_- (e.g. "my-project")' },
|
|
1251
1267
|
template: { type: 'string', description: 'DEPRECATED: use templateId instead. Optional template db_name string.' },
|
|
1252
1268
|
templateId: { type: 'number', description: 'Optional template ID (from list_templates) to create workspace with predefined schema structure' },
|
|
1269
|
+
blocks: { type: 'array', items: { type: 'string' }, description: 'Optional block keys (from template manifest.blocks) to carry over. Omit = carry the whole template; empty array = skeleton only' },
|
|
1253
1270
|
},
|
|
1254
1271
|
required: ['name', 'slug'],
|
|
1255
1272
|
},
|
|
@@ -1372,7 +1389,7 @@ const DESTRUCTIVE_TOOLS = new Set([
|
|
|
1372
1389
|
// Add entries here when introducing new tools so MCP clients see English descriptions.
|
|
1373
1390
|
export const EN_DESCRIPTIONS = {
|
|
1374
1391
|
// Lookups
|
|
1375
|
-
get_lookup: 'Get dropdown values for a lookup table by ID. Returns an array of records with id and display name.',
|
|
1392
|
+
get_lookup: 'Get dropdown values for a lookup table by ID. Use it to learn the allowed values of ref fields. Returns an array of records with id and display name.',
|
|
1376
1393
|
get_ref_options: 'Get available options for a reference column by reqId. Use before creating/updating objects to discover valid values for ref fields.',
|
|
1377
1394
|
// Graph
|
|
1378
1395
|
get_graph_node: 'Get a graph node by object ID. Returns type, name, and edges.',
|
|
@@ -1401,9 +1418,9 @@ export const EN_DESCRIPTIONS = {
|
|
|
1401
1418
|
list_workspace_templates: 'List available templates for creating new workspaces.',
|
|
1402
1419
|
create_workspace_from_template: 'Create a new workspace from a template. Provide templateId, name, and slug.',
|
|
1403
1420
|
// Decisions
|
|
1404
|
-
create_decision: 'Create a new team decision
|
|
1405
|
-
search_teamchat: 'Search
|
|
1406
|
-
search_similar_decisions: 'Find decisions
|
|
1421
|
+
create_decision: 'Create a new team decision. Optionally creates a chat room. Returns: { decision: {id, title, domain, ...}, message: string }.',
|
|
1422
|
+
search_teamchat: 'Search team chat messages. Hybrid full-text + vector search — finds messages by meaning, not only by exact words. Returns: { items: [{id, topic_name, room_name, author, text, score}] }.',
|
|
1423
|
+
search_similar_decisions: 'Find semantically similar decisions with an AI recommendation. Returns: { similar: [{id, title, domain, verdict, team, score}], recommendation }. IMPORTANT: id is a DECISION id — use get_decision(id) to load details, NOT get_object.',
|
|
1407
1424
|
get_agent_metrics: 'Get performance metrics for AI agents. If agentId is provided, returns metrics for that agent only; otherwise all agents. Returns { data: [{ agentId, totalMessages, messages24h, topicsInvolved, trustScore }] }.',
|
|
1408
1425
|
analyze_decision_conflicts: 'Analyze a decision for conflicts, contradictions, and overlaps with other decisions. Returns analysis with conflict descriptions.',
|
|
1409
1426
|
list_decisions: 'List all architectural decisions with optional search and filters.',
|
|
@@ -1417,7 +1434,7 @@ export const EN_DESCRIPTIONS = {
|
|
|
1417
1434
|
// Meta-KB
|
|
1418
1435
|
mk_revoke_entity: 'Revoke all knowledge base entities derived from a specified decision. Use when a decision was found to be incorrect. Returns { revoked: number, message: string }.',
|
|
1419
1436
|
mk_list_debates: 'List recent expert debates in the workspace. Returns { debates: Array, total: number }. Each debate has id, question, consensus, verdict, created_by, created_at.',
|
|
1420
|
-
mk_start_debate: 'Start an expert debate on a question.
|
|
1437
|
+
mk_start_debate: 'Start an expert debate on a question. The experts are the internal agents of the workspace; all active ones participate by default — pass agents=[slug] to pick one or more for the question. Returns the consensus of the experts and debateId; the full protocol is in mk_get_debate(debateId).',
|
|
1421
1438
|
mk_analytics: 'Get knowledge base analytics: entity/relation/class counts, orphan nodes, breakdown by source/type/status.',
|
|
1422
1439
|
mk_research: 'Research a concept in the knowledge graph: find matching entities, graph neighbors, and knowledge gaps.',
|
|
1423
1440
|
mk_propose_change: 'Propose a knowledge base change (add/update/delete entity). Creates a change request for human review. Returns { id, status: "pending" }.',
|
|
@@ -1431,9 +1448,9 @@ export const EN_DESCRIPTIONS = {
|
|
|
1431
1448
|
mk_welcome: 'Get Meta-KB welcome summary: stats, recent debates, recommendations.',
|
|
1432
1449
|
mk_list_rules: 'List Meta-KB validation rules.',
|
|
1433
1450
|
// Admin — export/import/QA
|
|
1434
|
-
export_type: 'Export a table definition (schema + data) by typeId.',
|
|
1435
|
-
bki_import: 'Import BKI format (tables + data from previous export). Provide content as JSON string.',
|
|
1436
|
-
list_qa_results: 'List QA test sessions and their results.',
|
|
1451
|
+
export_type: 'Export a table definition (schema + data) by typeId (admin only).',
|
|
1452
|
+
bki_import: 'Import BKI format (tables + data from a previous export). Provide content as a JSON string (admin only).',
|
|
1453
|
+
list_qa_results: 'List QA test sessions and their results (admin only).',
|
|
1437
1454
|
list_test_sessions: 'List QA test sessions with aggregate stats (total, passed, failed, skipped).',
|
|
1438
1455
|
create_test_session: 'Create a new QA test session. Optional notes parameter.',
|
|
1439
1456
|
get_test_session: 'Get a QA test session with all test results.',
|
|
@@ -1450,7 +1467,7 @@ export const EN_DESCRIPTIONS = {
|
|
|
1450
1467
|
verify_client: 'Verify client record — check data quality, shipping validity, duplicate risk.',
|
|
1451
1468
|
get_client_lineage: 'Get lineage for a client — source records, merge history, field provenance.',
|
|
1452
1469
|
mk_create_rule: 'Create a Meta-KB validation rule. Condition and action are JSON objects.',
|
|
1453
|
-
mk_delete_rule: 'Delete a Meta-KB validation rule by ID
|
|
1470
|
+
mk_delete_rule: 'Delete a Meta-KB validation rule by ID.',
|
|
1454
1471
|
mk_list_iterations: 'List Meta-KB iterations with optional status filter (in_progress, proposed, accepted, rejected, ignored).',
|
|
1455
1472
|
mk_get_debate: 'Get a full debate by ID: question, opinions, consensus, verdict.',
|
|
1456
1473
|
// Objects — new tools
|
|
@@ -1500,7 +1517,7 @@ export const EN_DESCRIPTIONS = {
|
|
|
1500
1517
|
get_comment_reactions: 'Get reactions on an object comment. Returns: { commentId, reactions: [{ emoji, count, authors }] }.',
|
|
1501
1518
|
// Workspace templates & bots
|
|
1502
1519
|
save_workspace_template: 'Save a workspace as a template. Requires admin/owner in the source workspace. Provide source_slug, name, slug; optional description, icon, visibility (private|org|public), include_data.',
|
|
1503
|
-
apply_workspace_template: 'Apply a template to an EXISTING workspace (creating a new one from a template is a separate tool). Requires admin/owner. dry_run=true shows the plan without changes. Requires confirmation.',
|
|
1520
|
+
apply_workspace_template: 'Apply a template to an EXISTING workspace (creating a new one from a template is a separate tool). Requires admin/owner. dry_run=true shows the plan without changes. Optional blocks: array of block keys to carry (omit = whole template, [] = skeleton only). Requires confirmation.',
|
|
1504
1521
|
leave_workspace: 'Leave a workspace yourself. Owners and the last admin cannot leave — the service refuses. Requires confirmation.',
|
|
1505
1522
|
update_workspace_template: 'Update workspace template metadata: name, description, icon, visibility. Only the template owner can change it.',
|
|
1506
1523
|
delete_workspace_template: 'Delete a workspace template by ID. Irreversible — requires confirmation.',
|
|
@@ -1526,6 +1543,13 @@ export const EN_DESCRIPTIONS = {
|
|
|
1526
1543
|
add_portal_order_item: 'Add a product to a portal order (admin): creates a child item record; the price is taken from the product unless given. Returns: { id, name, qty, price, variant }.',
|
|
1527
1544
|
collect_portal_order_items: 'Portal order assembly (admin), one tool with action: collect_all (default) — mark ALL items collected and move a "Picking" order to "Picked"; check — verify whether all items are collected (no changes); toggle — flip the "collected" flag of ONE item (needs itemId).',
|
|
1528
1545
|
merge_portal_orders: 'Merge portal orders (admin): donor items move to the master order, donors get "Cancelled" status with a comment, empty master fields are filled from donors, the amount is recalculated. All orders must belong to one customer and not be in a terminal status. Reversible only manually. Requires confirmation.',
|
|
1546
|
+
// Portal client mutations (TD-012b)
|
|
1547
|
+
add_portal_cart_item: 'Add a product to a portal customer cart (admin, acts on behalf of the customer at their request): creates an item or increments the quantity of an existing one. Returns: { items: [{ id, objId, name, qty, price, variant }] }.',
|
|
1548
|
+
update_portal_cart_item: 'Change the quantity of a cart item for a portal customer (admin). Returns: { items }; when the item does not exist — { error: "NOT_FOUND" }.',
|
|
1549
|
+
remove_portal_cart_item: 'Remove an item from a portal customer cart (admin). Returns: { items }; when the item does not exist — { error: "NOT_FOUND" }.',
|
|
1550
|
+
clear_portal_cart: 'Completely clear a portal customer cart (admin): IRREVERSIBLY deletes ALL items of someone else\'s cart. Requires confirmation.',
|
|
1551
|
+
create_portal_ticket: 'Open a support ticket on behalf of a portal customer (admin): a ticket in the support module linked to the customer with an initial status. Returns: { id, subject }.',
|
|
1552
|
+
create_portal_order: 'Place a portal order on behalf of a customer (admin): creates a REAL order with money — an order record with items at server catalog prices. WITHOUT idempotencyKey a repeated call creates a DUPLICATE order — pass the key on retries. Requires confirmation.',
|
|
1529
1553
|
// Portal
|
|
1530
1554
|
invoke_server_function: 'Execute a codespace server function (api/<name>.js in the workspace git repo). Arbitrary code in a sandbox — requires confirmation. Optional idempotencyMinutes suppresses retries with identical args within an N-minute window — enable for functions with external side effects.',
|
|
1531
1555
|
list_portal_config_history: 'List portal config snapshot history (admin): recent saves with dates and authors. Call BEFORE restore_portal_config.',
|
|
@@ -1622,7 +1646,7 @@ export const EN_DESCRIPTIONS = {
|
|
|
1622
1646
|
delete_object: 'Delete a RECORD (object/row) from a table (requires confirmation). NOT for deleting tables — use delete_table for that. Returns: { message }.',
|
|
1623
1647
|
semantic_search: 'Semantic search across the whole workspace — finds meaningfully similar objects and documents. Use to find "something about X" without an exact name. Do NOT use for structural queries or when you already know the typeId.',
|
|
1624
1648
|
// Graph
|
|
1625
|
-
get_related: 'Find related
|
|
1649
|
+
get_related: 'Find objects related to a given one through the knowledge graph of the workspace. Shows records connected to the object via ref columns and child tables.',
|
|
1626
1650
|
graph_query: 'Run an arbitrary read-only SQL query against graph tables (graph_objects, graph_edges). SELECT only. Tables are automatically scoped to the current workspace — no WHERE db = $1 needed.',
|
|
1627
1651
|
upsert_graph_node: 'Create or update a graph node. If a node with this objId exists, it is updated.',
|
|
1628
1652
|
delete_graph_node: 'Delete a graph node together with all its edges. Irreversible.',
|
|
@@ -1700,11 +1724,11 @@ export const EN_DESCRIPTIONS = {
|
|
|
1700
1724
|
list_reports: 'List all reports. Returns: { items:[{id,name}], total }.',
|
|
1701
1725
|
describe_report: 'Get report structure: columns and settings (func, where, storedFrom/To, havingFrom/To).',
|
|
1702
1726
|
create_report: 'Create a report. parentTypeId=9001 for a user-permissions report (admin only). Returns: { id, type:"report", message }.',
|
|
1703
|
-
update_report: 'Modify a report: name, icon, WHERE filter. WHERE supports [USER] [USER_ID] [TODAY] [NOW]. A column alias in WHERE is "c" + column id (from add_report_column or describe_report). Returns: { id, type:"report", message }.',
|
|
1727
|
+
update_report: 'Modify a report: name, icon, WHERE filter. WHERE supports [USER] [USER_ID] [TODAY] [NOW]. A column alias in WHERE is "c" + column id (from add_report_column or describe_report). Subqueries are allowed: the workspace table must be referenced only via the {{DB}} placeholder (e.g. FROM {{DB}} _t), and a subquery alias must start with an underscore (AS _sub, not AS sub; _abc123 is fine). Forbidden: ";", SQL comments (-- and /* */), $$ quoting. Example: AND c123.val IN (SELECT id FROM {{DB}} _t WHERE _t.t = 3) where 123 is the real column id. Returns: { id, type:"report", message }.',
|
|
1704
1728
|
delete_report: 'Delete a report (requires confirmation). Returns: { message }.',
|
|
1705
1729
|
add_report_column: 'Add a column to a report. Returns the column id — use it for WHERE in update_report: alias = "c" + id. Do NOT add a column named after the record title (_value / valueColumnName) — it is already shown as the first report column automatically. Passing valueColumnName (e.g. the title column) as columnAlias creates a broken column with reqTypeId=0 and the report shows "NaN". For a virtual permissions report reqTypeId: 9011=User, 9012=Role, 9013=Object type, 9014=Access level, 9015=Export, 9016=Delete. Returns: { id, type:"report_column", message }.',
|
|
1706
1730
|
update_report_column: 'Modify a report column: func (aggregation), displayName, default filter (storedFrom/storedTo), HAVING for aggregates (havingFrom/havingTo), hidden, totalFunc. Returns: { id, type:"report_column", message }.',
|
|
1707
|
-
delete_report_column: 'Remove a column from a report. Returns: { message }.',
|
|
1731
|
+
delete_report_column: 'Remove a column from a report (requires confirmation). Returns: { message }.',
|
|
1708
1732
|
reorder_report_columns: 'Change report column order. order — array of colIds in the desired order.',
|
|
1709
1733
|
get_report_history: 'Show report change history (audit: creation, renaming, column changes).',
|
|
1710
1734
|
export_report: 'Export report data to CSV. Returns a CSV string with header and data. Returns: { csv, filename, rowCount }.',
|
|
@@ -1805,7 +1829,7 @@ export const EN_DESCRIPTIONS = {
|
|
|
1805
1829
|
delete_connector: 'Delete a connector (requires confirmation). Returns: { message }.',
|
|
1806
1830
|
run_connector: 'Run a connector (requires confirmation — may send data to an external system). Returns: { id, type:"connector", message }.',
|
|
1807
1831
|
discover_connector_schema: 'Discover the external system schema via OData $metadata. Connects to the connector server, loads the structure (tables, fields, types) and proposes a mapping to Integram types. Works with 1C OData, SAP OData and other OData sources. Returns: { entities: [{name, synonym, type, fields, autoMapping}], url, total }.',
|
|
1808
|
-
reconcile_cdek: 'Reconcile CDEK order statuses with the API. Checks orders with a UUID in "In delivery" status, updates when CDEK reports delivered/pickup/return. Run manually or by cron.',
|
|
1832
|
+
reconcile_cdek: 'Reconcile CDEK order statuses with the API. Checks orders with a UUID in "In delivery" status, updates when CDEK reports delivered/pickup/return. Run manually or by cron (requires confirmation).',
|
|
1809
1833
|
fetch_api_docs: 'Fetch API documentation by URL (OpenAPI/Swagger, HTML). Use before generate_connector_config to analyze the API. Returns: { source, content, endpoints }.',
|
|
1810
1834
|
generate_connector_config: 'Generate connector config from the API structure (LLM). Use fetch_api_docs, then generate_connector_config, then test_connector_draft, then create_connector. Returns: { config, placeholders }.',
|
|
1811
1835
|
test_connector_draft: 'Test-run a connector draft (requires confirmation — makes a real HTTP request). Returns: { ok, status, data }.',
|
|
@@ -1813,6 +1837,9 @@ export const EN_DESCRIPTIONS = {
|
|
|
1813
1837
|
// Object history
|
|
1814
1838
|
get_object_history: 'Show object change history (audit).',
|
|
1815
1839
|
rollback_object: 'Roll an object back to the state before the specified change (requires confirmation). Returns: { id, type:"object", message }.',
|
|
1840
|
+
list_object_versions: 'List row versions (В1, В2, …) of a record — snapshots of the row together with its child tables.',
|
|
1841
|
+
create_object_version: 'Create a new version (Вn) of a record: snapshot of the row and ALL its child tables. Optional value/requisites are applied before the snapshot — an edit becomes a new version instead of overwriting cells.',
|
|
1842
|
+
activate_object_version: 'Switch a record to version Вn: live rows are replaced with the version content; the current state is auto-saved as a new version first (requires confirmation).',
|
|
1816
1843
|
// Comments
|
|
1817
1844
|
list_comments: 'Show comments on an object. Returns: { items:[{id,text,author}], total }.',
|
|
1818
1845
|
create_comment: 'Add a comment to an object. Returns: { id, type:"comment", message }.',
|
|
@@ -1864,7 +1891,7 @@ export const EN_DESCRIPTIONS = {
|
|
|
1864
1891
|
// Member management
|
|
1865
1892
|
invite_member: 'Invite a user to the workspace by email (admin only).',
|
|
1866
1893
|
remove_member: 'Remove a member from the workspace (admin only, requires confirmation).',
|
|
1867
|
-
update_member_role: 'Change the role of a workspace member (admin only).',
|
|
1894
|
+
update_member_role: 'Change the role of a workspace member (admin only, requires confirmation).',
|
|
1868
1895
|
// Schema detail
|
|
1869
1896
|
get_table_schema: 'Get the detailed schema of a table by typeId (ID from list_tables). Parameter: typeId (integer). Returns: { id, type:"table", name, columns:[{id, name, type, refTable?, refTableId?, multi?}] }. Ref columns: refTable is the target table name, refTableId its typeId.',
|
|
1870
1897
|
// KAG
|
|
@@ -1878,7 +1905,7 @@ export const EN_DESCRIPTIONS = {
|
|
|
1878
1905
|
kag_browse: 'Browse KAG entities filtered by type and source. Returns the entity list and available types.',
|
|
1879
1906
|
kag_clusters: 'Cluster entities by type and degree centrality. Shows which entity types are most connected.',
|
|
1880
1907
|
kag_anomalies: 'Detect anomalies in the knowledge graph: hubs (over-connected nodes) and isolated entities (no relations).',
|
|
1881
|
-
kag_delete: 'Delete KAG data. Can delete everything or only a specific source. Removes relations, entities and classes.',
|
|
1908
|
+
kag_delete: 'Delete KAG data. Can delete everything or only a specific source. Removes relations, entities and classes. Irreversible.',
|
|
1882
1909
|
kag_update_tags: 'Update entity tags in KAG. Tags are used for access control and filtering.',
|
|
1883
1910
|
// View sharing
|
|
1884
1911
|
share_view: 'Create a public link to a table view (optional password and expiry).',
|
|
@@ -1889,9 +1916,9 @@ export const EN_DESCRIPTIONS = {
|
|
|
1889
1916
|
get_record_share: 'Get the current public access token of a record.',
|
|
1890
1917
|
revoke_record_share: 'Revoke the public link of a record (requires confirmation).',
|
|
1891
1918
|
// Aggregate
|
|
1892
|
-
aggregate_objects: 'Aggregate table data — SUM, AVG, COUNT, MIN, MAX over columns. Returns computed values.
|
|
1893
|
-
group_objects: 'Group records by a column with a count per group.',
|
|
1894
|
-
pivot_objects: 'Pivot table — rows by one column, columns by another, values = an aggregate. valueField — numeric column id for the aggregate; agg — COUNT|SUM|AVG|MIN|MAX, default COUNT, SUM with valueField. SUM/AVG/MIN/MAX without valueField return a 400 error. Ref columns are read in both storage patterns, pivot keys are target names.',
|
|
1919
|
+
aggregate_objects: 'Aggregate table data — SUM, AVG, COUNT, MIN, MAX over columns. Returns computed values. Filters are not supported and are rejected with a 400 error; columns[] is supported.',
|
|
1920
|
+
group_objects: 'Group records by a column with a count per group. Does not accept filters (rejected with a 400 error); per-column filtering uses the filter (DSL) param.',
|
|
1921
|
+
pivot_objects: 'Pivot table — rows by one column, columns by another, values = an aggregate. valueField — numeric column id for the aggregate; agg — COUNT|SUM|AVG|MIN|MAX, default COUNT, SUM with valueField. SUM/AVG/MIN/MAX without valueField return a 400 error. Ref columns are read in both storage patterns, pivot keys are target names. Filters are not supported and are rejected with a 400 error.',
|
|
1895
1922
|
// Dashboards
|
|
1896
1923
|
list_dashboards: 'List workspace dashboards with widget counts.',
|
|
1897
1924
|
get_dashboard: 'Get a dashboard by ID — title, widget list with types and configuration, grid layout.',
|
|
@@ -1924,8 +1951,8 @@ export const EN_DESCRIPTIONS = {
|
|
|
1924
1951
|
check_agent_health: 'Check external agent availability (health check).',
|
|
1925
1952
|
get_agent_tasks: 'Task history of an external agent: statuses, results, errors.',
|
|
1926
1953
|
// Portal
|
|
1927
|
-
get_portal_config: 'Get the current portal config of the workspace: active flag, custom domain, module config.',
|
|
1928
|
-
set_portal_config: 'Create or update the portal config (branding, auth, pages). Without merge — full replacement. With merge: true — deep-merge a partial config into the existing one (no need to pass the whole config). Writes verify references: custom_code repo/file and bindings table:N must exist in this workspace — otherwise REPO_NOT_IN_WORKSPACE / FILE_NOT_IN_REPO / TABLE_NOT_IN_WORKSPACE (defects already present in the previous config do not block the edit). The previous config is pushed to history before writing (GET /portal/api/config/history, rollback via POST /portal/api/config/restore). Editing one module — update_portal_module(slug, config). NOT for access rights: grants — set_grant. Requires confirmation.',
|
|
1954
|
+
get_portal_config: 'Get the current portal config of the workspace: active flag, custom domain, module config. config.auth.requireAuth (boolean) closes the whole portal for anonymous visitors (API answers 401 except /api/config, /api/auth/*, /api/files/*, /api/bots*, webhooks; pages redirect to /auth); config.auth.allowRegistration (boolean, default true) — when false, only EXISTING clients can log in (new client creation is refused with REGISTRATION_CLOSED).',
|
|
1955
|
+
set_portal_config: 'Create or update the portal config (branding, auth, pages). Without merge — full replacement. With merge: true — deep-merge a partial config into the existing one (no need to pass the whole config). Writes verify references: custom_code repo/file and bindings table:N must exist in this workspace — otherwise REPO_NOT_IN_WORKSPACE / FILE_NOT_IN_REPO / TABLE_NOT_IN_WORKSPACE (defects already present in the previous config do not block the edit). The previous config is pushed to history before writing (GET /portal/api/config/history, rollback via POST /portal/api/config/restore). Editing one module — update_portal_module(slug, config). config.auth.requireAuth: true closes the WHOLE portal: anonymous API answers 401 (open only /api/config, /api/auth/*, /api/files/*, /api/bots*, CDEK/UDS webhooks) and pages redirect to /auth — warn the user that guest storefront (guest orders, cart, catalog) becomes unavailable, and requireAuth/allowRegistration must be booleans. config.auth.allowRegistration: false forbids creating a new client at login (existing clients only). NOT for access rights: grants — set_grant. Requires confirmation.',
|
|
1929
1956
|
update_portal_module: 'Update the config of a single portal module (by slug) without overwriting the rest. Deep merge: nested objects (e.g. bindings) merge by key; `null` deletes a key; arrays and scalars are replaced wholesale. Reference checks as in set_portal_config: repo/file/bindings must exist in this workspace. NOT for dashboards: editing a dashboard — update_dashboard(id). Full config replacement — set_portal_config.',
|
|
1930
1957
|
portal_preview: 'Get the portal preview URL.',
|
|
1931
1958
|
portal_publish: 'Enable (active=true) or disable (active=false) the portal. Requires confirmation.',
|
|
@@ -1990,7 +2017,7 @@ export const EN_DESCRIPTIONS = {
|
|
|
1990
2017
|
get_diff_range: 'Diff between two branches or commits. Returns: { diff }.',
|
|
1991
2018
|
remove_github_sync: 'Remove the GitHub binding of a repository. Irreversible.',
|
|
1992
2019
|
get_evidence_card: 'Get an evidence card for a pull request — an AI-generated card with change analysis.',
|
|
1993
|
-
commit_portal_component: 'Write a generated Vue SFC component into a codespace repository for use in a portal custom_code module. The repository is created automatically if it does not exist.',
|
|
2020
|
+
commit_portal_component: 'Write a generated Vue SFC component into a codespace repository for use in a portal custom_code module. The repository is created automatically if it does not exist. Requires confirmation.',
|
|
1994
2021
|
kit_list_components: 'List @kit library building blocks for portals: value reading/recovery helpers, empty-state handling, components. Returns name, kind and a one-line summary. Take the version from the kit field of the custom_code module config; without a version the latest published one is used. Returns: { version, builtAt, items:[{name,kind,summary,module}], total, catalogTotal }. Errors distinguish "library not published", "version missing", "version exists but has no catalog" and "catalog unreadable" — an empty list only means an empty filter.',
|
|
1995
2022
|
kit_get_component: 'Details of a single @kit building block: module, kind, description, props, slots, and uiKeys for components. Unknown names return an error with similar names. uiKeys — node keys that accept custom classes via the ui prop: <DataTable :ui="{ row: \'my-row\' }" />. Classes are appended to the block own classes, not replacing them. A key not present in uiKeys does not exist: the block will not accept it and warns in the console — never invent node names. There is no uiKeys field at all when the block has no own nodes (headless) or the version predates the release where the ui prop appeared. Returns: { version, name, kind, summary, module, props?, slots?, uiKeys? }.',
|
|
1996
2023
|
kit_get_tokens: 'Dictionary of @kit library styling tokens: CSS variable names that define color, spacing, radius, font and motion of the building blocks, plus stable class names of each block. CALL BEFORE writing styles for @kit blocks: a name absent here does not exist — an invented name resolves to nothing and the component comes out structurally correct with zero styling. Each token carries a usage field — a ready-made string like var(--kit-color-text, var(--color-text, #1f2328)); write it in full, including the fallback value. Returns: { version, builtAt, items:[{name,kind,purpose,usage,fallback,shell}], total, catalogTotal, kinds, shellTokens, byComponent:[{name,layer,tokens,classes}] }. Errors: KIT_TOKENS_MISSING — the version has no dictionary (introduced after 0.4.0), KIT_NO_STYLING — the block has no markup.',
|
|
@@ -2010,9 +2037,9 @@ export const EN_DESCRIPTIONS = {
|
|
|
2010
2037
|
record_timeseries: 'Record one or more timeseries points.',
|
|
2011
2038
|
query_timeseries: 'Query a timeseries with aggregation.',
|
|
2012
2039
|
list_timeseries_sources: 'List timeseries sources in the workspace.',
|
|
2013
|
-
ask_advisor: 'Ask the platform expert — advice on schema design, best practices, troubleshooting, feature explanations. Returns: { advice }.',
|
|
2040
|
+
ask_advisor: 'Ask the platform expert — advice on schema design, best practices, troubleshooting, feature explanations. Gives a detailed advice grounded in the current workspace schema. Returns: { advice }.',
|
|
2014
2041
|
web_search: 'Search the internet. Returns a list of results with title, URL and snippet. Use for price lookups, product info, current data from open sources. Returns: { query, results:[{title, url, snippet}], total }.',
|
|
2015
|
-
list_platform_capabilities: 'Full list of platform capabilities by category: data, columns, analytics, automations, documents, integrations, security, portal, AI, graph. Returns: { items:[{category, features}] }.',
|
|
2042
|
+
list_platform_capabilities: 'Full list of platform capabilities by category: data, columns, analytics, automations, documents, integrations, security, portal, AI, graph. Use when the user asks "what can the platform do?" or "what features are there?". Returns: { items:[{category, features}] }.',
|
|
2016
2043
|
docs_map: 'Map of the platform documentation: which documents exist, what each covers and when it last changed. Start here for questions about how the platform works. Returns: { total, areas, docs:[{path, area, module, title, summary, updatedAt}] }.',
|
|
2017
2044
|
docs_read: 'Read a documentation page in full or a single section. Take the path from docs_map or docs_search. Long text is read in pages: when hasMore=true pass nextOffset as offset. Returns: { path, title, section, headings, text, totalChars, hasMore, lastCommit }.',
|
|
2018
2045
|
docs_search: 'Find a place in the platform documentation: hybrid search (meaning + exact names) over fragments with document and section references. An empty result means "not in the found documents", NOT "absent from the documentation". Returns: { results:[{path, section, text, citation, score}], total }.',
|
|
@@ -2029,13 +2056,13 @@ export const EN_DESCRIPTIONS = {
|
|
|
2029
2056
|
retry_webhook_delivery: 'Retry a webhook delivery (for failed attempts). Returns: { success, deliveryId }.',
|
|
2030
2057
|
delete_notification: 'Delete a user notification by ID. Returns: { message }.',
|
|
2031
2058
|
// Workspace invitations
|
|
2032
|
-
list_workspace_invitations: 'List active workspace invitations (email, role, status). Returns: { items, total }.',
|
|
2033
|
-
cancel_workspace_invitation: 'Cancel a workspace invitation by ID. Returns: { message }.',
|
|
2059
|
+
list_workspace_invitations: 'List active workspace invitations (admin only; email, role, status). Returns: { items, total }.',
|
|
2060
|
+
cancel_workspace_invitation: 'Cancel a workspace invitation by ID (admin only, requires confirmation). Returns: { message }.',
|
|
2034
2061
|
// Object backlinks
|
|
2035
2062
|
get_object_backlinks: 'Find all records referencing this object (mentions, ref fields). Returns: { items:[{id, typeId, typeName, fieldName}], total }.',
|
|
2036
2063
|
// Report joins
|
|
2037
|
-
create_report_join: 'Add a JOIN to a report to combine it with another table. Returns: { joinId, ... }.',
|
|
2038
|
-
delete_report_join: 'Remove a JOIN from a report by ID. Returns: { deleted }.',
|
|
2064
|
+
create_report_join: 'Add a JOIN to a report to combine it with another table. For child tables the JOIN to the parent table is auto-detected (child→parent via a.up). Without leftField/rightColId no ON condition is generated — the default pattern is used. The alias is needed to bind columns via joinAlias in add_report_column. Returns: { joinId, ... }.',
|
|
2065
|
+
delete_report_join: 'Remove a JOIN from a report by ID (requires confirmation). Returns: { deleted }.',
|
|
2039
2066
|
// Teamchat
|
|
2040
2067
|
send_teamchat_message: 'Send a message to a teamchat topic. Supports code_cell cards for executable code.',
|
|
2041
2068
|
get_decision: 'Get a decision by ID together with its links and discussions. Returns: { decision: {id, title, domain, verdict, description, chatRoomId, ...}, links: {rel_type: [{id, decisionId, title, direction}]}, discussions: {roomId, roomName, recentTopics} }.',
|
|
@@ -2067,9 +2094,9 @@ export const EN_DESCRIPTIONS = {
|
|
|
2067
2094
|
mark_topic_read: 'Mark all messages in a topic as read.',
|
|
2068
2095
|
export_topic_to_document: 'Export a chat topic to a document. Returns: { data: {documentId, url} }.',
|
|
2069
2096
|
// Activity Intelligence
|
|
2070
|
-
get_team_activity: '
|
|
2097
|
+
get_team_activity: 'Team activity stats: messages, closed topics, tasks (including overdue), decisions, debates, reactions per member. Hot topics, blockers, recent decisions.',
|
|
2071
2098
|
get_user_activity: 'Get activity for a specific user: messages, tasks (open/completed/overdue), decisions, blockers assigned to them.',
|
|
2072
|
-
generate_team_digest: '
|
|
2099
|
+
generate_team_digest: 'AI team digest: who completed what, blockers, overdue items, accepted decisions, participation balance.',
|
|
2073
2100
|
// Orgs
|
|
2074
2101
|
list_orgs: 'List organizations of the current user.',
|
|
2075
2102
|
get_org: 'Get organization info by slug.',
|
|
@@ -2146,9 +2173,15 @@ export const EN_DESCRIPTIONS = {
|
|
|
2146
2173
|
pm_start_sprint: 'Start a sprint (changes status to active).',
|
|
2147
2174
|
pm_complete_sprint: 'Complete a sprint (moves incomplete issues to backlog).',
|
|
2148
2175
|
pm_delete_sprint: 'Delete a sprint.',
|
|
2149
|
-
pm_get_board: 'Get the Kanban board view (issues grouped by status columns).',
|
|
2150
|
-
pm_get_backlog: 'Get the backlog (unassigned issues not in any sprint).',
|
|
2176
|
+
pm_get_board: 'Get the Kanban board view (issues grouped by status columns). Optional filters: sprint_id, board_id, milestone_id, show_all, labels.',
|
|
2177
|
+
pm_get_backlog: 'Get the backlog (unassigned issues not in any sprint). Optionally filter by milestone with milestone_id.',
|
|
2151
2178
|
pm_get_sprint_progress: 'Get sprint progress (burndown, velocity, completion stats).',
|
|
2179
|
+
pm_list_milestones: 'List milestones with progress (issues/points done vs total) and effective_status: planned/active/completed, or missed when overdue.',
|
|
2180
|
+
pm_create_milestone: 'Create a milestone.',
|
|
2181
|
+
pm_update_milestone: 'Update an existing milestone.',
|
|
2182
|
+
pm_complete_milestone: 'Complete a milestone. Unclosed issues move to backlog (default) or to the next milestone with move_to set to next.',
|
|
2183
|
+
pm_delete_milestone: 'Delete a milestone. Issues are unlinked, not deleted.',
|
|
2184
|
+
pm_get_roadmap: 'Roadmap data: epic timeline ranges (computed from descendant issues) plus milestones with progress.',
|
|
2152
2185
|
pm_get_velocity: 'Get velocity metrics for completed sprints — done points, total points, average velocity.',
|
|
2153
2186
|
pm_get_burndown: 'Get burndown chart data for a sprint — remaining points per day with ideal line.',
|
|
2154
2187
|
pm_get_cycle_time: 'Get cycle time metrics — time from in_progress to done, with avg/median.',
|
|
@@ -2219,10 +2252,17 @@ export const EN_DESCRIPTIONS = {
|
|
|
2219
2252
|
vid_list_jobs: 'List video-engine jobs of the workspace.',
|
|
2220
2253
|
vid_cancel_job: 'Cancel a video-engine job (if it has not finished yet).',
|
|
2221
2254
|
vid_validate_scenario: 'Validate a video scenario against the schema without creating anything: returns normalized steps or errors.',
|
|
2255
|
+
vid_publish_job: 'Publish a finished video-engine job mp4 into workspace files: the file appears in Files and becomes servable to the portal via /portal/api/files/<filename>. Idempotent.',
|
|
2222
2256
|
// Financial model
|
|
2223
2257
|
fin_grid: 'Computed financial-model grid: period columns, rows with per-period values, totals and the sheet structure. scenario picks a scenario (defaults to the model first one), sheetId narrows to one sheet. Rows with an id like "g123" are group subtotals and have no record in the database.',
|
|
2224
2258
|
fin_graph: 'Dependency graph of a financial model: the order cells are computed in and which cell depends on which. A circular reference is returned in the cycle field with an empty order — in that case the grid does not compute at all.',
|
|
2225
2259
|
fin_goal_seek: 'Goal seek: which levers bring a target cell to the wanted value. target.rowId is a row id (or "g123" for a group subtotal), levers are input rows that may change, with optional min/max bounds. Without apply:true it only computes; with apply:true it writes the solution, and only when the target was reached. Failure is named in reason: unknown_target, no_sensitivity, flat, bounds, no_convergence.',
|
|
2260
|
+
// Synced lookups (external lookup tables pulled from another workspace)
|
|
2261
|
+
synced_lookup_create: 'Attach an external lookup: the local table becomes a synced copy of a table from another workspace. Requires access to the source workspace.',
|
|
2262
|
+
synced_lookup_delete: 'Detach an external lookup: removes the sync config (the target table keeps its data). Requires confirmation (TIER_HIGH).',
|
|
2263
|
+
synced_lookup_list: 'List external lookups of the current workspace with their schedules and last sync status.',
|
|
2264
|
+
synced_lookup_reschedule: 'Change the sync schedule of an external lookup.',
|
|
2265
|
+
synced_lookup_sync: 'Run the sync of an external lookup immediately.',
|
|
2226
2266
|
|
|
2227
2267
|
};
|
|
2228
2268
|
|
|
@@ -2316,16 +2356,22 @@ async function dispatchTool(request) {
|
|
|
2316
2356
|
}
|
|
2317
2357
|
// Re-call the tool with the elicited answer injected into args
|
|
2318
2358
|
const originalArgs = args || {};
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2359
|
+
let resumeData;
|
|
2360
|
+
try {
|
|
2361
|
+
resumeData = await apiFetch(`/api/v2/${workspace}/ai/tool`, {
|
|
2362
|
+
method: 'POST',
|
|
2363
|
+
body: JSON.stringify({
|
|
2364
|
+
name,
|
|
2365
|
+
args: { ...originalArgs, elicitedAnswer: elicitResult.content },
|
|
2366
|
+
threadId: data?.data?.threadId,
|
|
2367
|
+
schemaCtx: null,
|
|
2368
|
+
}),
|
|
2369
|
+
headers: { 'Content-Type': 'application/json' },
|
|
2370
|
+
});
|
|
2371
|
+
} catch (resumeErr) {
|
|
2372
|
+
// TD-065: отказ повторного вызова — ошибка тула, а не «требуется ввод»
|
|
2373
|
+
return toolErrorResult(resumeErr);
|
|
2374
|
+
}
|
|
2329
2375
|
return {
|
|
2330
2376
|
content: [{ type: 'text', text: typeof resumeData.data === 'string' ? resumeData.data : JSON.stringify(resumeData.data) }],
|
|
2331
2377
|
};
|
|
@@ -2352,7 +2398,7 @@ async function dispatchTool(request) {
|
|
|
2352
2398
|
content: [{ type: 'text', text: typeof result === 'string' ? result : JSON.stringify(result, null, 2) }],
|
|
2353
2399
|
};
|
|
2354
2400
|
} catch (err) {
|
|
2355
|
-
return
|
|
2401
|
+
return toolErrorResult(err);
|
|
2356
2402
|
}
|
|
2357
2403
|
}
|
|
2358
2404
|
|
|
@@ -2386,10 +2432,16 @@ async function handleConfirmAction(approved, confirmId) {
|
|
|
2386
2432
|
} else {
|
|
2387
2433
|
// Backend HITL — proxy to /mcp-resume
|
|
2388
2434
|
await ensureAuth();
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2435
|
+
let data;
|
|
2436
|
+
try {
|
|
2437
|
+
data = await apiFetch(`/api/v2/${workspace}/ai/mcp-resume`, {
|
|
2438
|
+
method: 'POST',
|
|
2439
|
+
body: JSON.stringify({ threadId: pending.threadId, approved }),
|
|
2440
|
+
});
|
|
2441
|
+
} catch (resumeErr) {
|
|
2442
|
+
// TD-065: раньше отказ /mcp-resume читался как текст успеха
|
|
2443
|
+
return toolErrorResult(resumeErr);
|
|
2444
|
+
}
|
|
2393
2445
|
msg = data.data?.message || (approved ? 'Action confirmed and executed.' : 'Action rejected.');
|
|
2394
2446
|
}
|
|
2395
2447
|
|
|
@@ -2402,7 +2454,7 @@ async function handleConfirmAction(approved, confirmId) {
|
|
|
2402
2454
|
|
|
2403
2455
|
// ─── create_workspace handler ─────────────────────────────────────────────────
|
|
2404
2456
|
|
|
2405
|
-
async function handleCreateWorkspace({ name, slug, template, templateId }) {
|
|
2457
|
+
async function handleCreateWorkspace({ name, slug, template, templateId, blocks }) {
|
|
2406
2458
|
if (!name || !slug) {
|
|
2407
2459
|
return { content: [{ type: 'text', text: 'Error: name and slug are required' }], isError: true };
|
|
2408
2460
|
}
|
|
@@ -2414,6 +2466,10 @@ async function handleCreateWorkspace({ name, slug, template, templateId }) {
|
|
|
2414
2466
|
const body = { name, slug };
|
|
2415
2467
|
if (templateId) body.templateId = templateId;
|
|
2416
2468
|
else if (template) body.template = template;
|
|
2469
|
+
// blocks едут как есть: отсутствие поля = «весь шаблон», [] = «только
|
|
2470
|
+
// основа» — различение держит REST-схема (blockPickSchema), здесь его не
|
|
2471
|
+
// стирать: `if (blocks)` не отличает [] от отсутствия, что и требуется.
|
|
2472
|
+
if (Array.isArray(blocks)) body.blocks = blocks;
|
|
2417
2473
|
const data = await apiFetch('/api/v2/workspaces', {
|
|
2418
2474
|
method: 'POST',
|
|
2419
2475
|
body: JSON.stringify(body),
|
|
@@ -2875,9 +2931,17 @@ export function findSimilarTools(name, catalog, limit = 3) {
|
|
|
2875
2931
|
* с ПРЯМЫМ запретом подмены; неактивный — с подсказкой активировать группу.
|
|
2876
2932
|
*/
|
|
2877
2933
|
export function buildNotActiveText(name, catalog, activeNames) {
|
|
2934
|
+
// PM-103: имени нет в каталоге — это не «не активен», а «такого тула нет».
|
|
2935
|
+
// Общий текст «is not active» модель читает как «имя неверное, попробую соседнее».
|
|
2936
|
+
const known = catalog.some((t) => t.name === name);
|
|
2937
|
+
if (!known) {
|
|
2938
|
+
return `Error: Unknown tool "${name}" — no such tool in the integram catalog. ` +
|
|
2939
|
+
`Do NOT call a different tool instead. Check the name, or use search_tools to discover the right one.`;
|
|
2940
|
+
}
|
|
2878
2941
|
const similar = findSimilarTools(name, catalog);
|
|
2879
2942
|
if (!similar.length) {
|
|
2880
|
-
return `Error: Tool "${name}" is not active. Use search_tools to discover and activate it first
|
|
2943
|
+
return `Error: Tool "${name}" is not active. Use search_tools to discover and activate it first. ` +
|
|
2944
|
+
`Do NOT call a different tool instead — substitution answers the wrong question.`;
|
|
2881
2945
|
}
|
|
2882
2946
|
const activeSet = new Set(activeNames);
|
|
2883
2947
|
const activeHits = similar.filter((t) => activeSet.has(t.name));
|
package/package.json
CHANGED