integram-mcp 0.7.40 → 0.7.44

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 +4 -4
  2. package/index.js +50 -34
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -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.40
18
+ -- npx -y integram-mcp@0.7.44
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.40
46
+ -- npx -y integram-mcp@0.7.44
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.40"],
60
+ "args": ["-y", "integram-mcp@0.7.44"],
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.40"],
80
+ "args": ["-y", "integram-mcp@0.7.44"],
81
81
  "env": {
82
82
  "INTEGRAM_URL": "https://ai2o.online",
83
83
  "INTEGRAM_EMAIL": "you@example.com",
package/index.js CHANGED
@@ -556,7 +556,7 @@ list_objects returns records with column aliases as keys. Use search for free-te
556
556
 
557
557
  ## Computed columns (LOOKUP, ROLLUP, FORMULA)
558
558
 
559
- Computed columns auto-calculate values based on other data. Activate via search_tools("schema").
559
+ Computed columns auto-calculate values based on other data. Activate via search_tools("schema"); for computed columns and formulas specifically use search_tools("schema computed formula").
560
560
 
561
561
  - **LOOKUP** — pull a value from a related record through a reference column. Like VLOOKUP in Excel.
562
562
  Example: Order has ref to Product → LOOKUP pulls Product's price into Order table.
@@ -578,7 +578,7 @@ Backlinks: get_schema_backlinks(typeId) — show which columns from OTHER tables
578
578
 
579
579
  ## Validation rules
580
580
 
581
- Set constraints on column values. Activate via search_tools("schema").
581
+ Set constraints on column values. Activate via search_tools("schema validation rules").
582
582
  - get_validation_rules(reqId) — see current rules for a column
583
583
  - set_validation_rules(reqId, rules) — set rules: { minLength, maxLength, minValue, maxValue, regex, unique }
584
584
  Example: require email format → set_validation_rules(reqId, { regex: "^[\\\\w.-]+@[\\\\w.-]+\\\\.[a-z]{2,}$" })
@@ -699,7 +699,7 @@ Bulk update: report_bulk_update(reportId, filters?) — mass-update records usin
699
699
 
700
700
  ## Documents
701
701
 
702
- Block-based documents (like Notion). Activate via search_tools("documents").
702
+ Block-based documents (like Notion). Activate via search_tools("документ document"); for a subarea narrow the query: search_tools("документ block"), search_tools("документ folder"), search_tools("документ tag"), search_tools("документ version"), search_tools("документ trash restore"), search_tools("документ template pdf"), search_tools("документ access sharing").
703
703
 
704
704
  - list_documents(search, folderId) — browse documents
705
705
  - get_document(docId) / get_document_blocks(docId) — read content and block structure
@@ -735,7 +735,7 @@ create_automation({ name, trigger: { type, typeId }, active?, condition, actions
735
735
  pm_deadline: { days: N (за сколько дней до due_date PM-задачи, default 1), hour: 0-23 (час UTC ежедневного скана, default 7) }; в действиях доступны {{pm_title}}, {{pm_number}}, {{pm_due_date}}, {{pm_assignee_email}} (send_notification адресуйте username: '{{pm_assignee_email}}')
736
736
  on_issue_commented / on_issue_updated: событие PM-задачи (комментарий / правка полей), pm-переменные те же
737
737
  - Actions: send_notification, send_notification_to_group, update_field, create_object, delete_object, fire_webhook, run_ai_agent, run_script, run_server_function, send_telegram, run_connector, send_email, update_related_records, set_requisite, update_related, http_request, if_else, switch, transform, wait_delay, request_approval, delegate_to_agent, invoke_agent, send_invoice, telegram_forward, answer_inline_query, telegram_ban, telegram_unban, telegram_restrict, telegram_promote, telegram_approve_join, telegram_decline_join, telegram_pin, telegram_unpin, telegram_get_chat, telegram_post_story, answer_shipping, telegram_business_reply, create_issue, update_issue
738
- create_issue: { title, description?, issue_type?, priority?, assignee_id?, parent_id?, board_id?, sprint_id?, due_date?, estimate?, labels? } — создаёт PM-задачу; результат: {{_created_issue_id}}, {{_created_issue_number}}
738
+ create_issue: { title, description?, issue_type?, priority?, assignee_id?, parent_id?, board_id?, sprint_id?, due_date?, estimate?, labels?, assigneeRole?, assigneeStrategy? } — создаёт PM-задачу; результат: {{_created_issue_id}}, {{_created_issue_number}}. assigneeRole — имя EAV-таблицы-роли воркспейса (строки = участники, у каждого логин в колонке «Логин»/«Username»/«Email»); assigneeStrategy: least_busy (умолчание) | first; assignee_id и assigneeRole взаимно исключают друг друга — конфликт отвергается при сохранении. Роль без резолвимых участников → задача без исполнителя + уведомление роли (или триггера), прогон не падает.
739
739
  update_issue: { id, title?, description?, issue_type?, status?, priority?, assignee_id?, sprint_id?, parent_id?, estimate?, due_date?, labels? } — правит PM-задачу; id можно взять из {{pm_issue_id}}
740
740
  update_related_records: { childTypeId, matchRefReqId, targetTypeId, targetMatchReqId, targetFieldReqId, sourceFieldReqId, operation: 'add'|'subtract'|'set' } — declarative cross-table update (e.g. inventory deduction: order items → match product ref → subtract from stock)
741
741
  run_server_function: { repo, fn, args?, resultVar?, idempotencyKey?, idempotencyMinutes? } — call a codespace server function (api/<fn>.js in a workspace git repo) from an automation; this is how repo code gets put on a schedule (trigger.type: 'schedule'), which previously was impossible since server functions were reachable only over HTTP from the portal. Same sandbox, capabilities and limits as the portal path (codespace/server-fn-executor.js); capabilities are declared by a "// capabilities:" comment inside the function file. Replay protection is ON by default: repo+fn+args+record runs once per idempotencyMinutes (default 1) — keep it BELOW the schedule interval or runs are silently skipped; 0 disables it. A failed call releases its claim so the next run retries. Sets {{_server_fn_error}} / {{_server_fn_skipped}}.
@@ -795,14 +795,14 @@ Activate via search_tools("bulk").
795
795
 
796
796
  ## Import / Export
797
797
 
798
- Activate via search_tools("workspace").
798
+ Activate via search_tools("файл import export download").
799
799
  - import_data(typeId, csv, mapping) — import CSV string into table. Auto-maps columns by header names. mapping override: { columnIndex: "colId" | "__val__" | "__skip__" }
800
800
  - export_data(typeId, limit, filters) — export table to CSV format
801
801
  - download_file(fileName, subdir?) — download a file from workspace storage. Returns base64 content (max 10 MB).
802
802
 
803
803
  ## Dashboards
804
804
 
805
- Visual dashboards with widgets. Activate via search_tools("workspace").
805
+ Visual dashboards with widgets. Activate via search_tools("dashboard widgets").
806
806
  - list_dashboards, get_dashboard(id), create_dashboard(title, widgets, layouts?), update_dashboard, delete_dashboard
807
807
 
808
808
  ## Workspace invitations
@@ -813,14 +813,14 @@ Activate via search_tools("workspace").
813
813
 
814
814
  ## Sharing
815
815
 
816
- Public links for views and records. Activate via search_tools("workspace").
816
+ Public links for views and records. Activate via search_tools("workspace share record view link").
817
817
  - share_view(viewId, typeId, expiresInDays, password) → returns share token/URL
818
818
  - share_record(objId, typeId, expiresInDays) → returns share token/URL
819
819
  - revoke_view_share, revoke_record_share — disable public links
820
820
 
821
821
  ## Connectors
822
822
 
823
- External data integrations. Activate via search_tools("workspace").
823
+ External data integrations. Activate via search_tools("workspace connectors"); narrow it: search_tools("workspace api docs fetch") for the AI setup workflow, search_tools("workspace connector test draft schema") for testing and schema generation, search_tools("workspace connectors cdek reconcile") for CDEK reconciliation.
824
824
  - list_connectors, get_connector, create_connector, update_connector, delete_connector, run_connector, reconcile_cdek
825
825
  - list_connector_presets — available presets (1C, SAP, SCADA, REST templates)
826
826
  - AI-assisted connector setup workflow:
@@ -838,7 +838,7 @@ Activate via search_tools("comments").
838
838
 
839
839
  ## History & rollback
840
840
 
841
- Activate via search_tools("history").
841
+ Activate via search_tools("history"); backlinks live in the objects group: search_tools("history objects backlinks").
842
842
  - get_object_history(objId) — full change log for a record
843
843
  - rollback_object(objId, auditId) — restore record to state before a specific audit entry (requires confirmation)
844
844
  - get_object_backlinks(objectId, limit, offset) — find all records that reference this object via ref columns or mentions
@@ -876,7 +876,7 @@ Activate via search_tools("memory").
876
876
 
877
877
  ## Portal (admin)
878
878
 
879
- Client-facing portal management. Activate via search_tools("portal").
879
+ Client-facing portal management. Activate via search_tools("portal"); for @kit blocks use search_tools("portal kit components"), for Telegram chat admin search_tools("portal telegram member join invite") and search_tools("portal telegram pin"), for stories and the business API search_tools("portal telegram story business").
880
880
 
881
881
  **Configuration:**
882
882
  - get_portal_config() — current portal config (branding, pages, modules, auth, chat, SEO)
@@ -1072,7 +1072,7 @@ Never state a capability, count, or setting you did not confirm via docs_* — s
1072
1072
 
1073
1073
  ## Teamchat (internal messaging)
1074
1074
 
1075
- Internal messaging with rooms, topics, and decisions. Activate via search_tools("teamchat").
1075
+ Internal messaging with rooms, topics, and decisions. Activate via search_tools("teamchat"); narrow it: search_tools("teamchat room member"), search_tools("teamchat topic read export"), search_tools("teamchat messages").
1076
1076
 
1077
1077
  **Rooms:**
1078
1078
  - list_rooms() — list chat rooms the user has access to
@@ -1189,7 +1189,7 @@ Text-to-speech synthesis. Activate via search_tools("ai").
1189
1189
 
1190
1190
  ## Excel export
1191
1191
 
1192
- Create Excel files from raw data. Available via search_tools("workspace").
1192
+ Create Excel files from raw data. Available via search_tools("workspace excel xlsx").
1193
1193
 
1194
1194
  - create_excel(title?, sheets) — create an XLSX file from raw data. sheets: [{ name, headers: ["Col1","Col2"], rows: [["val1","val2"]] }]. File is saved to workspace storage. Returns download link.
1195
1195
 
@@ -1934,7 +1934,7 @@ export const GROUP_ALIASES = {
1934
1934
  * @returns {{matched:Array<object>, groupExact:number, total:number, droppedByGroup:Object<string,number>}}
1935
1935
  */
1936
1936
  export function selectTools(query, catalog, available = () => true) {
1937
- const q = String(query).toLowerCase();
1937
+ const q = String(query || '').toLowerCase();
1938
1938
  const words = q.split(/\s+/).filter(Boolean);
1939
1939
  // Live group catalog — single source of truth, new backend groups appear automatically
1940
1940
  const knownGroups = [...new Set(catalog.map(t => t.group).filter(g => g && g !== 'core'))];
@@ -1952,27 +1952,44 @@ export function selectTools(query, catalog, available = () => true) {
1952
1952
  if (w === g || (minLen >= 4 && (g.startsWith(w) || w.startsWith(g)))) matchedGroups.add(g);
1953
1953
  }
1954
1954
  for (const [alias, group] of Object.entries(GROUP_ALIASES)) {
1955
- if (alias.startsWith(w) || w.startsWith(alias)) {
1955
+ const minLen = Math.min(w.length, alias.length);
1956
+ if (w === alias || (minLen >= 4 && (alias.startsWith(w) || w.startsWith(alias)))) {
1956
1957
  for (const g of Array.isArray(group) ? group : [group]) matchedGroups.add(g);
1957
1958
  }
1958
1959
  }
1959
1960
  }
1960
1961
 
1962
+ // Счёт релевантности: стем слова (первые 5 символов — против русской
1963
+ // морфологии, см. бэкендовую копию) в имени ×3, в описании ×1;
1964
+ // стабильность — по порядку каталога. Ранжируются и групповые совпадения:
1965
+ // cap 30 честный (total и droppedByGroup сообщают срез), наполнители
1966
+ // группы не вытесняют релевантные тула.
1967
+ const stem = w => (w.length > 5 ? w.slice(0, 5) : w);
1968
+ const ranked = (list) => list
1969
+ .map((t, i) => ({ t, i, s: words.reduce((acc, w) => {
1970
+ const st = stem(w);
1971
+ return acc + (t.name.toLowerCase().includes(st) ? 3 : 0)
1972
+ + ((t.description || '').toLowerCase().includes(st) ? 1 : 0);
1973
+ }, 0) }))
1974
+ .sort((a, b) => b.s - a.s || a.i - b.i)
1975
+ .map(x => x.t);
1976
+
1961
1977
  let matched;
1962
- // Tools that came in because the query NAMED their group. These are exempt from
1963
- // the result cap below: asking for a group and getting an unannounced 30-tool
1964
- // prefix of it makes activation-by-name meaningless — `workspace` is 121 tools,
1965
- // and the prompt names tools that sit past position 30 in every one of them.
1966
- // A vague query is still capped; an explicit group request is honoured in full.
1967
- let groupExact = 0;
1968
1978
  if (matchedGroups.size > 0) {
1969
- matched = allTools.filter(t => available(t) && matchedGroups.has(t.group));
1970
- groupExact = matched.length;
1971
- // Also include tools from other groups where ALL words match
1972
- const groupSet = new Set(matched.map(t => t.name));
1973
- const extra = allTools.filter(t =>
1974
- !groupSet.has(t.name) && available(t) && words.every(w => toolText(t).includes(w)));
1975
- matched = matched.concat(extra);
1979
+ // Квота на группу — только при нескольких названных группах: одна группа
1980
+ // и так ограничена общим cap, и резать её десяткой значило бы отнимать
1981
+ // тула, которые cap и не отрезал бы («организации» — 21 тул orgs).
1982
+ // При нескольких — каждая названная группа отдаёт своих лучших, иначе
1983
+ // большая группа вытесняет маленькую (документация: docs=50 съедал
1984
+ // advisor=4 — стемы кириллические против английских описаний).
1985
+ const perGroup = [];
1986
+ for (const g of matchedGroups) {
1987
+ const groupTools = ranked(allTools.filter(t => available(t) && t.group === g));
1988
+ perGroup.push(...(matchedGroups.size > 1 ? groupTools.slice(0, 10) : groupTools));
1989
+ }
1990
+ const groupSet = new Set(perGroup.map(t => t.name));
1991
+ matched = perGroup.concat(ranked(allTools.filter(t =>
1992
+ !groupSet.has(t.name) && available(t) && words.every(w => toolText(t).includes(w)))));
1976
1993
  } else {
1977
1994
  // Fallback A: strict AND — all words must appear in name+description+group
1978
1995
  matched = allTools.filter(t => available(t) && words.every(w => toolText(t).includes(w)));
@@ -2007,13 +2024,12 @@ export function selectTools(query, catalog, available = () => true) {
2007
2024
  }
2008
2025
  }
2009
2026
 
2010
- // Cap at 30 — but SAY SO. Six groups are larger than the cap (`workspace` is
2011
- // 121 tools), so activating one by name used to answer "Activated 30 tools: …"
2012
- // and drop the rest without a word. The model read that as the whole group and
2013
- // called a tool it had never been given. A cap is right — dumping 121 defs into
2014
- // the tool list is worse — but a silent one turns absence into a lie.
2027
+ // Cap 30 для ЛЮБОГО запроса, включая точное имя группы. Прежнее изъятие
2028
+ // («группа по имени активируется целиком») активировало 121 тул workspace —
2029
+ // это и есть срыв «<80 имён» (TD-167). Срез честный: total и droppedByGroup
2030
+ // сообщают, сколько и кого отрезано.
2015
2031
  const RESULT_CAP = 30;
2016
- const keep = Math.max(RESULT_CAP, groupExact);
2032
+ const keep = RESULT_CAP;
2017
2033
  const totalMatched = matched.length;
2018
2034
  const droppedByGroup = {};
2019
2035
  if (totalMatched > keep) {
@@ -2024,7 +2040,7 @@ export function selectTools(query, catalog, available = () => true) {
2024
2040
  }
2025
2041
  matched = matched.slice(0, keep);
2026
2042
 
2027
- return { matched, groupExact, total: totalMatched, droppedByGroup, knownGroups, words, RESULT_CAP };
2043
+ return { matched, groupExact: matchedGroups.size > 0 ? totalMatched : 0, total: totalMatched, droppedByGroup, knownGroups, words, RESULT_CAP };
2028
2044
  }
2029
2045
  }
2030
2046
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integram-mcp",
3
- "version": "0.7.40",
3
+ "version": "0.7.44",
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",