@cloudbase/cloudbase-mcp 1.8.6 → 1.8.8
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/dist/cli.cjs +22 -15
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +22 -15
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +22 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5268,6 +5268,13 @@ var KnowledgeBaseIdMap = {
|
|
|
5268
5268
|
scf: "scfsczskzyws_4bdc",
|
|
5269
5269
|
miniprogram: "xcxzskws_25d8"
|
|
5270
5270
|
};
|
|
5271
|
+
function safeParse(str) {
|
|
5272
|
+
try {
|
|
5273
|
+
return JSON.parse(str);
|
|
5274
|
+
} catch (e) {
|
|
5275
|
+
return {};
|
|
5276
|
+
}
|
|
5277
|
+
}
|
|
5271
5278
|
function safeStringify(obj) {
|
|
5272
5279
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
5273
5280
|
try {
|
|
@@ -5353,23 +5360,23 @@ function registerRagTools(server2) {
|
|
|
5353
5360
|
if (result.code) {
|
|
5354
5361
|
throw new Error(result.message);
|
|
5355
5362
|
}
|
|
5356
|
-
const filteredResults = result.data.filter((item) => item.score >= threshold);
|
|
5357
5363
|
return {
|
|
5358
|
-
content: [
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
total: filteredResults.length,
|
|
5364
|
-
threshold,
|
|
5365
|
-
results: filteredResults.map((item) => ({
|
|
5366
|
-
content: item.content,
|
|
5364
|
+
content: [{
|
|
5365
|
+
type: "text",
|
|
5366
|
+
text: safeStringify(
|
|
5367
|
+
result.data.documents.filter((item) => item.score >= threshold).map((item) => {
|
|
5368
|
+
return {
|
|
5367
5369
|
score: item.score,
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5370
|
+
fileTile: item.documentSet.fileTitle,
|
|
5371
|
+
url: safeParse(item.documentSet.fileMetaData).url,
|
|
5372
|
+
paragraphTitle: item.data.paragraphTitle,
|
|
5373
|
+
text: `${item.data.pre?.join("\n") || ""}
|
|
5374
|
+
${item.data.text}
|
|
5375
|
+
${item.data.next?.join("\n") || ""}`
|
|
5376
|
+
};
|
|
5377
|
+
})
|
|
5378
|
+
)
|
|
5379
|
+
}]
|
|
5373
5380
|
};
|
|
5374
5381
|
}
|
|
5375
5382
|
);
|