integram-mcp 0.5.1 → 0.6.1

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 (2) hide show
  1. package/index.js +15 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -152,7 +152,7 @@ Only core tools (~15: CRUD, search, graph, comments, bulk, history) are loaded b
152
152
  - "reports" — create, run, export reports with aggregation, joins and filters (~15 tools)
153
153
  - "docs" — documents, blocks, folders, tags, sharing, versions, templates, PDF generation (~38 tools)
154
154
  - "workspace" — files, import/export, connectors, members, backups, dashboards, view/record sharing, audit log, normalizer, automations, webhooks, forms (~80 tools)
155
- - "portal" — portal config, catalog, carts, orders, tickets, KB articles, metrics, customer profiles, Telegram bots (~42 tools)
155
+ - "portal" — portal config, catalog, carts, orders, tickets, KB articles, metrics, customer profiles, Telegram bots, @kit component catalog (~45 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
158
  - "codespace" — git repositories: branches, commits, files, pull requests, conflict-safe writes (~22 tools)
@@ -595,8 +595,9 @@ Event-driven rules: when X happens → check condition → do Y. Activate via se
595
595
 
596
596
  create_automation({ name, trigger: { type, typeId }, condition, actions: [{ type, config }] })
597
597
  - Trigger types: on_create, on_update, on_delete, on_deadline, on_webhook, on_form_submit, schedule, manual, ai_analysis, on_metric_threshold, on_metric_silence, on_document, on_telegram_command, on_telegram_message, on_telegram_pre_checkout, on_telegram_shipping, on_telegram_payment, on_telegram_inline, on_telegram_join_request, on_telegram_business_connection, on_telegram_business_message, on_bot_chat_member
598
- - Actions: send_notification, send_notification_to_group, update_field, create_object, delete_object, fire_webhook, run_ai_agent, run_script, 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
598
+ - 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
599
599
  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)
600
+ 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}}.
600
601
  send_notification_to_group: { typeId, usernameReqId, title, body, filter?: { reqId, val } } — notifies all members of a table whose usernameReqId field is a valid Integram username; optional filter restricts to members where reqId==val (e.g. role filter)
601
602
  - list_automations, get_automation (single), update_automation, delete_automation, trigger_automation (manual run), get_automation_runs (execution log)
602
603
 
@@ -757,6 +758,18 @@ Client-facing portal management. Activate via search_tools("portal").
757
758
  - get_portal_client_role(customerId) — role, grants, allowed pages
758
759
 
759
760
  **Custom Code:**
761
+ - Before writing data reading or the markup of a portal section, call kit_list_components — the @kit library already has reading with a completeness proof, EAV value recovery and the three absence states. Don't reinvent them.
762
+ - kit_list_components(version?, kind?, search?) — catalog of @kit building blocks: name, kind, one-line summary, module. Generated from the library sources at build time, so it cannot drift from the code. An empty list means an empty filter; a missing catalog comes back as a refusal (KIT_NOT_DEPLOYED / KIT_VERSION_NOT_FOUND / KIT_CATALOG_MISSING / KIT_CATALOG_BROKEN).
763
+ - kit_get_component(name, version?) — one entry in detail: module, kind, summary, props, slots and uiKeys for components. Unknown name → refusal listing similar names.
764
+ - Styling a @kit widget: never invent class names or token names. Node classes go in through the \`ui\` prop — a map of node key to your classes, e.g. \`<DataTable :ui="{ row: 'my-row' }" />\`; the keys are \`uiKeys\` from kit_get_component, your classes are APPENDED to the widget's own, and a key outside that list does not exist (the widget refuses it and warns in the console). Token names come from kit_get_tokens. A widget with no uiKeys field takes no \`ui\` prop at all — either it is headless, or the deployed version predates the prop.
765
+ - kit_get_tokens(version?, kind?, component?) — the styling contract: every CSS variable the @kit widgets read (colour, spacing, radius, font, motion) plus the stable class names of each widget. Call it BEFORE writing any style for a @kit widget. A name that is not in this dictionary does not exist: it resolves to nothing, and the section comes out structurally correct, with correct ARIA, and completely unstyled — behavioural tests will not catch it, only looking at the rendered page will. Never invent a token name, never guess a prefix. Each token ships a ready \`usage\` string, e.g. \`var(--kit-color-text, var(--color-text, #1f2328))\` — write it whole, fallback included, because the middle link is the portal shell's own token and that is what makes the widget inherit the portal theme. Refusals: KIT_TOKENS_MISSING (versions up to 0.4.0 carry no dictionary), KIT_NO_STYLING (headless widget, nothing to style).
766
+ - The \`classes\` field of that answer is a contract too: those class names are safe to hook your own styles and animations onto. Everything else inside a widget is behind scoped styles and may change.
767
+ - kit_list_versions() — which versions of @kit are deployed, plus \`latest\`. Ordering is numeric, so 0.1.10 is newer than 0.1.2.
768
+ - The version a portal uses is set by the \`kit\` field in the custom_code module config, not in component code. Omit \`version\` and the catalog answers for the latest deployed one.
769
+ - Reading rule: never build a portal API URL by hand. \`readAll(source, {db})\` takes \`type:id\` — the registry knows the path, the page ceiling and how that route proves the end of data. Seven incompatible pagination contracts exist across portal routes; the library hides all of them behind one answer \`{items, total, complete, reason}\`.
770
+ - \`total\` may be \`null\` — most routes never state a grand total. Print "N of M" only when \`total\` is a number, and raise the alarm on \`complete === false\`, not on a non-empty \`reason\`: reason is also filled on healthy reads.
771
+ - \`doc\` and \`record\` are single entities, not lists — read them with \`fetchOne\`, and note \`record\` is keyed by slug, not by a number.
772
+ - Widgets take ready data, not ids: \`DataTable\` gets \`rows\`, and \`Source\` (or \`fetchOne\`) does the reading. \`AiPanel\` is the exception — it owns its own SSE stream against /agent/run.
760
773
  - commit_portal_component(repo, file, code, message?, branch?) — commit Vue SFC to codespace repo for custom_code module. Repo is auto-created if it doesn't exist.
761
774
 
762
775
  **Telegram Bots:**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "integram-mcp",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
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",