@pipeshub-ai/mcp 2.3.3 → 2.4.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.
- package/README.md +2 -2
- package/bin/mcp-server.js +328 -210
- package/bin/mcp-server.js.map +12 -12
- package/bin/pipeshub.js +16 -8
- package/bin/pipeshub.js.map +4 -4
- package/esm/cli/commands.d.ts +1 -1
- package/esm/cli/commands.d.ts.map +1 -1
- package/esm/cli/commands.js +4 -1
- package/esm/cli/commands.js.map +1 -1
- package/esm/cli/pipeshub.js +13 -6
- package/esm/cli/pipeshub.js.map +1 -1
- package/esm/mcp-server/instructions.d.ts +1 -1
- package/esm/mcp-server/instructions.d.ts.map +1 -1
- package/esm/mcp-server/instructions.js +9 -6
- package/esm/mcp-server/instructions.js.map +1 -1
- package/esm/mcp-server/tools/_helpers.d.ts +76 -0
- package/esm/mcp-server/tools/_helpers.d.ts.map +1 -1
- package/esm/mcp-server/tools/_helpers.js +151 -0
- package/esm/mcp-server/tools/_helpers.js.map +1 -1
- package/esm/mcp-server/tools/pipeshubChat.d.ts.map +1 -1
- package/esm/mcp-server/tools/pipeshubChat.js +25 -11
- package/esm/mcp-server/tools/pipeshubChat.js.map +1 -1
- package/esm/mcp-server/tools/pipeshubDownloadRecord.d.ts.map +1 -1
- package/esm/mcp-server/tools/pipeshubDownloadRecord.js +15 -12
- package/esm/mcp-server/tools/pipeshubDownloadRecord.js.map +1 -1
- package/esm/mcp-server/tools/pipeshubSearch.d.ts +1 -0
- package/esm/mcp-server/tools/pipeshubSearch.d.ts.map +1 -1
- package/esm/mcp-server/tools/pipeshubSearch.js +22 -13
- package/esm/mcp-server/tools/pipeshubSearch.js.map +1 -1
- package/esm/mcp-server/tools/pipeshubSources.d.ts.map +1 -1
- package/esm/mcp-server/tools/pipeshubSources.js +15 -27
- package/esm/mcp-server/tools/pipeshubSources.js.map +1 -1
- package/esm/tool-names.js +3 -3
- package/esm/tool-names.js.map +1 -1
- package/package.json +1 -1
- package/qm/sandbox/Dockerfile +1 -1
- package/qm/sandbox/skills/pipeshub/SKILL.md +1 -0
- package/src/cli/commands.ts +3 -0
- package/src/cli/pipeshub.ts +12 -6
- package/src/mcp-server/instructions.ts +9 -6
- package/src/mcp-server/tools/_helpers.ts +233 -0
- package/src/mcp-server/tools/pipeshubChat.ts +31 -10
- package/src/mcp-server/tools/pipeshubDownloadRecord.ts +15 -12
- package/src/mcp-server/tools/pipeshubSearch.ts +38 -13
- package/src/mcp-server/tools/pipeshubSources.ts +18 -25
- package/src/tool-names.ts +3 -3
package/bin/mcp-server.js
CHANGED
|
@@ -50441,10 +50441,12 @@ the user can verify.
|
|
|
50441
50441
|
- \`pipeshub_search\` — locate a document by name or topic and resolve it
|
|
50442
50442
|
to a \`recordId\`. To read or summarize one specific document, search,
|
|
50443
50443
|
then pass the top hit's \`recordId\` to \`pipeshub_get_record_content\`.
|
|
50444
|
-
- \`pipeshub_download_record\` — when the user wants the
|
|
50445
|
-
|
|
50446
|
-
|
|
50447
|
-
\`
|
|
50444
|
+
- \`pipeshub_download_record\` — when the user wants the file as stored
|
|
50445
|
+
(download, attach, open). Never to read or summarize — that is
|
|
50446
|
+
\`pipeshub_get_record_content\` \`mode:"content"\`, which returns
|
|
50447
|
+
parsed text with a metadata header. Get the \`recordId\` from a chat
|
|
50448
|
+
citation or from \`pipeshub_search\`. \`convertTo\` is only
|
|
50449
|
+
\`application/pdf\`.
|
|
50448
50450
|
- \`pipeshub_get_record_content\` — when you need a record's full parsed
|
|
50449
50451
|
content (returned as a single \`content\` string: metadata header plus
|
|
50450
50452
|
the document's text) without downloading the original file. Prefer this
|
|
@@ -50482,8 +50484,9 @@ external ID → \`mode:"lookup"\` FIRST. It returns that record's metadata (for
|
|
|
50482
50484
|
ticket: status, assignee, priority, dates) plus its \`recordId\`, which often
|
|
50483
50485
|
answers the question outright. Never guess a \`recordId\`.
|
|
50484
50486
|
|
|
50485
|
-
|
|
50486
|
-
|
|
50487
|
+
For search, pass a connector id from \`pipeshub_sources\` as \`apps: ["<id>"]\`
|
|
50488
|
+
and a collection id (\`kind: "knowledgeBase"\`) as \`kb: ["<id>"]\`. Any source
|
|
50489
|
+
id works as \`nodeId\` to navigate. Navigate and lookup end in a \`Next:\` line
|
|
50487
50490
|
naming the exact follow-up call — follow it.
|
|
50488
50491
|
|
|
50489
50492
|
## Agents
|
|
@@ -53097,6 +53100,125 @@ var init_agentsListAgents = __esm(() => {
|
|
|
53097
53100
|
init_async();
|
|
53098
53101
|
});
|
|
53099
53102
|
|
|
53103
|
+
// src/models/getknowledgehubrootnodesop.ts
|
|
53104
|
+
var SortOrder$zodSchema, GetKnowledgeHubRootNodesRequest$zodSchema;
|
|
53105
|
+
var init_getknowledgehubrootnodesop = __esm(() => {
|
|
53106
|
+
init_zod();
|
|
53107
|
+
SortOrder$zodSchema = _enum([
|
|
53108
|
+
"asc",
|
|
53109
|
+
"desc"
|
|
53110
|
+
]).describe("Sort order.");
|
|
53111
|
+
GetKnowledgeHubRootNodesRequest$zodSchema = object({
|
|
53112
|
+
connectorIds: string2().describe("Comma-separated connector instance ids to scope to.").optional(),
|
|
53113
|
+
createdAt: string2().describe("Created date range as `gte:<ms>,lte:<ms>`.").optional(),
|
|
53114
|
+
flattened: boolean2().default(false).describe("Return flattened view with all nested children."),
|
|
53115
|
+
include: string2().describe("Comma-separated includes — any of `breadcrumbs`, `counts`,\n`availableFilters`, `permissions`.\n").optional(),
|
|
53116
|
+
indexingStatus: string2().describe("Comma-separated indexing statuses.").optional(),
|
|
53117
|
+
limit: int().default(50).describe("Items per page."),
|
|
53118
|
+
nodeTypes: string2().describe("Comma-separated node types (`app`, `recordGroup`, `folder`, `record`).").optional(),
|
|
53119
|
+
only_containers: boolean2().default(false).describe("Only return nodes with children (for sidebar UIs)."),
|
|
53120
|
+
origins: string2().describe("Comma-separated origins (`COLLECTION`, `CONNECTOR`).").optional(),
|
|
53121
|
+
page: int().default(1).describe("Page number (1-indexed)."),
|
|
53122
|
+
q: string2().describe("Full-text search query against node names.").optional(),
|
|
53123
|
+
recordTypes: string2().describe("Comma-separated record types.").optional(),
|
|
53124
|
+
size: string2().describe("Size range as `gte:<bytes>,lte:<bytes>`.").optional(),
|
|
53125
|
+
sortBy: string2().default("updatedAt").describe("Sort field — one of `name`, `createdAt`, `updatedAt`, `size`, `type`."),
|
|
53126
|
+
sortOrder: SortOrder$zodSchema.default("desc"),
|
|
53127
|
+
updatedAt: string2().describe("Updated date range as `gte:<ms>,lte:<ms>`.").optional()
|
|
53128
|
+
});
|
|
53129
|
+
});
|
|
53130
|
+
|
|
53131
|
+
// src/funcs/knowledgeHubGetKnowledgeHubRootNodes.ts
|
|
53132
|
+
function knowledgeHubGetKnowledgeHubRootNodes(client$, request, options) {
|
|
53133
|
+
return new APIPromise($do6(client$, request, options));
|
|
53134
|
+
}
|
|
53135
|
+
async function $do6(client$, request, options) {
|
|
53136
|
+
const parsed$ = safeParse4(request, (value$) => GetKnowledgeHubRootNodesRequest$zodSchema.optional().parse(value$), "Input validation failed");
|
|
53137
|
+
if (!parsed$.ok) {
|
|
53138
|
+
return [parsed$, { status: "invalid" }];
|
|
53139
|
+
}
|
|
53140
|
+
const payload$ = parsed$.value;
|
|
53141
|
+
const body$ = null;
|
|
53142
|
+
const path$ = pathToFunc("/knowledgeBase/knowledge-hub/nodes")();
|
|
53143
|
+
const query$ = encodeFormQuery({
|
|
53144
|
+
connectorIds: payload$?.connectorIds,
|
|
53145
|
+
createdAt: payload$?.createdAt,
|
|
53146
|
+
flattened: payload$?.flattened,
|
|
53147
|
+
include: payload$?.include,
|
|
53148
|
+
indexingStatus: payload$?.indexingStatus,
|
|
53149
|
+
limit: payload$?.limit,
|
|
53150
|
+
nodeTypes: payload$?.nodeTypes,
|
|
53151
|
+
only_containers: payload$?.only_containers,
|
|
53152
|
+
origins: payload$?.origins,
|
|
53153
|
+
page: payload$?.page,
|
|
53154
|
+
q: payload$?.q,
|
|
53155
|
+
recordTypes: payload$?.recordTypes,
|
|
53156
|
+
size: payload$?.size,
|
|
53157
|
+
sortBy: payload$?.sortBy,
|
|
53158
|
+
sortOrder: payload$?.sortOrder,
|
|
53159
|
+
updatedAt: payload$?.updatedAt
|
|
53160
|
+
});
|
|
53161
|
+
const headers$ = new Headers(compactMap({
|
|
53162
|
+
Accept: "application/json"
|
|
53163
|
+
}));
|
|
53164
|
+
const securityInput = await extractSecurity(client$._options.security);
|
|
53165
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
53166
|
+
const context = {
|
|
53167
|
+
options: client$._options,
|
|
53168
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
53169
|
+
operationID: "getKnowledgeHubRootNodes",
|
|
53170
|
+
oAuth2Scopes: ["kb:read"],
|
|
53171
|
+
resolvedSecurity: requestSecurity,
|
|
53172
|
+
securitySource: client$._options.security,
|
|
53173
|
+
retryConfig: options?.retries || client$._options.retryConfig || { strategy: "none" },
|
|
53174
|
+
retryCodes: options?.retryCodes || [
|
|
53175
|
+
"429",
|
|
53176
|
+
"500",
|
|
53177
|
+
"502",
|
|
53178
|
+
"503",
|
|
53179
|
+
"504"
|
|
53180
|
+
]
|
|
53181
|
+
};
|
|
53182
|
+
const requestRes = client$._createRequest(context, {
|
|
53183
|
+
security: requestSecurity,
|
|
53184
|
+
method: "GET",
|
|
53185
|
+
baseURL: options?.serverURL,
|
|
53186
|
+
path: path$,
|
|
53187
|
+
headers: headers$,
|
|
53188
|
+
query: query$,
|
|
53189
|
+
body: body$,
|
|
53190
|
+
userAgent: client$._options.userAgent,
|
|
53191
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
|
|
53192
|
+
}, options);
|
|
53193
|
+
if (!requestRes.ok) {
|
|
53194
|
+
return [requestRes, { status: "invalid" }];
|
|
53195
|
+
}
|
|
53196
|
+
const req$ = requestRes.value;
|
|
53197
|
+
const doResult = await client$._do(req$, {
|
|
53198
|
+
context,
|
|
53199
|
+
errorCodes: [],
|
|
53200
|
+
retryConfig: context.retryConfig,
|
|
53201
|
+
retryCodes: context.retryCodes
|
|
53202
|
+
});
|
|
53203
|
+
if (!doResult.ok) {
|
|
53204
|
+
return [doResult, { status: "request-error", request: req$ }];
|
|
53205
|
+
}
|
|
53206
|
+
return [doResult, {
|
|
53207
|
+
status: "complete",
|
|
53208
|
+
request: req$,
|
|
53209
|
+
response: doResult.value
|
|
53210
|
+
}];
|
|
53211
|
+
}
|
|
53212
|
+
var init_knowledgeHubGetKnowledgeHubRootNodes = __esm(() => {
|
|
53213
|
+
init_encodings();
|
|
53214
|
+
init_primitives();
|
|
53215
|
+
init_schemas4();
|
|
53216
|
+
init_security2();
|
|
53217
|
+
init_url();
|
|
53218
|
+
init_getknowledgehubrootnodesop();
|
|
53219
|
+
init_async();
|
|
53220
|
+
});
|
|
53221
|
+
|
|
53100
53222
|
// src/mcp-server/tools/_helpers.ts
|
|
53101
53223
|
async function readJson(response, context = "PipesHub request") {
|
|
53102
53224
|
const httpErr = await httpErrorResult(response, context);
|
|
@@ -53409,9 +53531,123 @@ function trimSearchHit(hit) {
|
|
|
53409
53531
|
pageNum: md.pageNum
|
|
53410
53532
|
};
|
|
53411
53533
|
}
|
|
53534
|
+
function toSource(n) {
|
|
53535
|
+
return {
|
|
53536
|
+
id: n?.id,
|
|
53537
|
+
name: n?.name,
|
|
53538
|
+
kind: n?.connector === "KB" ? "knowledgeBase" : "connector",
|
|
53539
|
+
connector: n?.connector,
|
|
53540
|
+
hasChildren: n?.hasChildren
|
|
53541
|
+
};
|
|
53542
|
+
}
|
|
53543
|
+
async function listAllSources(client, opts = {}) {
|
|
53544
|
+
const PAGE_SIZE = 200;
|
|
53545
|
+
const maxPages = opts.maxPages ?? 5;
|
|
53546
|
+
const reqOptions = opts.signal ? { fetchOptions: { signal: opts.signal } } : {};
|
|
53547
|
+
const all = [];
|
|
53548
|
+
for (let page = 1;page <= maxPages; page++) {
|
|
53549
|
+
const [r] = await knowledgeHubGetKnowledgeHubRootNodes(client, {
|
|
53550
|
+
page,
|
|
53551
|
+
limit: PAGE_SIZE
|
|
53552
|
+
}, reqOptions).$inspect();
|
|
53553
|
+
if (!r.ok) {
|
|
53554
|
+
return {
|
|
53555
|
+
ok: false,
|
|
53556
|
+
result: errorResult(`sources: ${r.error.message}`),
|
|
53557
|
+
reason: r.error.message
|
|
53558
|
+
};
|
|
53559
|
+
}
|
|
53560
|
+
const status = r.value.status;
|
|
53561
|
+
const httpOk = r.value.ok;
|
|
53562
|
+
const parsed = await readJson(r.value, "Knowledge base listing");
|
|
53563
|
+
if (!parsed.ok) {
|
|
53564
|
+
return {
|
|
53565
|
+
ok: false,
|
|
53566
|
+
result: parsed.result,
|
|
53567
|
+
reason: httpOk ? "unreadable response" : `HTTP ${status}`
|
|
53568
|
+
};
|
|
53569
|
+
}
|
|
53570
|
+
const items = parsed.value.items ?? [];
|
|
53571
|
+
all.push(...items.map(toSource));
|
|
53572
|
+
const hasNext = parsed.value.pagination?.hasNext ?? items.length >= PAGE_SIZE;
|
|
53573
|
+
if (!hasNext || items.length === 0) {
|
|
53574
|
+
return { ok: true, sources: all, truncated: false };
|
|
53575
|
+
}
|
|
53576
|
+
}
|
|
53577
|
+
return { ok: true, sources: all, truncated: true };
|
|
53578
|
+
}
|
|
53579
|
+
function routeSourceScope(apps, kb, kinds) {
|
|
53580
|
+
const appIds = dedupe(apps ?? []);
|
|
53581
|
+
const kbIds = dedupe(kb ?? []);
|
|
53582
|
+
const movedToKb = appIds.filter((id) => kinds.get(id) === "knowledgeBase");
|
|
53583
|
+
const movedToApps = kbIds.filter((id) => kinds.get(id) === "connector");
|
|
53584
|
+
return {
|
|
53585
|
+
apps: dedupe([
|
|
53586
|
+
...appIds.filter((id) => kinds.get(id) !== "knowledgeBase"),
|
|
53587
|
+
...movedToApps
|
|
53588
|
+
]),
|
|
53589
|
+
kb: dedupe([
|
|
53590
|
+
...movedToKb,
|
|
53591
|
+
...kbIds.filter((id) => kinds.get(id) !== "connector")
|
|
53592
|
+
]),
|
|
53593
|
+
movedToKb,
|
|
53594
|
+
movedToApps
|
|
53595
|
+
};
|
|
53596
|
+
}
|
|
53597
|
+
function searchFilters(scope) {
|
|
53598
|
+
if (scope.apps.length === 0 && scope.kb.length === 0)
|
|
53599
|
+
return;
|
|
53600
|
+
return { apps: scope.apps, kb: scope.kb };
|
|
53601
|
+
}
|
|
53602
|
+
function sourceScopeNotes(input) {
|
|
53603
|
+
const notes = [];
|
|
53604
|
+
if (input.movedToKb.length > 0) {
|
|
53605
|
+
notes.push(`Moved ${input.movedToKb.length} collection id(s) from apps to kb: ` + `${input.movedToKb.join(", ")}. Collection ids belong in kb.`);
|
|
53606
|
+
}
|
|
53607
|
+
if (input.movedToApps.length > 0) {
|
|
53608
|
+
notes.push(`Moved ${input.movedToApps.length} connector id(s) from kb to apps: ` + `${input.movedToApps.join(", ")}. Connector ids belong in apps.`);
|
|
53609
|
+
}
|
|
53610
|
+
if (input.lookupError) {
|
|
53611
|
+
notes.push("Could not check the ids against the source list " + `(${input.lookupError}); sent them unchanged. If this finds nothing, ` + "check that collection ids are in kb and connector ids in apps.");
|
|
53612
|
+
}
|
|
53613
|
+
if (input.unlisted && input.unlisted.length > 0) {
|
|
53614
|
+
notes.push(`Source list was incomplete; ${input.unlisted.join(", ")} were not ` + "found and were sent unchanged.");
|
|
53615
|
+
}
|
|
53616
|
+
return notes;
|
|
53617
|
+
}
|
|
53618
|
+
async function resolveSourceScope(client, apps, kb, opts = {}) {
|
|
53619
|
+
const unchecked = routeSourceScope(apps, kb, new Map);
|
|
53620
|
+
if (unchecked.apps.length === 0 && unchecked.kb.length === 0) {
|
|
53621
|
+
return { scope: unchecked, notes: [] };
|
|
53622
|
+
}
|
|
53623
|
+
const listed = await listAllSources(client, opts);
|
|
53624
|
+
if (!listed.ok) {
|
|
53625
|
+
return {
|
|
53626
|
+
scope: unchecked,
|
|
53627
|
+
notes: sourceScopeNotes({
|
|
53628
|
+
movedToKb: [],
|
|
53629
|
+
movedToApps: [],
|
|
53630
|
+
lookupError: listed.reason
|
|
53631
|
+
})
|
|
53632
|
+
};
|
|
53633
|
+
}
|
|
53634
|
+
const kinds = new Map(listed.sources.map((s) => [s.id, s.kind]));
|
|
53635
|
+
const scope = routeSourceScope(apps, kb, kinds);
|
|
53636
|
+
const unlisted = listed.truncated ? [...scope.apps, ...scope.kb].filter((id) => !kinds.has(id)) : [];
|
|
53637
|
+
return {
|
|
53638
|
+
scope,
|
|
53639
|
+
notes: sourceScopeNotes({
|
|
53640
|
+
movedToKb: scope.movedToKb,
|
|
53641
|
+
movedToApps: scope.movedToApps,
|
|
53642
|
+
unlisted
|
|
53643
|
+
})
|
|
53644
|
+
};
|
|
53645
|
+
}
|
|
53646
|
+
var dedupe = (ids) => [...new Set(ids)];
|
|
53412
53647
|
var init__helpers = __esm(() => {
|
|
53413
53648
|
init_zod();
|
|
53414
53649
|
init_agentsListAgents();
|
|
53650
|
+
init_knowledgeHubGetKnowledgeHubRootNodes();
|
|
53415
53651
|
init_agentops();
|
|
53416
53652
|
});
|
|
53417
53653
|
|
|
@@ -53426,13 +53662,13 @@ var init_pipeshubChat = __esm(() => {
|
|
|
53426
53662
|
init__agui();
|
|
53427
53663
|
init__helpers();
|
|
53428
53664
|
FiltersShape = object({
|
|
53429
|
-
apps: array(string2()).optional().describe("
|
|
53430
|
-
kb: array(string2()).optional().describe("
|
|
53665
|
+
apps: array(string2()).optional().describe("Connector ids to use. Get them from `pipeshub_sources`, where `kind` is " + '"connector". Collection ids go in `kb`, not here.'),
|
|
53666
|
+
kb: array(string2()).optional().describe("Collection (knowledge base) ids to use. Get them from " + '`pipeshub_sources`, where `kind` is "knowledgeBase".')
|
|
53431
53667
|
}).optional();
|
|
53432
53668
|
args = {
|
|
53433
53669
|
query: string2().min(1).describe("The user's question or message for this turn."),
|
|
53434
53670
|
conversationId: string2().optional().describe("Existing conversation id to continue. Omit on the FIRST turn; on every " + "subsequent turn pass the `conversationId` returned by the previous " + "call. Server-side message history is preserved — do NOT replay " + "prior messages."),
|
|
53435
|
-
filters: FiltersShape.describe("
|
|
53671
|
+
filters: FiltersShape.describe("Which sources the answer may use. Leave out to use all sources. Only " + "works on the FIRST turn; later turns keep the first turn's sources."),
|
|
53436
53672
|
modelKey: string2().optional().describe("Model id to use (from `pipeshub_sources` `llmModels[*].modelKey`). " + "Defaults to the org's default LLM."),
|
|
53437
53673
|
modelName: string2().optional(),
|
|
53438
53674
|
modelFriendlyName: string2().optional(),
|
|
@@ -53510,6 +53746,15 @@ cited document, take \`citations[*].recordId\` and call
|
|
|
53510
53746
|
const fetchOptions = { signal: ctx.signal };
|
|
53511
53747
|
const plainChatMode = args2.chatMode === "web_search" ? "web_search" : "internal_search";
|
|
53512
53748
|
let response;
|
|
53749
|
+
let filters = args2.filters;
|
|
53750
|
+
let notes = [];
|
|
53751
|
+
if (!args2.conversationId && filters) {
|
|
53752
|
+
const resolved = await resolveSourceScope(client, filters.apps, filters.kb, { signal: ctx.signal });
|
|
53753
|
+
notes = resolved.notes;
|
|
53754
|
+
if (resolved.scope.apps.length > 0 || resolved.scope.kb.length > 0) {
|
|
53755
|
+
filters = { apps: resolved.scope.apps, kb: resolved.scope.kb };
|
|
53756
|
+
}
|
|
53757
|
+
}
|
|
53513
53758
|
if (args2.agentId) {
|
|
53514
53759
|
const agentChatMode = "quick";
|
|
53515
53760
|
if (args2.conversationId) {
|
|
@@ -53532,7 +53777,7 @@ cited document, take \`citations[*].recordId\` and call
|
|
|
53532
53777
|
agentKey: args2.agentId,
|
|
53533
53778
|
body: {
|
|
53534
53779
|
query: args2.query,
|
|
53535
|
-
filters
|
|
53780
|
+
filters,
|
|
53536
53781
|
modelKey: args2.modelKey,
|
|
53537
53782
|
modelName: args2.modelName,
|
|
53538
53783
|
modelFriendlyName: args2.modelFriendlyName,
|
|
@@ -53560,7 +53805,7 @@ cited document, take \`citations[*].recordId\` and call
|
|
|
53560
53805
|
} else {
|
|
53561
53806
|
const [result] = await conversationsStreamConversation(client, {
|
|
53562
53807
|
query: args2.query,
|
|
53563
|
-
filters
|
|
53808
|
+
filters,
|
|
53564
53809
|
modelKey: args2.modelKey,
|
|
53565
53810
|
modelName: args2.modelName,
|
|
53566
53811
|
modelFriendlyName: args2.modelFriendlyName,
|
|
@@ -53587,7 +53832,8 @@ cited document, take \`citations[*].recordId\` and call
|
|
|
53587
53832
|
if (state.conversation) {
|
|
53588
53833
|
return jsonResult({
|
|
53589
53834
|
...trimConversation(state.conversation),
|
|
53590
|
-
recordsUsed: state.recordsUsed
|
|
53835
|
+
recordsUsed: state.recordsUsed,
|
|
53836
|
+
...notes.length > 0 ? { notes } : {}
|
|
53591
53837
|
});
|
|
53592
53838
|
}
|
|
53593
53839
|
const salvaged = salvagedText(state);
|
|
@@ -53602,7 +53848,8 @@ cited document, take \`citations[*].recordId\` and call
|
|
|
53602
53848
|
followUpQuestions: [],
|
|
53603
53849
|
messageCount: 0,
|
|
53604
53850
|
recordsUsed: state.recordsUsed,
|
|
53605
|
-
warning: "Stream ended without a terminal RUN_FINISHED; answer is the " + "accumulated TEXT_MESSAGE_CONTENT and citations are unavailable."
|
|
53851
|
+
warning: "Stream ended without a terminal RUN_FINISHED; answer is the " + "accumulated TEXT_MESSAGE_CONTENT and citations are unavailable.",
|
|
53852
|
+
...notes.length > 0 ? { notes } : {}
|
|
53606
53853
|
});
|
|
53607
53854
|
}
|
|
53608
53855
|
return errorResult("Stream ended without any usable frames.");
|
|
@@ -53670,9 +53917,9 @@ knowledge base, department, module, or record type. See
|
|
|
53670
53917
|
|
|
53671
53918
|
// src/funcs/semanticSearchSearch.ts
|
|
53672
53919
|
function semanticSearchSearch(client$, request, options) {
|
|
53673
|
-
return new APIPromise($
|
|
53920
|
+
return new APIPromise($do7(client$, request, options));
|
|
53674
53921
|
}
|
|
53675
|
-
async function $
|
|
53922
|
+
async function $do7(client$, request, options) {
|
|
53676
53923
|
const parsed$ = safeParse4(request, (value$) => SemanticSearchRequest$zodSchema.parse(value$), "Input validation failed");
|
|
53677
53924
|
if (!parsed$.ok) {
|
|
53678
53925
|
return [parsed$, { status: "invalid" }];
|
|
@@ -53742,15 +53989,16 @@ var init_semanticSearchSearch = __esm(() => {
|
|
|
53742
53989
|
});
|
|
53743
53990
|
|
|
53744
53991
|
// src/mcp-server/tools/pipeshubSearch.ts
|
|
53745
|
-
var args2, tool$pipeshubSearch;
|
|
53992
|
+
var DEFAULT_LIMIT = 10, args2, tool$pipeshubSearch;
|
|
53746
53993
|
var init_pipeshubSearch = __esm(() => {
|
|
53747
53994
|
init_zod();
|
|
53748
53995
|
init_semanticSearchSearch();
|
|
53749
53996
|
init__helpers();
|
|
53750
53997
|
args2 = {
|
|
53751
53998
|
query: string2().min(1).describe("Natural language query. Vector search across the org's indexed records."),
|
|
53752
|
-
limit: number2().int().min(1).max(100).optional().describe("
|
|
53753
|
-
apps: array(string2()).optional().describe("
|
|
53999
|
+
limit: number2().int().min(1).max(100).optional().describe("Number of results. Default 10. Use 5–10 when you only need a " + "`recordId`."),
|
|
54000
|
+
apps: array(string2()).optional().describe("Connector ids to search (for example a Jira or Google Drive connection). " + 'Get them from `pipeshub_sources`, where `kind` is "connector". ' + "Collection ids go in `kb`, not here."),
|
|
54001
|
+
kb: array(string2()).optional().describe("Collection (knowledge base) ids to search. Get them from " + '`pipeshub_sources`, where `kind` is "knowledgeBase".')
|
|
53754
54002
|
};
|
|
53755
54003
|
tool$pipeshubSearch = {
|
|
53756
54004
|
name: "pipeshub_search",
|
|
@@ -53781,13 +54029,12 @@ not every record that matches. Never count them to answer "how many" /
|
|
|
53781
54029
|
"all" / "every"; navigate the record group instead, which reports its
|
|
53782
54030
|
real total.
|
|
53783
54031
|
|
|
53784
|
-
|
|
53785
|
-
|
|
53786
|
-
Highest \`score\` first; multiple hits may share the same \`recordId\`
|
|
53787
|
-
(different blocks of the same record).
|
|
54032
|
+
By default it searches everything. To search only some sources, pass
|
|
54033
|
+
connector ids in \`apps\` and collection ids in \`kb\`.
|
|
53788
54034
|
|
|
53789
|
-
|
|
53790
|
-
\`webUrl
|
|
54035
|
+
Each hit is one matching passage, best match first:
|
|
54036
|
+
\`{ recordId, recordName, score, snippet, mimeType, webUrl, ... }\`.
|
|
54037
|
+
One record can appear in several hits. Link a record by its \`webUrl\`.`,
|
|
53791
54038
|
scopes: ["read"],
|
|
53792
54039
|
annotations: {
|
|
53793
54040
|
title: "Semantic search",
|
|
@@ -53798,10 +54045,12 @@ When presenting results to the user, link each record using its
|
|
|
53798
54045
|
},
|
|
53799
54046
|
args: args2,
|
|
53800
54047
|
tool: async (client, args3, ctx) => {
|
|
54048
|
+
const limit = args3.limit ?? DEFAULT_LIMIT;
|
|
54049
|
+
const { scope, notes } = await resolveSourceScope(client, args3.apps, args3.kb, { signal: ctx.signal });
|
|
53801
54050
|
const [result] = await semanticSearchSearch(client, {
|
|
53802
54051
|
query: args3.query,
|
|
53803
|
-
limit
|
|
53804
|
-
filters:
|
|
54052
|
+
limit,
|
|
54053
|
+
filters: searchFilters(scope)
|
|
53805
54054
|
}, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
53806
54055
|
if (!result.ok)
|
|
53807
54056
|
return errorResult(result.error.message);
|
|
@@ -53818,7 +54067,8 @@ When presenting results to the user, link each record using its
|
|
|
53818
54067
|
connector: r.connectorName,
|
|
53819
54068
|
mimeType: r.mimeType,
|
|
53820
54069
|
webUrl: r.webUrl
|
|
53821
|
-
}))
|
|
54070
|
+
})),
|
|
54071
|
+
...notes.length > 0 ? { notes } : {}
|
|
53822
54072
|
});
|
|
53823
54073
|
}
|
|
53824
54074
|
};
|
|
@@ -53868,9 +54118,9 @@ on this record's knowledge base.
|
|
|
53868
54118
|
|
|
53869
54119
|
// src/funcs/recordsStreamRecordBuffer.ts
|
|
53870
54120
|
function recordsStreamRecordBuffer(client$, request, options) {
|
|
53871
|
-
return new APIPromise($
|
|
54121
|
+
return new APIPromise($do8(client$, request, options));
|
|
53872
54122
|
}
|
|
53873
|
-
async function $
|
|
54123
|
+
async function $do8(client$, request, options) {
|
|
53874
54124
|
const parsed$ = safeParse4(request, (value$) => StreamRecordBufferRequest$zodSchema.parse(value$), "Input validation failed");
|
|
53875
54125
|
if (!parsed$.ok) {
|
|
53876
54126
|
return [parsed$, { status: "invalid" }];
|
|
@@ -53957,22 +54207,22 @@ var init_pipeshubDownloadRecord = __esm(() => {
|
|
|
53957
54207
|
init__helpers();
|
|
53958
54208
|
args3 = {
|
|
53959
54209
|
recordId: string2().min(1).describe("Record identifier — usually a UUID for connector-sourced records or " + "a 24-character ObjectId for uploaded records. Get it from a chat " + "citation (`citations[*].recordId`) or from a `pipeshub_search` hit."),
|
|
53960
|
-
convertTo: string2().optional().describe("
|
|
54210
|
+
convertTo: string2().optional().describe("The only conversion target connectors honour is `application/pdf` " + "(the MIME type, not `pdf`). A bare `pdf` is ignored and the " + "original file is returned with no error. Omit for the file as " + "stored. Does not parse the document — use " + '`pipeshub_get_record_content` `mode:"content"` for that.')
|
|
53961
54211
|
};
|
|
53962
54212
|
tool$pipeshubDownloadRecord = {
|
|
53963
54213
|
name: "pipeshub_download_record",
|
|
53964
|
-
description: `
|
|
53965
|
-
|
|
53966
|
-
|
|
53967
|
-
|
|
53968
|
-
|
|
53969
|
-
|
|
53970
|
-
|
|
53971
|
-
|
|
53972
|
-
|
|
53973
|
-
|
|
53974
|
-
|
|
53975
|
-
|
|
54214
|
+
description: `Download the file as stored for one record — not PipesHub's parsed
|
|
54215
|
+
content, metadata header, or summary.
|
|
54216
|
+
|
|
54217
|
+
Use this when the user wants the file itself (download, attach, open).
|
|
54218
|
+
Get \`recordId\` from a chat citation or a \`pipeshub_search\` hit.
|
|
54219
|
+
|
|
54220
|
+
Do not use this to read, summarize, or answer "what does this doc
|
|
54221
|
+
say?" regardless of format. That is \`pipeshub_get_record_content\`
|
|
54222
|
+
\`mode:"content"\`. Text formats come back inline; images, audio, and
|
|
54223
|
+
binary as base64.
|
|
54224
|
+
|
|
54225
|
+
\`convertTo\` accepts only \`application/pdf\`; anything else is ignored.`,
|
|
53976
54226
|
scopes: ["read"],
|
|
53977
54227
|
annotations: {
|
|
53978
54228
|
title: "Download a document by record id",
|
|
@@ -54005,9 +54255,9 @@ var init_getrecordcontentop = __esm(() => {
|
|
|
54005
54255
|
|
|
54006
54256
|
// src/funcs/connectorGetRecordContent.ts
|
|
54007
54257
|
function connectorGetRecordContent(client$, request, options) {
|
|
54008
|
-
return new APIPromise($
|
|
54258
|
+
return new APIPromise($do9(client$, request, options));
|
|
54009
54259
|
}
|
|
54010
|
-
async function $
|
|
54260
|
+
async function $do9(client$, request, options) {
|
|
54011
54261
|
const parsed$ = safeParse4(request, (value$) => GetRecordContentRequest$zodSchema.parse(value$), "Input validation failed");
|
|
54012
54262
|
if (!parsed$.ok) {
|
|
54013
54263
|
return [parsed$, { status: "invalid" }];
|
|
@@ -54093,9 +54343,9 @@ var init_lookuprecordbyidentifierop = __esm(() => {
|
|
|
54093
54343
|
|
|
54094
54344
|
// src/funcs/connectorLookupRecordByIdentifier.ts
|
|
54095
54345
|
function connectorLookupRecordByIdentifier(client$, request, options) {
|
|
54096
|
-
return new APIPromise($
|
|
54346
|
+
return new APIPromise($do10(client$, request, options));
|
|
54097
54347
|
}
|
|
54098
|
-
async function $
|
|
54348
|
+
async function $do10(client$, request, options) {
|
|
54099
54349
|
const parsed$ = safeParse4(request, (value$) => LookupRecordByIdentifierRequest$zodSchema.parse(value$), "Input validation failed");
|
|
54100
54350
|
if (!parsed$.ok) {
|
|
54101
54351
|
return [parsed$, { status: "invalid" }];
|
|
@@ -54187,9 +54437,9 @@ var init_navigateknowledgegraphop = __esm(() => {
|
|
|
54187
54437
|
|
|
54188
54438
|
// src/funcs/connectorNavigateKnowledgeGraph.ts
|
|
54189
54439
|
function connectorNavigateKnowledgeGraph(client$, request, options) {
|
|
54190
|
-
return new APIPromise($
|
|
54440
|
+
return new APIPromise($do11(client$, request, options));
|
|
54191
54441
|
}
|
|
54192
|
-
async function $
|
|
54442
|
+
async function $do11(client$, request, options) {
|
|
54193
54443
|
const parsed$ = safeParse4(request, (value$) => NavigateKnowledgeGraphRequest$zodSchema.optional().parse(value$), "Input validation failed");
|
|
54194
54444
|
if (!parsed$.ok) {
|
|
54195
54445
|
return [parsed$, { status: "invalid" }];
|
|
@@ -54456,9 +54706,9 @@ var init_getallusersop = __esm(() => {
|
|
|
54456
54706
|
|
|
54457
54707
|
// src/funcs/usersGetAllUsers.ts
|
|
54458
54708
|
function usersGetAllUsers(client$, request, options) {
|
|
54459
|
-
return new APIPromise($
|
|
54709
|
+
return new APIPromise($do12(client$, request, options));
|
|
54460
54710
|
}
|
|
54461
|
-
async function $
|
|
54711
|
+
async function $do12(client$, request, options) {
|
|
54462
54712
|
const parsed$ = safeParse4(request, (value$) => GetAllUsersRequest$zodSchema.optional().parse(value$), "Input validation failed");
|
|
54463
54713
|
if (!parsed$.ok) {
|
|
54464
54714
|
return [parsed$, { status: "invalid" }];
|
|
@@ -54543,9 +54793,9 @@ var init_getuserbyidop = __esm(() => {
|
|
|
54543
54793
|
|
|
54544
54794
|
// src/funcs/usersGetUserById.ts
|
|
54545
54795
|
function usersGetUserById(client$, request, options) {
|
|
54546
|
-
return new APIPromise($
|
|
54796
|
+
return new APIPromise($do13(client$, request, options));
|
|
54547
54797
|
}
|
|
54548
|
-
async function $
|
|
54798
|
+
async function $do13(client$, request, options) {
|
|
54549
54799
|
const parsed$ = safeParse4(request, (value$) => GetUserByIdRequest$zodSchema.parse(value$), "Input validation failed");
|
|
54550
54800
|
if (!parsed$.ok) {
|
|
54551
54801
|
return [parsed$, { status: "invalid" }];
|
|
@@ -54632,9 +54882,9 @@ var init_getallusergroupsop = __esm(() => {
|
|
|
54632
54882
|
|
|
54633
54883
|
// src/funcs/userGroupsGetAllUserGroups.ts
|
|
54634
54884
|
function userGroupsGetAllUserGroups(client$, request, options) {
|
|
54635
|
-
return new APIPromise($
|
|
54885
|
+
return new APIPromise($do14(client$, request, options));
|
|
54636
54886
|
}
|
|
54637
|
-
async function $
|
|
54887
|
+
async function $do14(client$, request, options) {
|
|
54638
54888
|
const parsed$ = safeParse4(request, (value$) => GetAllUserGroupsRequest$zodSchema.optional().parse(value$), "Input validation failed");
|
|
54639
54889
|
if (!parsed$.ok) {
|
|
54640
54890
|
return [parsed$, { status: "invalid" }];
|
|
@@ -54724,9 +54974,9 @@ var init_getuserteamsop = __esm(() => {
|
|
|
54724
54974
|
|
|
54725
54975
|
// src/funcs/teamsGetUserTeams.ts
|
|
54726
54976
|
function teamsGetUserTeams(client$, request, options) {
|
|
54727
|
-
return new APIPromise($
|
|
54977
|
+
return new APIPromise($do15(client$, request, options));
|
|
54728
54978
|
}
|
|
54729
|
-
async function $
|
|
54979
|
+
async function $do15(client$, request, options) {
|
|
54730
54980
|
const parsed$ = safeParse4(request, (value$) => GetUserTeamsRequest$zodSchema.optional().parse(value$), "Input validation failed");
|
|
54731
54981
|
if (!parsed$.ok) {
|
|
54732
54982
|
return [parsed$, { status: "invalid" }];
|
|
@@ -54953,125 +55203,6 @@ Output shape varies by action; see each action's docs above.`,
|
|
|
54953
55203
|
};
|
|
54954
55204
|
});
|
|
54955
55205
|
|
|
54956
|
-
// src/models/getknowledgehubrootnodesop.ts
|
|
54957
|
-
var SortOrder$zodSchema, GetKnowledgeHubRootNodesRequest$zodSchema;
|
|
54958
|
-
var init_getknowledgehubrootnodesop = __esm(() => {
|
|
54959
|
-
init_zod();
|
|
54960
|
-
SortOrder$zodSchema = _enum([
|
|
54961
|
-
"asc",
|
|
54962
|
-
"desc"
|
|
54963
|
-
]).describe("Sort order.");
|
|
54964
|
-
GetKnowledgeHubRootNodesRequest$zodSchema = object({
|
|
54965
|
-
connectorIds: string2().describe("Comma-separated connector instance ids to scope to.").optional(),
|
|
54966
|
-
createdAt: string2().describe("Created date range as `gte:<ms>,lte:<ms>`.").optional(),
|
|
54967
|
-
flattened: boolean2().default(false).describe("Return flattened view with all nested children."),
|
|
54968
|
-
include: string2().describe("Comma-separated includes — any of `breadcrumbs`, `counts`,\n`availableFilters`, `permissions`.\n").optional(),
|
|
54969
|
-
indexingStatus: string2().describe("Comma-separated indexing statuses.").optional(),
|
|
54970
|
-
limit: int().default(50).describe("Items per page."),
|
|
54971
|
-
nodeTypes: string2().describe("Comma-separated node types (`app`, `recordGroup`, `folder`, `record`).").optional(),
|
|
54972
|
-
only_containers: boolean2().default(false).describe("Only return nodes with children (for sidebar UIs)."),
|
|
54973
|
-
origins: string2().describe("Comma-separated origins (`COLLECTION`, `CONNECTOR`).").optional(),
|
|
54974
|
-
page: int().default(1).describe("Page number (1-indexed)."),
|
|
54975
|
-
q: string2().describe("Full-text search query against node names.").optional(),
|
|
54976
|
-
recordTypes: string2().describe("Comma-separated record types.").optional(),
|
|
54977
|
-
size: string2().describe("Size range as `gte:<bytes>,lte:<bytes>`.").optional(),
|
|
54978
|
-
sortBy: string2().default("updatedAt").describe("Sort field — one of `name`, `createdAt`, `updatedAt`, `size`, `type`."),
|
|
54979
|
-
sortOrder: SortOrder$zodSchema.default("desc"),
|
|
54980
|
-
updatedAt: string2().describe("Updated date range as `gte:<ms>,lte:<ms>`.").optional()
|
|
54981
|
-
});
|
|
54982
|
-
});
|
|
54983
|
-
|
|
54984
|
-
// src/funcs/knowledgeHubGetKnowledgeHubRootNodes.ts
|
|
54985
|
-
function knowledgeHubGetKnowledgeHubRootNodes(client$, request, options) {
|
|
54986
|
-
return new APIPromise($do15(client$, request, options));
|
|
54987
|
-
}
|
|
54988
|
-
async function $do15(client$, request, options) {
|
|
54989
|
-
const parsed$ = safeParse4(request, (value$) => GetKnowledgeHubRootNodesRequest$zodSchema.optional().parse(value$), "Input validation failed");
|
|
54990
|
-
if (!parsed$.ok) {
|
|
54991
|
-
return [parsed$, { status: "invalid" }];
|
|
54992
|
-
}
|
|
54993
|
-
const payload$ = parsed$.value;
|
|
54994
|
-
const body$ = null;
|
|
54995
|
-
const path$ = pathToFunc("/knowledgeBase/knowledge-hub/nodes")();
|
|
54996
|
-
const query$ = encodeFormQuery({
|
|
54997
|
-
connectorIds: payload$?.connectorIds,
|
|
54998
|
-
createdAt: payload$?.createdAt,
|
|
54999
|
-
flattened: payload$?.flattened,
|
|
55000
|
-
include: payload$?.include,
|
|
55001
|
-
indexingStatus: payload$?.indexingStatus,
|
|
55002
|
-
limit: payload$?.limit,
|
|
55003
|
-
nodeTypes: payload$?.nodeTypes,
|
|
55004
|
-
only_containers: payload$?.only_containers,
|
|
55005
|
-
origins: payload$?.origins,
|
|
55006
|
-
page: payload$?.page,
|
|
55007
|
-
q: payload$?.q,
|
|
55008
|
-
recordTypes: payload$?.recordTypes,
|
|
55009
|
-
size: payload$?.size,
|
|
55010
|
-
sortBy: payload$?.sortBy,
|
|
55011
|
-
sortOrder: payload$?.sortOrder,
|
|
55012
|
-
updatedAt: payload$?.updatedAt
|
|
55013
|
-
});
|
|
55014
|
-
const headers$ = new Headers(compactMap({
|
|
55015
|
-
Accept: "application/json"
|
|
55016
|
-
}));
|
|
55017
|
-
const securityInput = await extractSecurity(client$._options.security);
|
|
55018
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
55019
|
-
const context = {
|
|
55020
|
-
options: client$._options,
|
|
55021
|
-
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
55022
|
-
operationID: "getKnowledgeHubRootNodes",
|
|
55023
|
-
oAuth2Scopes: ["kb:read"],
|
|
55024
|
-
resolvedSecurity: requestSecurity,
|
|
55025
|
-
securitySource: client$._options.security,
|
|
55026
|
-
retryConfig: options?.retries || client$._options.retryConfig || { strategy: "none" },
|
|
55027
|
-
retryCodes: options?.retryCodes || [
|
|
55028
|
-
"429",
|
|
55029
|
-
"500",
|
|
55030
|
-
"502",
|
|
55031
|
-
"503",
|
|
55032
|
-
"504"
|
|
55033
|
-
]
|
|
55034
|
-
};
|
|
55035
|
-
const requestRes = client$._createRequest(context, {
|
|
55036
|
-
security: requestSecurity,
|
|
55037
|
-
method: "GET",
|
|
55038
|
-
baseURL: options?.serverURL,
|
|
55039
|
-
path: path$,
|
|
55040
|
-
headers: headers$,
|
|
55041
|
-
query: query$,
|
|
55042
|
-
body: body$,
|
|
55043
|
-
userAgent: client$._options.userAgent,
|
|
55044
|
-
timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
|
|
55045
|
-
}, options);
|
|
55046
|
-
if (!requestRes.ok) {
|
|
55047
|
-
return [requestRes, { status: "invalid" }];
|
|
55048
|
-
}
|
|
55049
|
-
const req$ = requestRes.value;
|
|
55050
|
-
const doResult = await client$._do(req$, {
|
|
55051
|
-
context,
|
|
55052
|
-
errorCodes: [],
|
|
55053
|
-
retryConfig: context.retryConfig,
|
|
55054
|
-
retryCodes: context.retryCodes
|
|
55055
|
-
});
|
|
55056
|
-
if (!doResult.ok) {
|
|
55057
|
-
return [doResult, { status: "request-error", request: req$ }];
|
|
55058
|
-
}
|
|
55059
|
-
return [doResult, {
|
|
55060
|
-
status: "complete",
|
|
55061
|
-
request: req$,
|
|
55062
|
-
response: doResult.value
|
|
55063
|
-
}];
|
|
55064
|
-
}
|
|
55065
|
-
var init_knowledgeHubGetKnowledgeHubRootNodes = __esm(() => {
|
|
55066
|
-
init_encodings();
|
|
55067
|
-
init_primitives();
|
|
55068
|
-
init_schemas4();
|
|
55069
|
-
init_security2();
|
|
55070
|
-
init_url();
|
|
55071
|
-
init_getknowledgehubrootnodesop();
|
|
55072
|
-
init_async();
|
|
55073
|
-
});
|
|
55074
|
-
|
|
55075
55206
|
// src/models/modeltype.ts
|
|
55076
55207
|
var ModelType$zodSchema;
|
|
55077
55208
|
var init_modeltype = __esm(() => {
|
|
@@ -55181,7 +55312,6 @@ var init_aiModelsProvidersGetAvailableModelsByType = __esm(() => {
|
|
|
55181
55312
|
var args6, tool$pipeshubSources;
|
|
55182
55313
|
var init_pipeshubSources = __esm(() => {
|
|
55183
55314
|
init_zod();
|
|
55184
|
-
init_knowledgeHubGetKnowledgeHubRootNodes();
|
|
55185
55315
|
init_aiModelsProvidersGetAvailableModelsByType();
|
|
55186
55316
|
init__helpers();
|
|
55187
55317
|
args6 = {
|
|
@@ -55193,20 +55323,19 @@ var init_pipeshubSources = __esm(() => {
|
|
|
55193
55323
|
|
|
55194
55324
|
Returns up to three sections:
|
|
55195
55325
|
|
|
55196
|
-
- \`sources\` —
|
|
55197
|
-
|
|
55198
|
-
|
|
55199
|
-
\`
|
|
55326
|
+
- \`sources\` — connectors (\`kind: "connector"\`) and collections
|
|
55327
|
+
(\`kind: "knowledgeBase"\`). For \`pipeshub_search\` and
|
|
55328
|
+
\`pipeshub_chat\`, put a connector \`id\` in \`apps\` and a collection
|
|
55329
|
+
\`id\` in \`kb\`. \`sourcesTruncated: true\` means the list stopped at
|
|
55330
|
+
1,000 sources.
|
|
55200
55331
|
- \`llmModels\` — chat / generation models. Each item's \`modelKey\`
|
|
55201
|
-
is the value to pass on \`pipeshub_chat\`
|
|
55202
|
-
\`
|
|
55203
|
-
specific model.
|
|
55332
|
+
is the value to pass on \`pipeshub_chat\` as \`modelKey\`. Pick
|
|
55333
|
+
\`isDefault: true\` unless the user asks for a specific model.
|
|
55204
55334
|
- \`embeddingModels\` — vector embedding models (only fetched when
|
|
55205
55335
|
explicitly requested via \`include\`).
|
|
55206
55336
|
|
|
55207
55337
|
Call this once at the start of a session and cache the result —
|
|
55208
|
-
sources and models change infrequently
|
|
55209
|
-
are returned by default; pass \`include\` to override.`,
|
|
55338
|
+
sources and models change infrequently.`,
|
|
55210
55339
|
scopes: ["read"],
|
|
55211
55340
|
annotations: {
|
|
55212
55341
|
title: "List PipesHub sources and AI models",
|
|
@@ -55222,22 +55351,12 @@ are returned by default; pass \`include\` to override.`,
|
|
|
55222
55351
|
const want = (s) => include.includes(s);
|
|
55223
55352
|
const result = {};
|
|
55224
55353
|
if (want("sources")) {
|
|
55225
|
-
const
|
|
55226
|
-
|
|
55227
|
-
|
|
55228
|
-
|
|
55229
|
-
if (
|
|
55230
|
-
|
|
55231
|
-
const parsed = await readJson(r.value, "Knowledge base listing");
|
|
55232
|
-
if (!parsed.ok)
|
|
55233
|
-
return parsed.result;
|
|
55234
|
-
result["sources"] = (parsed.value.items ?? []).map((n) => ({
|
|
55235
|
-
id: n.id,
|
|
55236
|
-
name: n.name,
|
|
55237
|
-
kind: n.connector === "KB" ? "knowledgeBase" : "connector",
|
|
55238
|
-
connector: n.connector,
|
|
55239
|
-
hasChildren: n.hasChildren
|
|
55240
|
-
}));
|
|
55354
|
+
const listed = await listAllSources(client, { signal: ctx.signal });
|
|
55355
|
+
if (!listed.ok)
|
|
55356
|
+
return listed.result;
|
|
55357
|
+
result["sources"] = listed.sources;
|
|
55358
|
+
if (listed.truncated)
|
|
55359
|
+
result["sourcesTruncated"] = true;
|
|
55241
55360
|
}
|
|
55242
55361
|
for (const [key, modelType] of [
|
|
55243
55362
|
["llmModels", "llm"],
|
|
@@ -55425,7 +55544,7 @@ var init_tool_names = __esm(() => {
|
|
|
55425
55544
|
toolNames = [
|
|
55426
55545
|
{
|
|
55427
55546
|
name: "pipeshub_sources",
|
|
55428
|
-
description:
|
|
55547
|
+
description: 'Discover available chat sources and AI models in one call.\n\nReturns up to three sections:\n\n- `sources` — connectors (`kind: "connector"`) and collections\n (`kind: "knowledgeBase"`). For `pipeshub_search` and\n `pipeshub_chat`, put a connector `id` in `apps` and a collection\n `id` in `kb`. `sourcesTruncated: true` means the list stopped at\n 1,000 sources.\n- `llmModels` — chat / generation models. Each item\'s `modelKey`\n is the value to pass on `pipeshub_chat` as `modelKey`. Pick\n `isDefault: true` unless the user asks for a specific model.\n- `embeddingModels` — vector embedding models (only fetched when\n explicitly requested via `include`).\n\nCall this once at the start of a session and cache the result —\nsources and models change infrequently.'
|
|
55429
55548
|
},
|
|
55430
55549
|
{
|
|
55431
55550
|
name: "pipeshub_chat",
|
|
@@ -55510,17 +55629,16 @@ not every record that matches. Never count them to answer "how many" /
|
|
|
55510
55629
|
"all" / "every"; navigate the record group instead, which reports its
|
|
55511
55630
|
real total.
|
|
55512
55631
|
|
|
55513
|
-
|
|
55514
|
-
|
|
55515
|
-
Highest \`score\` first; multiple hits may share the same \`recordId\`
|
|
55516
|
-
(different blocks of the same record).
|
|
55632
|
+
By default it searches everything. To search only some sources, pass
|
|
55633
|
+
connector ids in \`apps\` and collection ids in \`kb\`.
|
|
55517
55634
|
|
|
55518
|
-
|
|
55519
|
-
\`webUrl
|
|
55635
|
+
Each hit is one matching passage, best match first:
|
|
55636
|
+
\`{ recordId, recordName, score, snippet, mimeType, webUrl, ... }\`.
|
|
55637
|
+
One record can appear in several hits. Link a record by its \`webUrl\`.`
|
|
55520
55638
|
},
|
|
55521
55639
|
{
|
|
55522
55640
|
name: "pipeshub_download_record",
|
|
55523
|
-
description:
|
|
55641
|
+
description: 'Download the file as stored for one record — not PipesHub\'s parsed\ncontent, metadata header, or summary.\n\nUse this when the user wants the file itself (download, attach, open).\nGet `recordId` from a chat citation or a `pipeshub_search` hit.\n\nDo not use this to read, summarize, or answer "what does this doc\nsay?" regardless of format. That is `pipeshub_get_record_content`\n`mode:"content"`. Text formats come back inline; images, audio, and\nbinary as base64.\n\n`convertTo` accepts only `application/pdf`; anything else is ignored.'
|
|
55524
55642
|
},
|
|
55525
55643
|
{
|
|
55526
55644
|
name: "pipeshub_get_record_content",
|
|
@@ -59234,5 +59352,5 @@ export {
|
|
|
59234
59352
|
app
|
|
59235
59353
|
};
|
|
59236
59354
|
|
|
59237
|
-
//# debugId=
|
|
59355
|
+
//# debugId=DDE3715978A747DC64756E2164756E21
|
|
59238
59356
|
//# sourceMappingURL=mcp-server.js.map
|