integram-mcp 0.7.111 → 0.7.112

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 +18 -8
  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.111
18
+ -- npx -y integram-mcp@0.7.112
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.111
46
+ -- npx -y integram-mcp@0.7.112
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.111"],
60
+ "args": ["-y", "integram-mcp@0.7.112"],
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.111"],
80
+ "args": ["-y", "integram-mcp@0.7.112"],
81
81
  "env": {
82
82
  "INTEGRAM_URL": "https://ai2o.online",
83
83
  "INTEGRAM_EMAIL": "you@example.com",
package/index.js CHANGED
@@ -760,7 +760,7 @@ Role-based access control. Activate via search_tools("permissions").
760
760
  - list_members — all workspace users with roles. Returns { items:[{userId,email,name,username,role,roleId,roleName,lastSeenAt}], total }; lastSeenAt is the member's last visit to this workspace (null if never). It is throttled to 5-minute granularity, so treat it as "last seen within ~5 min", not an exact timestamp
761
761
  - list_roles — all roles and their access levels per table
762
762
  - get_user_permissions(username or userId) — what a specific user can access
763
- - set_grant(roleId or username, targetTypeId, level) — level: NONE/READ/WRITE/ADMIN. targetTypeId=0 = all tables.
763
+ - set_grant(roleId or username, targetTypeId, level) — level: NONE/READ/WRITE/ADMIN; NONE = deny row that overrides the role grant; revoking a grant is remove_grant. targetTypeId=0 = all tables.
764
764
  Optional: canExport (allow CSV export), canDelete (allow record deletion)
765
765
  - remove_grant — revoke access
766
766
 
@@ -1750,7 +1750,7 @@ export const EN_DESCRIPTIONS = {
1750
1750
  list_roles: 'Show all roles and their access rights to object types (READ/WRITE/ADMIN). Use for "what roles exist", "role permissions", "what can an editor do" (admin only). Returns: { items:[{id,name}], total }.',
1751
1751
  get_user_permissions: 'Show all permissions of a specific user — which objects and at what level (READ/WRITE/ADMIN), whether they can export and delete (admin only).',
1752
1752
  get_permissions_report: 'Permissions matrix: users, roles, grants on object types (admin only).',
1753
- set_grant: 'Grant or change access of a role or user to an object type (requires confirmation). level: NONE/READ/WRITE/ADMIN. targetTypeId=0 means all types (admin only). NOT for portal settings: portal config — set_portal_config.',
1753
+ set_grant: 'Grant or change access of a role or user to an object type (requires confirmation). level: NONE/READ/WRITE/ADMIN; NONE writes a DENY row (overrides the role grant for that targetTypeId) — to revoke a grant entirely use remove_grant. targetTypeId=0 means all types (admin only). NOT for portal settings: portal config — set_portal_config.',
1754
1754
  remove_grant: 'Revoke access of a role or user to an object type (requires confirmation, admin only).',
1755
1755
  list_grants: 'List all workspace grants from the _v2_grants table. Filter by roleId or username. Returns: { items:[{id, role_id, username, target_type_id, level, can_export, can_delete}], total }.',
1756
1756
  // Roles
@@ -2353,6 +2353,7 @@ async function dispatchTool(request) {
2353
2353
  threadId: result.threadId,
2354
2354
  action: name,
2355
2355
  description: result.message || `Pending: ${name}`,
2356
+ workspace,
2356
2357
  createdAt: now,
2357
2358
  }, { now, ttlMs: HITL_QUEUE_TTL_MS, maxSize: HITL_QUEUE_MAX_SIZE });
2358
2359
  return {
@@ -2451,16 +2452,25 @@ async function handleConfirmAction(approved, confirmId) {
2451
2452
  let data;
2452
2453
  try {
2453
2454
  await ensureAuth();
2454
- data = await apiFetch(`/api/v2/${workspace}/ai/mcp-resume`, {
2455
+ // Резюм по воркспейсу, где ожидание создано: после switch_workspace
2456
+ // сессионный воркспейс промахнулся бы по scope (takeAndDeletePendingHitl
2457
+ // фильтрует по workspace_db) — 404 при живом, исполнимом действии.
2458
+ data = await apiFetch(`/api/v2/${pending.workspace || workspace}/ai/mcp-resume`, {
2455
2459
  method: 'POST',
2456
2460
  body: JSON.stringify({ threadId: pending.threadId, approved }),
2457
2461
  });
2458
2462
  } catch (resumeErr) {
2459
- // TD-065: раньше отказ /mcp-resume читался как текст успеха.
2460
- // Issue #256: отказ сети/бэкенда возвращает ожидание в очередь —
2461
- // confirmId остаётся живым, повторный confirm даёт внятный ответ
2462
- // (включая 404, когда бэкенд уже списал pending), а не потерю действия.
2463
- enqueuePending(pendingHitlQueue, pending, { ttlMs: HITL_QUEUE_TTL_MS, maxSize: HITL_QUEUE_MAX_SIZE });
2463
+ // Issue #256: отказ сети/бэкенда возвращает ожидание в очередь.
2464
+ // КРОМЕ 404 NOT_FOUND: бэкенд списывает pending ДО исполнения
2465
+ // (ai/router.js:1336, атомарный DELETE … RETURNING) — это ответ
2466
+ // idempotency-ключа «уже обработано». Re-enqueue здесь давал залипание:
2467
+ // каждый следующий confirm по этому id снова 404 и снова в очередь,
2468
+ // до TTL. DB_NOT_FOUND (воркспейс не найден) — транзиентный, остаётся.
2469
+ const consumed = resumeErr?.status === 404
2470
+ && resumeErr?.body?.error?.code === 'NOT_FOUND';
2471
+ if (!consumed) {
2472
+ enqueuePending(pendingHitlQueue, pending, { ttlMs: HITL_QUEUE_TTL_MS, maxSize: HITL_QUEUE_MAX_SIZE });
2473
+ }
2464
2474
  return toolErrorResult(resumeErr);
2465
2475
  }
2466
2476
  msg = data.data?.message || (approved ? 'Action confirmed and executed.' : 'Action rejected.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integram-mcp",
3
- "version": "0.7.111",
3
+ "version": "0.7.112",
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",