@retensy/mcp 0.36.0 → 0.37.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/README.md
CHANGED
|
@@ -209,7 +209,7 @@ MCP-сервер (+ скилл для Claude Code) для **сборки и пу
|
|
|
209
209
|
| `graph_versions_list(graphId, [version], [compareTo])` | история версий сценария (снимки при публикации, правках живого графа, ручные); с `version:N` — сравнение с текущим графом или другой версией (`compareTo`). Право `read` |
|
|
210
210
|
| `graph_version_rollback(graphId, version)` | откат сценария на версию = публикация снимка (проверки как у `edit_graph_live`, текущее состояние сохраняется отдельной версией). Право `write:bots` |
|
|
211
211
|
| `import_funnel(botId, name, graphFile\|graph)` | всё за раз: create → update → dry-run → publish |
|
|
212
|
-
| `list_templates()` | готовые шаблоны воронок |
|
|
212
|
+
| `list_templates([niche], [channel], [query])` | готовые шаблоны воронок (~30, ниша и каналы в карточке; фильтры по нише, каналу, тексту); те же открыты публично на `/templates` |
|
|
213
213
|
| `create_graph_from_template(botId, templateId, name)` | граф из шаблона (DRAFT) |
|
|
214
214
|
| `clone_graph(graphId)` | копия графа в новый DRAFT |
|
|
215
215
|
| `rename_graph(graphId, name)` | переименовать сценарий |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retensy/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "MCP server to build and publish Telegram and MAX bot funnels/automations, broadcasts, service integrations, block-based websites (incl. free-layout Zero blocks, designs, templates, custom domains, form leads) and Markdown blog articles in the Retensy Bots service. Zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"start": "node src/index.mjs",
|
|
23
23
|
"check": "node --check src/index.mjs",
|
|
24
|
-
"test": "node scripts/smoke.mjs && node scripts/telemetry.test.mjs && node scripts/live-edit-422.test.mjs && node scripts/broadcast-connect.test.mjs && node scripts/integration-core.test.mjs && node scripts/site-init.test.mjs && node scripts/ai-agents.test.mjs && node scripts/agent-write-tools.test.mjs && node scripts/battery-tools.test.mjs && node scripts/parity-tools.test.mjs && node scripts/parity-2.test.mjs && node scripts/validate-graph.test.mjs && node scripts/call-scenario.test.mjs && node scripts/audience-publications.test.mjs && node scripts/chains-analytics.test.mjs && node scripts/platform-decisions.test.mjs && node scripts/token-scopes.test.mjs && node scripts/secondary-graphs.test.mjs && node scripts/graph-versions.test.mjs",
|
|
24
|
+
"test": "node scripts/smoke.mjs && node scripts/telemetry.test.mjs && node scripts/live-edit-422.test.mjs && node scripts/broadcast-connect.test.mjs && node scripts/integration-core.test.mjs && node scripts/site-init.test.mjs && node scripts/ai-agents.test.mjs && node scripts/agent-write-tools.test.mjs && node scripts/battery-tools.test.mjs && node scripts/parity-tools.test.mjs && node scripts/parity-2.test.mjs && node scripts/validate-graph.test.mjs && node scripts/call-scenario.test.mjs && node scripts/audience-publications.test.mjs && node scripts/chains-analytics.test.mjs && node scripts/platform-decisions.test.mjs && node scripts/token-scopes.test.mjs && node scripts/secondary-graphs.test.mjs && node scripts/graph-versions.test.mjs && node scripts/templates-filter.test.mjs",
|
|
25
25
|
"validate": "node skills/build-bot-funnel/validate.mjs"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
@@ -61,7 +61,7 @@ description: Собрать воронку (сценарий) бота для с
|
|
|
61
61
|
5. **Залей и опубликуй через MCP `bot-graph`** (если он подключён и пользователь просит публикацию):
|
|
62
62
|
- `list_bots` → выбрать `botId` (или `create_graph` в существующем боте).
|
|
63
63
|
Конфликт токена (тот же Telegram-токен подключён ещё в BotHelp/Salebot/своём скрипте): `active:false` + `pausedReason:"TOKEN_CONFLICT"` — вебхук другого сервиса, бот на паузе (отвечать не будет); `pausedChannels` — выключены отдельные каналы; `conflictWarning:"TOKEN_CONFLICT_POLLING"` — бот работает, но часть сообщений забирает другая программа. Во всех случаях попроси пользователя отключить бота в том сервисе (или `/revoke` в @BotFather → `bot_change_token`), при паузе — потом `bot_resume`. Справка: `/docs#token-conflict`.
|
|
64
|
-
- `create_graph(botId, name)` → получить `graphId`. Либо стартуй с готовой основы: `list_templates` → `create_graph_from_template(botId, templateId, name)`.
|
|
64
|
+
- `create_graph(botId, name)` → получить `graphId`. Либо стартуй с готовой основы: `list_templates` (фильтры `niche`, `channel`, `query`; около 30 шаблонов под русские ниши: салон, клиника, недвижимость, школа, магазин, ресторан, авто, юрист, отзывы и др.) → `create_graph_from_template(botId, templateId, name)`. Подходящий шаблон почти всегда быстрее и надёжнее сборки с нуля: правь только тексты и ссылки. Шаблоны не содержат платных узлов (`AI_REPLY`, `CALL_WEBHOOK`), поэтому работают и на бесплатном тарифе.
|
|
65
65
|
- `update_graph(graphId, nodes, edges, canvasMeta)` → залить узлы/рёбра.
|
|
66
66
|
- `dry_run(graphId, kind:"command", value:"start")` → прогнать стартовую ветку, проверить `runStatus`. `dry_run` ничего не делает снаружи: внешние запросы, CRM, таблицы, письма, уведомления, счета и ответы ИИ пропускаются (у шага `skipped: "dry-run"`), переменные из их ответов остаются пустыми — это проверяется только живым прогоном.
|
|
67
67
|
- `publish_graph(graphId)` → при отказе инструмент вернёт ошибку `HTTP 422` со ВСЕМИ причинами построчно (`code@nodeId: message`) — разобрать, починить узлы, обновить, опубликовать снова.
|
|
@@ -542,3 +542,7 @@ node validate.mjs graph.json --platform=INSTAGRAM
|
|
|
542
542
|
|
|
543
543
|
## Подстановки в тексте
|
|
544
544
|
`{{from.first_name}}`, `{{from.username}}`, `{{var.<имя>}}`, либо `{Имя}` как плейсхолдер. Имена переменных/меток: `[a-z_][a-z0-9_]{0,63}` (var) и `[a-z0-9_-]{1,64}` (tag).
|
|
545
|
+
|
|
546
|
+
## Готовые шаблоны (list_templates)
|
|
547
|
+
|
|
548
|
+
Шаблоны лежат в бэкенде как JSON `{id, name, description, icon, niche, channels, en:{name,description}, graph:{name,nodes,edges}}` и проходят тот же `GraphValidator`, что и ваши графы. Это обычный граф формата выше, без новых типов узлов: id узлов `tpl_*`, кнопки `CALLBACK` с пустым `value` и рёбрами `btn_N`, вопросы с рёбрами `valid`/`invalid`. Платных узлов (`AI_REPLY`, `CALL_WEBHOOK`) в нише-шаблонах нет, кроме универсального `ai-agent` (у него `hasAi:true`). Ниша: beauty, medical, realty, education, ecommerce, fitness, restaurant, auto, legal, reviews, universal. Каналы: TELEGRAM, MAX, VK.
|
package/src/index.mjs
CHANGED
|
@@ -1056,7 +1056,7 @@ const TOOLS = [
|
|
|
1056
1056
|
{ name: "graph_version_rollback", description: "Откатить сценарий на версию (POST /api/bots/graphs/{graphId}/versions/{version}/rollback). Откат = публикация снимка: у ЖИВОГО графа бот переходит на ту версию сразу, и она проходит те же проверки, что edit_graph_live (валидатор, платные блоки, лимит блоков, платформа) — при ошибках HTTP 422 со всеми code@nodeId, граф НЕ изменён. Состояние ДО отката сервер сам сохраняет отдельной версией (savedCurrentAs), результат — версией reason ROLLBACK (newVersion), так что откат обратим тем же инструментом. Узлы получают ТЕ ЖЕ id, что были в снимке. Это действие на живом боте: перед вызовом покажи пользователю graph_versions_list (version:N — что изменится) и получи согласие. Нужно право write:bots.", inputSchema: { type: "object", properties: { graphId: { type: "string" }, version: { type: "integer", description: "Номер версии из graph_versions_list" } }, required: ["graphId", "version"] } },
|
|
1057
1057
|
{ name: "unpublish_graph", description: "Снять ДОПОЛНИТЕЛЬНЫЙ сценарий с публикации (POST /api/bots/graphs/{graphId}/unpublish): он снова черновик, лендинги и ссылки на него ведут в основной сценарий, подписчики в нём возвращаются в основной, его задержки отменяются. Основной сценарий так не снимается — HTTP 409.", inputSchema: { type: "object", properties: { graphId: { type: "string" } }, required: ["graphId"] } },
|
|
1058
1058
|
{ name: "import_funnel", description: "Всё за раз: создать граф, залить узлы/рёбра, (опц.) dry-run /start, опубликовать. Граф можно передать инлайном (graph) или файлом (graphFile).", inputSchema: { type: "object", properties: { botId: { type: "string" }, name: { type: "string" }, graph: { type: "object" }, graphFile: { type: "string", description: "Путь к локальному JSON графа вместо инлайн graph; поддерживается ~" }, dryRun: { type: "boolean" }, publish: { type: "boolean" } }, required: ["botId"] } },
|
|
1059
|
-
{ name: "list_templates", description: "Список готовых шаблонов воронок (id, имя,
|
|
1059
|
+
{ name: "list_templates", description: "Список готовых шаблонов воронок (id, имя, описание, ниша, каналы, nameEn/descriptionEn, hasAi). Около 30 шаблонов под русские ниши (запись в салон и клинику, квалификация в недвижимости, лид-магнит школы, заказ в магазине, бронь в ресторане, сбор отзывов и др.) плюс универсальные. Можно сузить: niche (beauty, medical, realty, education, ecommerce, fitness, restaurant, auto, legal, reviews, universal), channel (TELEGRAM, MAX, VK), query (подстрока в названии и описании). Те же шаблоны открыты публично на /templates.", inputSchema: { type: "object", properties: { niche: { type: "string" }, channel: { type: "string" }, query: { type: "string" } } } },
|
|
1060
1060
|
{ name: "create_graph_from_template", description: "Создать граф (DRAFT) из шаблона (см. list_templates). Возвращает граф с id — дальше правь через update_graph.", inputSchema: { type: "object", properties: { botId: { type: "string" }, templateId: { type: "string" }, name: { type: "string" } }, required: ["botId", "templateId"] } },
|
|
1061
1061
|
{ name: "rename_graph", description: "Переименовать сценарий (работает и для опубликованных — имя не влияет на исполнение).", inputSchema: { type: "object", properties: { graphId: { type: "string" }, name: { type: "string" } }, required: ["graphId", "name"] } },
|
|
1062
1062
|
{ name: "clone_graph", description: "Склонировать граф в новый DRAFT «… (copy)» — безопасно итерировать поверх опубликованного. Клон сценария-вебхука получает собственный путь и секрет вебхука.", inputSchema: { type: "object", properties: { graphId: { type: "string" } }, required: ["graphId"] } },
|
|
@@ -1443,7 +1443,15 @@ async function handleCall(params) {
|
|
|
1443
1443
|
}
|
|
1444
1444
|
return okResult({ graphId, steps });
|
|
1445
1445
|
}
|
|
1446
|
-
case "list_templates":
|
|
1446
|
+
case "list_templates": {
|
|
1447
|
+
const all = await api("/api/bots/graph-templates");
|
|
1448
|
+
if (!Array.isArray(all) || !(a.niche || a.channel || a.query)) return okResult(all);
|
|
1449
|
+
const q = String(a.query || "").trim().toLowerCase();
|
|
1450
|
+
return okResult(all.filter((t) =>
|
|
1451
|
+
(!a.niche || t.niche === a.niche)
|
|
1452
|
+
&& (!a.channel || (Array.isArray(t.channels) && t.channels.includes(String(a.channel).toUpperCase())))
|
|
1453
|
+
&& (!q || `${t.name} ${t.description} ${t.nameEn || ""} ${t.descriptionEn || ""}`.toLowerCase().includes(q))));
|
|
1454
|
+
}
|
|
1447
1455
|
case "create_graph_from_template":
|
|
1448
1456
|
return okResult(await api(`/api/bots/${a.botId}/graphs/from-template`, { method: "POST", body: { templateId: a.templateId, name: a.name } }));
|
|
1449
1457
|
case "rename_graph":
|