integram-mcp 0.4.4 → 0.5.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 +1 -1
- package/index.js +26 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ claude mcp add integram \
|
|
|
126
126
|
| **portal** | Портал: конфиг, каталог, корзины, заказы, тикеты, KB, метрики, Telegram-боты | 42 |
|
|
127
127
|
| **docs** | Документы, блоки, версии, шаринг, папки, теги, шаблоны, PDF | 38 |
|
|
128
128
|
| **schema** | Таблицы, колонки, кнопки (AI/HTTP/script), вычисляемые колонки, валидация | 27 |
|
|
129
|
-
| **codespace** | Git-репозитории: ветки, коммиты, файлы, pull requests |
|
|
129
|
+
| **codespace** | Git-репозитории: ветки, коммиты, файлы, точечная правка (`patch_file`), pull requests; запись с `baseCommit` сливается с чужими изменениями вместо перезаписи | 22 |
|
|
130
130
|
| **reports** | Отчёты: CRUD, колонки, JOIN, фильтры, экспорт | 15 |
|
|
131
131
|
| **grants** | Роли, гранты, row-level правила (только admin) | 11 |
|
|
132
132
|
| **teamchat** | Сообщения, решения, метрики агентов, W-матрица, топики | 10 |
|
package/index.js
CHANGED
|
@@ -155,7 +155,7 @@ Only core tools (~15: CRUD, search, graph, comments, bulk, history) are loaded b
|
|
|
155
155
|
- "portal" — portal config, catalog, carts, orders, tickets, KB articles, metrics, customer profiles, Telegram bots (~42 tools)
|
|
156
156
|
- "telegram" — Telegram bot management, messaging, moderation, payments, stories, business API (subset of portal group)
|
|
157
157
|
- "grants" — roles, grants, row-level rules, member access (admin only) (~11 tools)
|
|
158
|
-
- "codespace" — git repositories: branches, commits, files, pull requests (~
|
|
158
|
+
- "codespace" — git repositories: branches, commits, files, pull requests, conflict-safe writes (~22 tools)
|
|
159
159
|
- "teamchat" — rooms, topics, messages, decisions, agent metrics, W-matrix (ONA) (~35 tools)
|
|
160
160
|
- "graph" — get_related, graph_query, neighborhood, shortest path, health, memory agents (~9 tools)
|
|
161
161
|
- "meta-kb" — debate-based knowledge curation: start debates, parallel experts, LLM synthesis (~6 tools)
|
|
@@ -802,6 +802,7 @@ Bot config schema: { description?: "...", shortDescription?: "...", welcomeMessa
|
|
|
802
802
|
Bot reactions (commands + keywords) are stored as **automations** with trigger.botId — use create_automation with:
|
|
803
803
|
- Command: trigger: { type: "on_telegram_command", command: "status", botId: N }
|
|
804
804
|
- Keyword: trigger: { type: "on_telegram_message", pattern: "привет,hello", matchMode: "contains", botId: N }
|
|
805
|
+
- Intake (every message, incl. media): trigger: { type: "on_telegram_message", botId: N } — no pattern. Optional messageTypes: ["voice","document"]. Runs alongside keyword rules; template vars _message, _message_type, _from_user_id, _message_id, _date, _file_id, _file_name
|
|
805
806
|
- Payment: trigger: { type: "on_telegram_payment", botId: N } — fires on successful payment
|
|
806
807
|
- Pre-checkout: trigger: { type: "on_telegram_pre_checkout", botId: N } — validate before charging
|
|
807
808
|
- Shipping: trigger: { type: "on_telegram_shipping", botId: N } — provide shipping options
|
|
@@ -864,10 +865,27 @@ Git repository hosting per workspace. Activate via search_tools("codespace").
|
|
|
864
865
|
- list_commits(slug, ref?, limit?, offset?) — list commits on a branch
|
|
865
866
|
- get_commit_diff(slug, sha) — unified diff for a single commit (works for initial commit)
|
|
866
867
|
- get_file_tree(slug, ref?, path?) — list files/dirs in a repo. Returns { items: [{ name, type, size, path }], ref, path }
|
|
867
|
-
- read_blob(slug, path, ref?) —
|
|
868
|
-
-
|
|
869
|
-
-
|
|
870
|
-
-
|
|
868
|
+
- read_blob(slug, path, ref?, offset?, limit?) — прочитать файл. Возвращает baseCommit — состояние ветки на момент чтения. Если baseCommit пришёл null, файл прочитан не целиком: перечитайте без offset/limit, прежде чем писать.
|
|
869
|
+
- patch_file(slug, branch, filePath, oldStr, newStr, message?, baseCommit?) — ПРЕДПОЧТИТЕЛЬНЫЙ способ править существующий файл. Заменяет уникальный кусок текста, файл целиком слать не нужно. oldStr должен встречаться ровно один раз.
|
|
870
|
+
- commit_file(slug, branch, filePath, content, message?, baseCommit?) — записать файл целиком. Для новых и коротких файлов; для правки существующих используйте patch_file.
|
|
871
|
+
- commit_multi_files(slug, branch, files, message, baseCommit?) — несколько файлов одним коммитом.
|
|
872
|
+
- delete_repo_file(slug, branch, filePath, message?, baseCommit?) — удалить файл (git rm + commit). **TIER_HIGH**
|
|
873
|
+
|
|
874
|
+
Запись ведёт себя как git: коммит создаётся на указанном baseCommit, ветка двигается только если не ушла вперёд, иначе выполняется слияние. Всегда передавайте baseCommit при правке существующего — иначе рискуете затереть чужую работу.
|
|
875
|
+
|
|
876
|
+
Разрешение конфликта. Ответ MERGE_CONFLICT содержит всё нужное, перечитывать файл не надо:
|
|
877
|
+
- details.conflicts — список конфликтующих файлов;
|
|
878
|
+
- details.blocks — их содержимое с конфликтными блоками. В блоке три части: ваша версия, исходная (между строками ||||||| и =======), версия ветки. Сравнивайте с исходной — она показывает, что именно меняла каждая сторона;
|
|
879
|
+
- details.baseCommit — состояние, на которое надо писать разрешение;
|
|
880
|
+
- details.retryable=false — повторять ту же запись бессмысленно, ответ будет тот же.
|
|
881
|
+
|
|
882
|
+
Порядок разрешения — выполняйте именно так, не сокращая:
|
|
883
|
+
1. Для каждого конфликтного блока выпишите ДВА изменения относительно исходной части: что сделала ваша сторона и что сделала сторона ветки.
|
|
884
|
+
2. Сформулируйте намерение каждой стороны. Удаление строки — тоже намерение: если исходная часть содержит строку, которой нет в одной из версий, эту строку намеренно удалили, и в итог её возвращать нельзя.
|
|
885
|
+
3. Соедините оба намерения. Механическое склеивание обеих половин — типичная ошибка: так в итог попадает то, что одна из сторон осознанно убрала.
|
|
886
|
+
4. Соберите итоговый текст без маркеров конфликта и запишите через commit_file с baseCommit из details.
|
|
887
|
+
|
|
888
|
+
При WRITE_CONTENTION (retryable=true) — наоборот, ничего разбирать не надо, достаточно повторить запись.
|
|
871
889
|
|
|
872
890
|
**Pull Requests:**
|
|
873
891
|
- list_prs(slug, status?, limit?, offset?) — list PRs (status: open|closed|merged|draft)
|
|
@@ -1032,7 +1050,7 @@ Destructive and schema operations return "REQUIRES CONFIRMATION". Ask the user t
|
|
|
1032
1050
|
`;
|
|
1033
1051
|
|
|
1034
1052
|
const server = new Server(
|
|
1035
|
-
{ name: 'integram', version: '
|
|
1053
|
+
{ name: 'integram', version: '0.5.0' },
|
|
1036
1054
|
{ capabilities: { tools: { listChanged: true }, elicitation: {} }, instructions: INSTRUCTIONS },
|
|
1037
1055
|
);
|
|
1038
1056
|
|
|
@@ -1205,7 +1223,8 @@ const EN_DESCRIPTIONS = {
|
|
|
1205
1223
|
mark_file_imported: 'Mark a file as imported and link it to a created object.',
|
|
1206
1224
|
// Codespace
|
|
1207
1225
|
get_file_tree: 'List files and directories in a codespace repository at a given path and ref (branch/commit). Returns: { items: [{ name, type, size, path }], ref, path }.',
|
|
1208
|
-
read_blob: 'Read file content from a codespace repository. Returns text for text files (up to 200K chars, supports offset/limit for pagination), metadata only for binary files. Returns: { content, path, ref, binary, size, truncated }.
|
|
1226
|
+
read_blob: 'Read file content from a codespace repository. Returns text for text files (up to 200K chars, supports offset/limit for pagination), metadata only for binary files. Returns: { content, path, ref, binary, size, truncated, baseCommit }. Pass baseCommit to patch_file/commit_file so your write merges with concurrent changes instead of overwriting them. baseCommit is null when the read was truncated or offset — re-read in full before writing.',
|
|
1227
|
+
patch_file: 'Replace one unique snippet of text in a repository file. Preferred over commit_file for editing existing files: no need to send the whole file, works at any file size, rarely conflicts. oldStr must occur exactly once — lengthen the anchor if it does not. Matching is exact, including indentation.',
|
|
1209
1228
|
// Notifications
|
|
1210
1229
|
get_notification_count: 'Get the number of unread notifications for the current user. Returns: { count }.',
|
|
1211
1230
|
// Workspace
|
package/package.json
CHANGED