@pipeshub-ai/mcp 2.2.0 → 2.3.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.
Files changed (107) hide show
  1. package/README.md +2 -0
  2. package/bin/mcp-server.js +648 -175
  3. package/bin/mcp-server.js.map +17 -11
  4. package/bin/pipeshub.js +946 -0
  5. package/bin/pipeshub.js.map +14 -0
  6. package/esm/cli/client.d.ts +54 -0
  7. package/esm/cli/client.d.ts.map +1 -0
  8. package/esm/cli/client.js +230 -0
  9. package/esm/cli/client.js.map +1 -0
  10. package/esm/cli/commands.d.ts +30 -0
  11. package/esm/cli/commands.d.ts.map +1 -0
  12. package/esm/cli/commands.js +321 -0
  13. package/esm/cli/commands.js.map +1 -0
  14. package/esm/cli/config.d.ts +73 -0
  15. package/esm/cli/config.d.ts.map +1 -0
  16. package/esm/cli/config.js +218 -0
  17. package/esm/cli/config.js.map +1 -0
  18. package/esm/cli/init-qm.d.ts +11 -0
  19. package/esm/cli/init-qm.d.ts.map +1 -0
  20. package/esm/cli/init-qm.js +170 -0
  21. package/esm/cli/init-qm.js.map +1 -0
  22. package/esm/cli/pipeshub.d.ts +2 -0
  23. package/esm/cli/pipeshub.d.ts.map +1 -0
  24. package/esm/cli/pipeshub.js +296 -0
  25. package/esm/cli/pipeshub.js.map +1 -0
  26. package/esm/funcs/connectorLookupRecordByIdentifier.d.ts +68 -0
  27. package/esm/funcs/connectorLookupRecordByIdentifier.d.ts.map +1 -0
  28. package/esm/funcs/connectorLookupRecordByIdentifier.js +138 -0
  29. package/esm/funcs/connectorLookupRecordByIdentifier.js.map +1 -0
  30. package/esm/funcs/connectorNavigateKnowledgeGraph.d.ts +75 -0
  31. package/esm/funcs/connectorNavigateKnowledgeGraph.d.ts.map +1 -0
  32. package/esm/funcs/connectorNavigateKnowledgeGraph.js +152 -0
  33. package/esm/funcs/connectorNavigateKnowledgeGraph.js.map +1 -0
  34. package/esm/lib/base64.d.ts +1 -1
  35. package/esm/lib/base64.d.ts.map +1 -1
  36. package/esm/lib/base64.js +6 -3
  37. package/esm/lib/base64.js.map +1 -1
  38. package/esm/lib/bytes-to-base64.d.ts +16 -0
  39. package/esm/lib/bytes-to-base64.d.ts.map +1 -0
  40. package/esm/lib/bytes-to-base64.js +23 -0
  41. package/esm/lib/bytes-to-base64.js.map +1 -0
  42. package/esm/mcp-server/instructions.d.ts +1 -1
  43. package/esm/mcp-server/instructions.d.ts.map +1 -1
  44. package/esm/mcp-server/instructions.js +30 -0
  45. package/esm/mcp-server/instructions.js.map +1 -1
  46. package/esm/mcp-server/shared.d.ts +2 -2
  47. package/esm/mcp-server/shared.d.ts.map +1 -1
  48. package/esm/mcp-server/shared.js +7 -3
  49. package/esm/mcp-server/shared.js.map +1 -1
  50. package/esm/mcp-server/tools/_agui.d.ts +34 -0
  51. package/esm/mcp-server/tools/_agui.d.ts.map +1 -0
  52. package/esm/mcp-server/tools/_agui.js +91 -0
  53. package/esm/mcp-server/tools/_agui.js.map +1 -0
  54. package/esm/mcp-server/tools/_helpers.d.ts.map +1 -1
  55. package/esm/mcp-server/tools/_helpers.js +13 -6
  56. package/esm/mcp-server/tools/_helpers.js.map +1 -1
  57. package/esm/mcp-server/tools/pipeshubChat.d.ts +0 -3
  58. package/esm/mcp-server/tools/pipeshubChat.d.ts.map +1 -1
  59. package/esm/mcp-server/tools/pipeshubChat.js +75 -98
  60. package/esm/mcp-server/tools/pipeshubChat.js.map +1 -1
  61. package/esm/mcp-server/tools/pipeshubGetRecordContent.d.ts +118 -1
  62. package/esm/mcp-server/tools/pipeshubGetRecordContent.d.ts.map +1 -1
  63. package/esm/mcp-server/tools/pipeshubGetRecordContent.js +180 -29
  64. package/esm/mcp-server/tools/pipeshubGetRecordContent.js.map +1 -1
  65. package/esm/mcp-server/tools/pipeshubSearch.d.ts.map +1 -1
  66. package/esm/mcp-server/tools/pipeshubSearch.js +14 -1
  67. package/esm/mcp-server/tools/pipeshubSearch.js.map +1 -1
  68. package/esm/models/availablemodelsresponse.d.ts +1 -1
  69. package/esm/models/conversation.d.ts +1 -1
  70. package/esm/models/lookuprecordbyidentifierop.d.ts +7 -0
  71. package/esm/models/lookuprecordbyidentifierop.d.ts.map +1 -0
  72. package/esm/models/lookuprecordbyidentifierop.js +14 -0
  73. package/esm/models/lookuprecordbyidentifierop.js.map +1 -0
  74. package/esm/models/navigateknowledgegraphop.d.ts +14 -0
  75. package/esm/models/navigateknowledgegraphop.d.ts.map +1 -0
  76. package/esm/models/navigateknowledgegraphop.js +25 -0
  77. package/esm/models/navigateknowledgegraphop.js.map +1 -0
  78. package/esm/models/userteamsresponse.d.ts +1 -1
  79. package/esm/tool-names.js +3 -3
  80. package/esm/tool-names.js.map +1 -1
  81. package/package.json +3 -2
  82. package/qm/README.md +247 -0
  83. package/qm/SECURITY.md +134 -0
  84. package/qm/TROUBLESHOOTING.md +218 -0
  85. package/qm/qm.config.fragment.jsonc +42 -0
  86. package/qm/sandbox/Dockerfile +22 -0
  87. package/qm/sandbox/skills/pipeshub/SKILL.md +69 -0
  88. package/qm/sandbox/tools/pipeshub/tool.json +36 -0
  89. package/src/cli/client.ts +272 -0
  90. package/src/cli/commands.ts +403 -0
  91. package/src/cli/config.ts +229 -0
  92. package/src/cli/init-qm.ts +215 -0
  93. package/src/cli/pipeshub.ts +333 -0
  94. package/src/funcs/connectorLookupRecordByIdentifier.ts +200 -0
  95. package/src/funcs/connectorNavigateKnowledgeGraph.ts +215 -0
  96. package/src/lib/base64.ts +6 -3
  97. package/src/lib/bytes-to-base64.ts +24 -0
  98. package/src/mcp-server/instructions.ts +30 -0
  99. package/src/mcp-server/shared.ts +7 -3
  100. package/src/mcp-server/tools/_agui.ts +138 -0
  101. package/src/mcp-server/tools/_helpers.ts +13 -6
  102. package/src/mcp-server/tools/pipeshubChat.ts +78 -97
  103. package/src/mcp-server/tools/pipeshubGetRecordContent.ts +213 -29
  104. package/src/mcp-server/tools/pipeshubSearch.ts +14 -1
  105. package/src/models/lookuprecordbyidentifierop.ts +26 -0
  106. package/src/models/navigateknowledgegraphop.ts +56 -0
  107. package/src/tool-names.ts +3 -3
package/src/tool-names.ts CHANGED
@@ -6,11 +6,11 @@ export const toolNames: Array<{ name: string; description: string }>= [
6
6
  },
7
7
  {
8
8
  "name": "pipeshub_chat",
9
- "description": "**Primary chat toolhandles both internal knowledge queries and web search.**\n\n**Internal search** (default, `chatMode: \"internal_search\"`): Use whenever\nthe user asks about their documents, files, knowledge base, company policies,\nor anything that could plausibly be answered by content in their PipesHub-indexed\nsources (Drive, Box, Confluence, Slack, Gmail, Jira, the org's KB, ...).\nGrounds the answer in the user's actual data and returns citations.\nAnswers come from a few retrieved passages, not whole documents for\nany task needing a document's full content, use\n`pipeshub_get_record_content` instead.\n\n**Web search** (`chatMode: \"web_search\"`): Use when the user asks about\ncurrent events, public information, or anything unlikely to be in the org's\ninternal knowledge base. Pass `chatMode: \"web_search\"` and this tool will\nsearch the public web instead.\n\n**When to pick this over other tools:**\n- \"Summarize <doc>\" / \"key points of <doc>\" / \"what does <document> say\n about X?\" NOT this tool. Use `pipeshub_search` →\n `pipeshub_get_record_content`: answering for a specific document\n requires its full content, and chat only sees a few retrieved\n passages, never the whole document.\n- \"What's our policy on Y?\" → `pipeshub_chat` (internal_search)\n- \"What's in the news about Z?\" → `pipeshub_chat` (web_search)\n- \"What is the latest version of <library>?\" → `pipeshub_chat` (web_search)\n- \"Find / locate the file named X\" → `pipeshub_search` (then\n `pipeshub_download_record` if the user wants the bytes).\n\n**Conversation lifecycle** — one tool, both start and continue:\n\n- **First turn**: omit `conversationId`. The server creates a new\n conversation; capture `conversationId` from the response.\n- **Follow-up turn**: pass the `conversationId` from the previous\n response. Server-side context is preserved — do NOT replay earlier\n messages, and `filters` is ignored on follow-ups (set once at\n creation).\n\nOnly re-omit `conversationId` (start a fresh conversation) when the\nuser explicitly asks to start over / clear context.\n\nThe response contains the AI's `answer` plus `citations`. To download a\ncited document, take `citations[*].recordId` and call\n`pipeshub_download_record`."
9
+ "description": "Ask a question, get an answer grounded in the org's indexed data with\ncitations. It reads a few retrieved passages never a whole document,\nnever a complete list.\n\n**Three questions this tool gets WRONG. Check them first:**\n- **Structure** \"what's under this epic?\", \"which pages are in this\n space?\", \"what links to this ticket?\", \"what's in this folder?\" →\n `pipeshub_get_record_content` `mode:\"navigate\"`. Ranking cannot see how\n records relate.\n- **Exhaustive** \"how many X?\", \"list ALL the Y\", \"every Z\" →\n `mode:\"navigate\"`, which reports the group's real total. This tool\n undercounts and will not say so.\n- **One named document** summarize it, extract from it, what does it say\n about X → `pipeshub_search` for the `recordId`, then `mode:\"content\"`.\n\nEverything else about the org's knowledge belongs here: policies,\nprocesses, decisions, history, \"what do we know about X\", and any question\nspanning several documents.\n\n**Internal search** (default, `chatMode: \"internal_search\"`): the user's\ndocuments, files, knowledge base, company policies anything in their\nPipesHub-indexed sources (Drive, Box, Confluence, Slack, Gmail, Jira, the\norg's KB, ...).\n\n**Web search** (`chatMode: \"web_search\"`): current events or public\ninformation unlikely to be in the org's knowledge base.\n\nBoth are plain-chat modes. **Agent chat** pass an `agentId` from\n`pipeshub_agents` runs against that agent's own prompt, tools and knowledge;\n`quick` is its only mode, requires the `agentId`, and is sent automatically.\n\n- \"What's our policy on Y?\" → `pipeshub_chat` (internal_search)\n- \"What's in the news about Z?\" → `pipeshub_chat` (web_search)\n- \"Find / locate the file named X\" → `pipeshub_search` (then\n `pipeshub_download_record` if the user wants the bytes).\n\n**Conversation lifecycle** — one tool, both start and continue:\n\n- **First turn**: omit `conversationId`. The server creates a new\n conversation; capture `conversationId` from the response.\n- **Follow-up turn**: pass the `conversationId` from the previous\n response. Server-side context is preserved — do NOT replay earlier\n messages, and `filters` is ignored on follow-ups (set once at\n creation).\n\nOnly re-omit `conversationId` (start a fresh conversation) when the\nuser explicitly asks to start over / clear context.\n\nThe response contains the AI's `answer` plus `citations`. To download a\ncited document, take `citations[*].recordId` and call\n`pipeshub_download_record`."
10
10
  },
11
11
  {
12
12
  "name": "pipeshub_search",
13
- "description": "Vector / semantic search across the org's indexed documents.\n\n**Use this when the user wants to LOCATE a document** — by name, topic,\nor a phrase to grep for — and to resolve it to a `recordId`. For\nopen-ended questions across many documents, use `pipeshub_chat`\ninstead, which does the retrieval internally and grounds the answer in\ncitations.\n\nTypical uses:\n- Resolve a doc name / topic into a `recordId` for\n `pipeshub_get_record_content` — step 1 of any full-document task\n (summarize, extract, review, \"what does the doc say?\").\n- Resolve a filename / phrase into a `recordId` for\n `pipeshub_download_record`.\n- Show the user a ranked list of matching files when they ask \"find /\n search for X\".\n\nThe response is trimmed to one row per hit:\n`{ recordId, recordName, score, snippet, mimeType, webUrl, ... }`.\nHighest `score` first; multiple hits may share the same `recordId`\n(different chunks of the same record)."
13
+ "description": "Vector / semantic search across the org's indexed documents.\n\n**Use this when the user wants to LOCATE a document** — by name, topic,\nor a phrase to grep for — and to resolve it to a `recordId`. For\nopen-ended questions across many documents, use `pipeshub_chat`\ninstead, which does the retrieval internally and grounds the answer in\ncitations.\n\nTypical uses:\n- Resolve a doc name / topic into a `recordId` for\n `pipeshub_get_record_content` — step 1 of any full-document task\n (summarize, extract, review, \"what does the doc say?\").\n- Resolve a filename / phrase into a `recordId` for\n `pipeshub_download_record`.\n- Show the user a ranked list of matching files when they ask \"find /\n search for X\".\n\nNot for structural questions — what is under this epic, which pages are\nin this space, what links to this ticket. Ranking by content cannot show\nhow records relate; use `pipeshub_get_record_content` `mode:\"navigate\"`.\n\n**A ranked sample, never a complete list.** Hits are the top-scoring\nblocks from the best-matching records — not all blocks of any record, and\nnot every record that matches. Never count them to answer \"how many\" /\n\"all\" / \"every\"; navigate the record group instead, which reports its\nreal total.\n\nThe response is trimmed to one row per hit:\n`{ recordId, recordName, score, snippet, mimeType, webUrl, ... }`.\nHighest `score` first; multiple hits may share the same `recordId`\n(different blocks of the same record).\n\nWhen presenting results to the user, link each record using its\n`webUrl` (when present)."
14
14
  },
15
15
  {
16
16
  "name": "pipeshub_download_record",
@@ -18,7 +18,7 @@ export const toolNames: Array<{ name: string; description: string }>= [
18
18
  },
19
19
  {
20
20
  "name": "pipeshub_get_record_content",
21
- "description": "Read a record's full parsed content by `recordId` — the only way to\nsee a document's COMPLETE text.\n\nUse it whenever the answer depends on a document's full content any\ntask where missing a part could make the answer wrong: summarize / key\npoints / action items; extract or list ALL of something; check whether\nor where the doc mentions X; translate, rewrite, outline, or review the\ndoc; compare named docs (fetch each); any question scoped to one named\ndocument. `pipeshub_chat` cannot do these — it only sees a few\nretrieved passages, never the whole document. Get the `recordId` from\na `pipeshub_search` top hit or a chat citation.\n\nJudge by the user's INTENT, not their keywords: they need not say\n\"summarize\", \"key points\", or \"extract\". Reason about what a good\nanswer requires if it would need the whole document (e.g. \"what's\nthis doc about?\", \"walk me through the report\", \"anything in here\nabout Y?\"), that is a full-content task, so call this tool.\n\nReturns a single `content` string: a short metadata header (title,\nsource, key fields, and a pre-generated summary) followed by the\nrecord's full parsed text paragraphs, tables, and lists in reading\norder. For a record with no extractable content, `content` is the\nliteral `No record found`. Use `pipeshub_download_record` only when\nyou need the original file bytes."
21
+ "description": "Three operations on the org's records. Pick by what you hold:\n\n `mode:\"lookup\"` — a URL, issue key (PA-1787), or external ID\n → its recordId plus the record's metadata\n `mode:\"navigate\"`a question about structure: what is under X,\n what links to Y → browses the hierarchy\n `mode:\"content\"` — a recordId, and you need the document's COMPLETE text\n\n**`mode:\"content\"` (default)** the only way to see a document's complete\ntext. Use it whenever missing part of the document could make the answer\nwrong: summarize, extract or list ALL of something, check whether or where\na doc mentions X, review, or compare named docs. `pipeshub_chat` cannot do\nthese — it never sees a whole document.\n\nJudge by the user's INTENT, not their keywords: \"what's this doc about?\",\n\"walk me through the report\", \"anything in here about Y?\" are all\nfull-content tasks. Get the `recordId` from a `pipeshub_search` top hit, a\nchat citation, or `mode:\"lookup\"`.\n\nReturns one `content` string: a metadata header (title, source, key fields,\npre-generated summary) then the full parsed text. A record with no\nextractable content returns the literal `No record found`. Use\n`pipeshub_download_record` only for the original file bytes.\n\n**`mode:\"navigate\"`** browse the hierarchy: RecordGroup (project /\nspace / drive / folder) → Record (epic / story / page / file) → children,\nwith breadcrumbs, related links and record IDs.\n\nUse it when the question depends on structure rather than wording: what is\nunder this epic, which pages sit in this space, what is linked to this\nticket, what is in this folder — and every \"how many\" / \"all of\" / \"every\"\nquestion. Search ranks by content; only this shows how records relate, and\nonly this gives a count you can trust.\n\nOmit `nodeId` for a flat listing of everything reachable, most recently\nupdated first — the usual starting point. A URL, an issue key, or a\n`pipeshub_sources` id also works and resolves automatically.\n\nPass `depth:2` or `depth:3` to see several levels in ONE call — an epic's\nstories AND their subtasks, a space's pages AND their children — instead of\none call per level. Use it whenever the question needs an overview of a\nhierarchy rather than a single node.\n\nOpening a record also prints that record's own metadata — for a ticket,\nstatus, assignee, priority and dates — so a question about one record is\noften answered by this call alone. It returns no document text; for that,\nre-call with `mode:\"content\"`.\n\nReturns `Path` breadcrumbs, the current node's metadata, a children listing\ncarrying `record_id=` or `node_id=` per row plus the group's total\n(`Children 1-50 of 61`), `Related` cross-references, and a `Next:` line.\nOne page is usually every child, so only pass `page:2` when that `Next:`\nline says more exist.\n\n**`mode:\"lookup\"`** — turn an external reference into a recordId, the first\nstep whenever the question names one. Returns that record's metadata (for a\nticket: status, assignee, priority, dates) plus its recordId, which\n`mode:\"navigate\"` takes to list what is under it and `mode:\"content\"` takes\nto read it.\n\nHandles Jira keys and URLs, Confluence, Drive, Slack permalinks, Linear,\nNotion, ServiceNow sys_id, SharePoint, Gmail/Outlook, and any connector\nwhose records index a web URL. Resolution searches ALL connectors you can\naccess, regardless of any source filter you used elsewhere.\n\nA miss is a 200 with empty `matches` and the input echoed in\n`not_found_identifiers` — that may mean no-access, not non-existence. Use\n`mode:\"navigate\"` to confirm the record exists before telling the user it\ndoes not. If `ambiguous` is true, pick from `matches` rather than taking\nthe first.\n\nNavigate and lookup return a rendered text view whose closing `Next:` line\nnames the exact follow-up call — follow it. When presenting a record, link\nit using the `Web URL` from its metadata header (when present)."
22
22
  },
23
23
  {
24
24
  "name": "pipeshub_directory",