integram-mcp 0.7.34 → 0.7.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +6 -5
  2. package/index.js +37 -21
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/integram-mcp)](https://www.npmjs.com/package/integram-mcp)
4
4
 
5
- MCP-сервер для Integram — даёт доступ к 621 инструментам (таблицы, документы, отчёты, автоматизации, портал, Telegram-боты, граф знаний и т.д.) из Claude Code, Claude Desktop и Cursor.
5
+ MCP-сервер для Integram — даёт доступ к 626 инструментам (таблицы, документы, отчёты, автоматизации, портал, 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.34
18
+ -- npx -y integram-mcp@0.7.36
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.34
46
+ -- npx -y integram-mcp@0.7.36
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.34"],
60
+ "args": ["-y", "integram-mcp@0.7.36"],
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.34"],
80
+ "args": ["-y", "integram-mcp@0.7.36"],
81
81
  "env": {
82
82
  "INTEGRAM_URL": "https://ai2o.online",
83
83
  "INTEGRAM_EMAIL": "you@example.com",
@@ -182,6 +182,7 @@ claude mcp add integram -e INTEGRAM_URL=... -e INTEGRAM_EMAIL=... -e INTEGRAM_PA
182
182
  | **agents** | Реестр внешних AI-агентов, делегирование | 11 |
183
183
  | **comments** | Комментарии и реакции к записям | 6 |
184
184
  | **automations** | Детали автоматизации, лог доставки вебхуков | 5 |
185
+ | **presentations** | Презентации: PPTX-движок воркспейса (список, чтение, создание из outline, сохранение слайдов, удаление) | 5 |
185
186
  | **workspace-tools** | Инструменты уровня области: регистрация, правка, ввоз наборов | 5 |
186
187
  | **advisor** | Советы эксперта, возможности платформы | 4 |
187
188
  | **bulk** | Массовые операции: создание, обновление, удаление, AI-batch | 4 |
package/index.js CHANGED
@@ -23,6 +23,7 @@ import {
23
23
  CallToolRequestSchema,
24
24
  } from '@modelcontextprotocol/sdk/types.js';
25
25
  import { createRequire } from 'module';
26
+ import { rememberActivation as rememberActivationIn, applyActivation, forgetActivation } from './activation-memory.js';
26
27
 
27
28
  // Own identity — read from package.json, never hardcoded: a hardcoded copy drifts
28
29
  // (it sat at 0.5.0 through the 0.6.0 and 0.7.0 releases).
@@ -213,6 +214,28 @@ function withUpdateNotice(result) {
213
214
 
214
215
  let allTools = []; // full list from backend
215
216
  const activeTools = new Map(); // name → tool def (currently exposed via MCP)
217
+ // Память активации по воркспейсу: switch_workspace ВОССТАНАВЛИВАЕТ неядерную
218
+ // активацию целевого воркспейса, а не сбрасывает до ядра. Инцидент 05.09.2026:
219
+ // clear() в switch_workspace субагента сбрасывал активацию ГЛОБАЛЬНО — у
220
+ // основного сеанса тоже; см. tests/activation-memory.test.js.
221
+ const activationMemory = new Map(); // slug → Set имён неядерных инструментов
222
+
223
+ function rememberActivation() {
224
+ rememberActivationIn(activationMemory, workspace, [...activeTools.keys()], BUILT_IN_NAMES);
225
+ }
226
+
227
+ // Загрузить наборы инструментов целевого воркспейса: ядро + восстановленная
228
+ // из памяти активация. Единая замена прежним clear()+core в четырёх местах.
229
+ async function loadWorkspaceTools(slug) {
230
+ const tools = await fetchTools();
231
+ activeTools.clear();
232
+ for (const t of tools) {
233
+ if (t.group === 'core' && !BUILT_IN_NAMES.has(t.name)) activeTools.set(t.name, t);
234
+ }
235
+ const restored = applyActivation(activationMemory, slug, tools, (t) => activeTools.set(t.name, t));
236
+ await server.sendToolListChanged();
237
+ return { tools, restored };
238
+ }
216
239
 
217
240
  // Built-in MCP tools handled locally — never load from backend to avoid duplicates
218
241
  const BUILT_IN_NAMES = new Set([
@@ -1653,13 +1676,9 @@ async function handleCreateWorkspace({ name, slug, template, templateId }) {
1653
1676
  log(`Created workspace "${ws.slug}" (id=${ws.id}, db=${ws.dbName})`);
1654
1677
 
1655
1678
  // Auto-switch to the new workspace
1679
+ rememberActivation();
1656
1680
  workspace = ws.slug;
1657
- const tools = await fetchTools();
1658
- activeTools.clear();
1659
- for (const t of tools) {
1660
- if (t.group === 'core' && !BUILT_IN_NAMES.has(t.name)) activeTools.set(t.name, t);
1661
- }
1662
- await server.sendToolListChanged();
1681
+ await loadWorkspaceTools(ws.slug);
1663
1682
 
1664
1683
  return {
1665
1684
  content: [{ type: 'text', text: `Workspace "${ws.name}" created (slug: ${ws.slug}). Automatically switched to it. ${activeTools.size} core tools loaded.` }],
@@ -1698,6 +1717,7 @@ async function handleDeleteWorkspace(slug) {
1698
1717
  const data = await apiFetch(`/api/v2/workspaces/${slug}`, { method: 'DELETE' });
1699
1718
  if (!data.ok) throw new Error(JSON.stringify(data.error || data));
1700
1719
  log(`Deleted workspace "${slug}"`);
1720
+ forgetActivation(activationMemory, slug);
1701
1721
  if (workspace === slug) {
1702
1722
  workspace = '';
1703
1723
  activeTools.clear();
@@ -1808,13 +1828,9 @@ async function handleCloneWorkspace({ sourceSlug, name, slug, includeDocuments,
1808
1828
  log(`Cloned workspace "${sourceSlug}" → "${ws.slug}" (id=${ws.id})`);
1809
1829
 
1810
1830
  // Auto-switch to the new workspace
1831
+ rememberActivation();
1811
1832
  workspace = ws.slug;
1812
- const tools = await fetchTools();
1813
- activeTools.clear();
1814
- for (const t of tools) {
1815
- if (t.group === 'core' && !BUILT_IN_NAMES.has(t.name)) activeTools.set(t.name, t);
1816
- }
1817
- await server.sendToolListChanged();
1833
+ await loadWorkspaceTools(ws.slug);
1818
1834
 
1819
1835
  // Чего в клоне НЕТ — обязано быть сказано словами. Отсутствующее опаснее
1820
1836
  // пустого: пустой раздел зритель видит, отсутствующий — нет.
@@ -2080,6 +2096,9 @@ async function handleSearchTools(query) {
2080
2096
  for (const t of matched) {
2081
2097
  activeTools.set(t.name, t);
2082
2098
  }
2099
+ // Активация принадлежит текущему воркспейсу: запомнить, чтобы
2100
+ // switch_workspace её восстановил, а не сбросил (инцидент 05.09.2026).
2101
+ rememberActivation();
2083
2102
 
2084
2103
  if (matched.length) {
2085
2104
  await server.sendToolListChanged();
@@ -2146,20 +2165,17 @@ async function handleSwitchWorkspace(input) {
2146
2165
  }
2147
2166
 
2148
2167
  const slug = match.slug;
2168
+ rememberActivation();
2149
2169
  workspace = slug;
2150
2170
 
2151
- // Reload tools for the new workspace
2152
- const tools = await fetchTools();
2153
- activeTools.clear();
2154
- for (const t of tools) {
2155
- if (t.group === 'core' && !BUILT_IN_NAMES.has(t.name)) activeTools.set(t.name, t);
2156
- }
2171
+ // Загрузить инструменты целевого воркспейса: ядро + восстановленная
2172
+ // из памяти активация (инцидент 05.09.2026 — см. блок у activationMemory).
2173
+ const { tools, restored } = await loadWorkspaceTools(slug);
2157
2174
 
2158
- await server.sendToolListChanged();
2159
- log(`Switched to workspace "${slug}", ${activeTools.size} core tools loaded`);
2175
+ log(`Switched to workspace "${slug}", ${activeTools.size} tools loaded (${restored} restored from memory)`);
2160
2176
 
2161
2177
  return {
2162
- content: [{ type: 'text', text: `Switched to workspace "${slug}". Loaded ${tools.length} tools (${activeTools.size} core active). Use search_tools to activate more.` }],
2178
+ content: [{ type: 'text', text: `Switched to workspace "${slug}". Loaded ${tools.length} tools (${activeTools.size} active${restored ? `, ${restored} restored from previous activation` : ', core only'}). Use search_tools to activate more.` }],
2163
2179
  };
2164
2180
  } catch (err) {
2165
2181
  return { content: [{ type: 'text', text: `Error switching workspace: ${err.message}` }], isError: true };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integram-mcp",
3
- "version": "0.7.34",
3
+ "version": "0.7.36",
4
4
  "type": "module",
5
5
  "description": "MCP server for Integram — connect AI assistants to your workspace via Model Context Protocol",
6
6
  "mcpName": "io.github.judas-priest/integram",