@egain/egain-mcp-server 1.0.21 → 1.0.22
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/bin/mcp-server.js +294 -114
- package/bin/mcp-server.js.map +40 -34
- package/esm/src/funcs/queryAnswers.d.ts +7 -3
- package/esm/src/funcs/queryAnswers.d.ts.map +1 -1
- package/esm/src/funcs/queryAnswers.js +9 -7
- package/esm/src/funcs/queryAnswers.js.map +1 -1
- package/esm/src/funcs/queryRetrieve.d.ts +2 -2
- package/esm/src/funcs/queryRetrieve.d.ts.map +1 -1
- package/esm/src/funcs/queryRetrieve.js +4 -10
- package/esm/src/funcs/queryRetrieve.js.map +1 -1
- package/esm/src/funcs/querySearch.d.ts +3 -3
- package/esm/src/funcs/querySearch.d.ts.map +1 -1
- package/esm/src/funcs/querySearch.js +9 -3
- package/esm/src/funcs/querySearch.js.map +1 -1
- package/esm/src/hooks/server-routing-hook.js +2 -2
- package/esm/src/hooks/server-routing-hook.js.map +1 -1
- package/esm/src/lib/config.d.ts +2 -2
- package/esm/src/lib/config.js +2 -2
- package/esm/src/mcp-server/mcp-server.js +1 -1
- package/esm/src/mcp-server/server.js +4 -4
- package/esm/src/mcp-server/server.js.map +1 -1
- package/esm/src/mcp-server/tools/queryAnswers.d.ts +1 -1
- package/esm/src/mcp-server/tools/queryAnswers.d.ts.map +1 -1
- package/esm/src/mcp-server/tools/queryAnswers.js +7 -3
- package/esm/src/mcp-server/tools/queryAnswers.js.map +1 -1
- package/esm/src/mcp-server/tools/queryRetrieve.d.ts +1 -1
- package/esm/src/mcp-server/tools/queryRetrieve.js +2 -2
- package/esm/src/mcp-server/tools/queryRetrieve.js.map +1 -1
- package/esm/src/mcp-server/tools/querySearch.js +1 -1
- package/esm/src/models/additionalsnippets.d.ts +2 -1
- package/esm/src/models/additionalsnippets.d.ts.map +1 -1
- package/esm/src/models/additionalsnippets.js +2 -1
- package/esm/src/models/additionalsnippets.js.map +1 -1
- package/esm/src/models/aisearchop.d.ts +8 -4
- package/esm/src/models/aisearchop.d.ts.map +1 -1
- package/esm/src/models/aisearchop.js +16 -6
- package/esm/src/models/aisearchop.js.map +1 -1
- package/esm/src/models/aisearchresponse.d.ts +16 -0
- package/esm/src/models/aisearchresponse.d.ts.map +1 -0
- package/esm/src/models/aisearchresponse.js +14 -0
- package/esm/src/models/aisearchresponse.js.map +1 -0
- package/esm/src/models/aispaginationinfo.d.ts +10 -0
- package/esm/src/models/aispaginationinfo.d.ts.map +1 -0
- package/esm/src/models/aispaginationinfo.js +12 -0
- package/esm/src/models/aispaginationinfo.js.map +1 -0
- package/esm/src/models/aitopicbreadcrumb.d.ts +10 -0
- package/esm/src/models/aitopicbreadcrumb.d.ts.map +1 -0
- package/esm/src/models/aitopicbreadcrumb.js +9 -0
- package/esm/src/models/aitopicbreadcrumb.js.map +1 -0
- package/esm/src/models/aitopicsummary.d.ts +10 -0
- package/esm/src/models/aitopicsummary.d.ts.map +1 -0
- package/esm/src/models/aitopicsummary.js +9 -0
- package/esm/src/models/aitopicsummary.js.map +1 -0
- package/esm/src/models/answersrequest.d.ts +22 -11
- package/esm/src/models/answersrequest.d.ts.map +1 -1
- package/esm/src/models/answersrequest.js +22 -10
- package/esm/src/models/answersrequest.js.map +1 -1
- package/esm/src/models/answersresponse.d.ts +3 -2
- package/esm/src/models/answersresponse.d.ts.map +1 -1
- package/esm/src/models/answersresponse.js +2 -1
- package/esm/src/models/answersresponse.js.map +1 -1
- package/esm/src/models/article.d.ts +1 -1
- package/esm/src/models/article.d.ts.map +1 -1
- package/esm/src/models/articleaisearchresult.d.ts +58 -0
- package/esm/src/models/articleaisearchresult.d.ts.map +1 -0
- package/esm/src/models/articleaisearchresult.js +63 -0
- package/esm/src/models/articleaisearchresult.js.map +1 -0
- package/esm/src/models/articletype.d.ts +1 -1
- package/esm/src/models/articletype.d.ts.map +1 -1
- package/esm/src/models/articletype.js +1 -0
- package/esm/src/models/articletype.js.map +1 -1
- package/esm/src/models/createsuggestion.d.ts +1 -1
- package/esm/src/models/createsuggestion.d.ts.map +1 -1
- package/esm/src/models/createsuggestion.js +13 -1
- package/esm/src/models/createsuggestion.js.map +1 -1
- package/esm/src/models/getbestanswerop.d.ts +24 -0
- package/esm/src/models/getbestanswerop.d.ts.map +1 -0
- package/esm/src/models/getbestanswerop.js +30 -0
- package/esm/src/models/getbestanswerop.js.map +1 -0
- package/esm/src/models/languagecodeparameter.d.ts +1 -1
- package/esm/src/models/languagecodeparameter.d.ts.map +1 -1
- package/esm/src/models/languagecodeparameter.js +11 -0
- package/esm/src/models/languagecodeparameter.js.map +1 -1
- package/esm/src/models/languagequeryparameter.d.ts +1 -1
- package/esm/src/models/languagequeryparameter.d.ts.map +1 -1
- package/esm/src/models/languagequeryparameter.js +11 -0
- package/esm/src/models/languagequeryparameter.js.map +1 -1
- package/esm/src/models/mandatorylanguagequeryparameter.d.ts +1 -1
- package/esm/src/models/mandatorylanguagequeryparameter.d.ts.map +1 -1
- package/esm/src/models/mandatorylanguagequeryparameter.js +12 -0
- package/esm/src/models/mandatorylanguagequeryparameter.js.map +1 -1
- package/esm/src/models/referenceresponse.d.ts +2 -2
- package/esm/src/models/referenceresponse.d.ts.map +1 -1
- package/esm/src/models/referenceresponse.js +2 -2
- package/esm/src/models/referenceresponse.js.map +1 -1
- package/esm/src/models/requiredlanguagecode.d.ts +7 -0
- package/esm/src/models/requiredlanguagecode.d.ts.map +1 -0
- package/esm/src/models/requiredlanguagecode.js +41 -0
- package/esm/src/models/requiredlanguagecode.js.map +1 -0
- package/esm/src/models/retrievechunksop.d.ts +24 -0
- package/esm/src/models/retrievechunksop.d.ts.map +1 -0
- package/esm/src/models/retrievechunksop.js +30 -0
- package/esm/src/models/retrievechunksop.js.map +1 -0
- package/esm/src/models/retrieverequest.d.ts +1 -0
- package/esm/src/models/retrieverequest.d.ts.map +1 -1
- package/esm/src/models/retrieverequest.js +1 -0
- package/esm/src/models/retrieverequest.js.map +1 -1
- package/esm/src/models/retrieveresponse.d.ts +2 -1
- package/esm/src/models/retrieveresponse.d.ts.map +1 -1
- package/esm/src/models/retrieveresponse.js +2 -1
- package/esm/src/models/retrieveresponse.js.map +1 -1
- package/esm/src/models/schemastags.d.ts +7 -0
- package/esm/src/models/schemastags.d.ts.map +1 -0
- package/esm/src/models/schemastags.js +9 -0
- package/esm/src/models/schemastags.js.map +1 -0
- package/esm/src/models/searchresult.d.ts +6 -4
- package/esm/src/models/searchresult.d.ts.map +1 -1
- package/esm/src/models/searchresult.js +7 -5
- package/esm/src/models/searchresult.js.map +1 -1
- package/esm/src/models/tags.d.ts +2 -2
- package/esm/src/models/tags.d.ts.map +1 -1
- package/esm/src/models/tags.js +2 -2
- package/esm/src/models/tags.js.map +1 -1
- package/esm/src/models/topicsummary.d.ts +2 -0
- package/esm/src/models/topicsummary.d.ts.map +1 -1
- package/esm/src/models/topicsummary.js +2 -0
- package/esm/src/models/topicsummary.js.map +1 -1
- package/esm/src/models/wserrorcommon.d.ts +1 -1
- package/esm/src/models/wserrorcommon.d.ts.map +1 -1
- package/esm/src/models/wserrorcommon.js +1 -1
- package/esm/src/models/wserrorcommon.js.map +1 -1
- package/manifest.json +12 -12
- package/package.json +1 -1
- package/src/funcs/queryAnswers.ts +20 -18
- package/src/funcs/queryRetrieve.ts +15 -21
- package/src/funcs/querySearch.ts +16 -9
- package/src/hooks/server-routing-hook.ts +2 -2
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +4 -4
- package/src/mcp-server/tools/queryAnswers.ts +7 -3
- package/src/mcp-server/tools/queryRetrieve.ts +2 -2
- package/src/mcp-server/tools/querySearch.ts +1 -1
- package/src/models/additionalsnippets.ts +4 -2
- package/src/models/aisearchop.ts +33 -9
- package/src/models/aisearchresponse.ts +42 -0
- package/src/models/aispaginationinfo.ts +24 -0
- package/src/models/aitopicbreadcrumb.ts +21 -0
- package/src/models/aitopicsummary.ts +24 -0
- package/src/models/answersrequest.ts +42 -23
- package/src/models/answersresponse.ts +5 -3
- package/src/models/article.ts +1 -1
- package/src/models/{articlesearchresult.ts → articleaisearchresult.ts} +39 -37
- package/src/models/articletype.ts +1 -0
- package/src/models/createsuggestion.ts +13 -1
- package/src/models/{postportalidanswersop.ts → getbestanswerop.ts} +19 -12
- package/src/models/languagecodeparameter.ts +11 -0
- package/src/models/languagequeryparameter.ts +11 -0
- package/src/models/mandatorylanguagequeryparameter.ts +12 -0
- package/src/models/referenceresponse.ts +5 -5
- package/src/models/requiredlanguagecode.ts +48 -0
- package/src/models/{postportalidretrieveop.ts → retrievechunksop.ts} +19 -15
- package/src/models/retrieverequest.ts +2 -0
- package/src/models/retrieveresponse.ts +4 -2
- package/src/models/schemastags.ts +19 -0
- package/src/models/searchresult.ts +13 -9
- package/src/models/tag.ts +12 -0
- package/src/models/tags.ts +3 -6
- package/src/models/topicsummary.ts +3 -0
- package/src/models/wserrorcommon.ts +2 -2
- package/src/models/searchresponse.ts +0 -34
package/bin/mcp-server.js
CHANGED
|
@@ -4046,9 +4046,9 @@ var init_config = __esm(() => {
|
|
|
4046
4046
|
SDK_METADATA = {
|
|
4047
4047
|
language: "typescript",
|
|
4048
4048
|
openapiDocVersion: "1.0.0",
|
|
4049
|
-
sdkVersion: "1.0.
|
|
4049
|
+
sdkVersion: "1.0.22",
|
|
4050
4050
|
genVersion: "2.723.8",
|
|
4051
|
-
userAgent: "speakeasy-sdk/mcp-typescript 1.0.
|
|
4051
|
+
userAgent: "speakeasy-sdk/mcp-typescript 1.0.22 2.723.8 1.0.0 @egain/egain-mcp-server"
|
|
4052
4052
|
};
|
|
4053
4053
|
});
|
|
4054
4054
|
|
|
@@ -43078,8 +43078,8 @@ class PortalLookupHook {
|
|
|
43078
43078
|
// src/hooks/server-routing-hook.ts
|
|
43079
43079
|
class ServerRoutingHook {
|
|
43080
43080
|
aiServicesOperations = new Set([
|
|
43081
|
-
"
|
|
43082
|
-
"
|
|
43081
|
+
"getBestAnswer",
|
|
43082
|
+
"retrieveChunks"
|
|
43083
43083
|
]);
|
|
43084
43084
|
beforeCreateRequest(hookCtx, input) {
|
|
43085
43085
|
const operationID = hookCtx.operationID;
|
|
@@ -44765,6 +44765,7 @@ var init_articletype = __esm(() => {
|
|
|
44765
44765
|
"General",
|
|
44766
44766
|
"Guided Help",
|
|
44767
44767
|
"Data Link",
|
|
44768
|
+
"PDF Content",
|
|
44768
44769
|
"Topic Home",
|
|
44769
44770
|
"Suggestion",
|
|
44770
44771
|
"Virtual Assistant Action",
|
|
@@ -44919,13 +44920,23 @@ var init_taggroups = __esm(() => {
|
|
|
44919
44920
|
});
|
|
44920
44921
|
});
|
|
44921
44922
|
|
|
44923
|
+
// src/models/tag.ts
|
|
44924
|
+
var Tag$zodSchema;
|
|
44925
|
+
var init_tag = __esm(() => {
|
|
44926
|
+
init_zod();
|
|
44927
|
+
Tag$zodSchema = objectType({
|
|
44928
|
+
id: stringType().optional(),
|
|
44929
|
+
name: stringType().optional()
|
|
44930
|
+
});
|
|
44931
|
+
});
|
|
44932
|
+
|
|
44922
44933
|
// src/models/tags.ts
|
|
44923
44934
|
var Tags$zodSchema;
|
|
44924
44935
|
var init_tags = __esm(() => {
|
|
44925
44936
|
init_zod();
|
|
44937
|
+
init_tag();
|
|
44926
44938
|
Tags$zodSchema = objectType({
|
|
44927
|
-
|
|
44928
|
-
tags: arrayType(stringType()).optional()
|
|
44939
|
+
tag: arrayType(Tag$zodSchema).optional()
|
|
44929
44940
|
});
|
|
44930
44941
|
});
|
|
44931
44942
|
|
|
@@ -44984,8 +44995,10 @@ var init_personalization = __esm(() => {
|
|
|
44984
44995
|
var TopicSummary$zodSchema;
|
|
44985
44996
|
var init_topicsummary = __esm(() => {
|
|
44986
44997
|
init_zod();
|
|
44998
|
+
init_link();
|
|
44987
44999
|
TopicSummary$zodSchema = objectType({
|
|
44988
45000
|
id: stringType().optional(),
|
|
45001
|
+
link: Link$zodSchema.optional(),
|
|
44989
45002
|
name: stringType().optional()
|
|
44990
45003
|
}).describe("This schema contains the topic ID and name of the topics. This is used by TopicBreadcrumb.");
|
|
44991
45004
|
});
|
|
@@ -45144,6 +45157,17 @@ var init_languagequeryparameter = __esm(() => {
|
|
|
45144
45157
|
"hr-HR",
|
|
45145
45158
|
"ro-RO",
|
|
45146
45159
|
"th-TH",
|
|
45160
|
+
"de-AT",
|
|
45161
|
+
"vi-VN",
|
|
45162
|
+
"id-ID",
|
|
45163
|
+
"ms-MY",
|
|
45164
|
+
"fil-PH",
|
|
45165
|
+
"fr-CA",
|
|
45166
|
+
"hi-IN",
|
|
45167
|
+
"uk-UA",
|
|
45168
|
+
"bg-BG",
|
|
45169
|
+
"sl-SI",
|
|
45170
|
+
"sr-RS",
|
|
45147
45171
|
"xx-XX"
|
|
45148
45172
|
]).describe("The language that describes the details of a resource. Resources available in different languages may differ from each other.<li>If <code>$lang</code> is not passed, then the portal's default language is used.</li><br><br>**Important**: When using this API via SDK or MCP, use the parameter name `Dollar_lang`, not `$lang` or `lang`.");
|
|
45149
45173
|
});
|
|
@@ -45172,7 +45196,7 @@ var init_wserrorcommon = __esm(() => {
|
|
|
45172
45196
|
details: arrayType(lazyType(() => Detail$zodSchema)).optional(),
|
|
45173
45197
|
developerMessage: stringType(),
|
|
45174
45198
|
userMessage: stringType().optional()
|
|
45175
|
-
}).describe("
|
|
45199
|
+
}).describe("Bad Request");
|
|
45176
45200
|
});
|
|
45177
45201
|
|
|
45178
45202
|
// src/models/getannouncementarticlesop.ts
|
|
@@ -46047,7 +46071,19 @@ var init_mandatorylanguagequeryparameter = __esm(() => {
|
|
|
46047
46071
|
"ar-SA",
|
|
46048
46072
|
"hr-HR",
|
|
46049
46073
|
"ro-RO",
|
|
46050
|
-
"th-TH"
|
|
46074
|
+
"th-TH",
|
|
46075
|
+
"de-AT",
|
|
46076
|
+
"vi-VN",
|
|
46077
|
+
"id-ID",
|
|
46078
|
+
"ms-MY",
|
|
46079
|
+
"fil-PH",
|
|
46080
|
+
"fr-CA",
|
|
46081
|
+
"hi-IN",
|
|
46082
|
+
"uk-UA",
|
|
46083
|
+
"bg-BG",
|
|
46084
|
+
"sl-SI",
|
|
46085
|
+
"sr-RS",
|
|
46086
|
+
"xx-XX"
|
|
46051
46087
|
]).describe("The language used for fetching the details of a resource. Resources available in different languages may differ from each other. **Important**: When using this API via SDK or MCP, use the parameter name `Dollar_lang`, not `$lang` or `lang`.");
|
|
46052
46088
|
});
|
|
46053
46089
|
|
|
@@ -46310,10 +46346,22 @@ var init_createsuggestion = __esm(() => {
|
|
|
46310
46346
|
"da-DK",
|
|
46311
46347
|
"sv-SE",
|
|
46312
46348
|
"ru-RU",
|
|
46313
|
-
"fr-CA",
|
|
46314
46349
|
"zh-CN",
|
|
46315
46350
|
"ja-JP",
|
|
46316
|
-
"ko-KR"
|
|
46351
|
+
"ko-KR",
|
|
46352
|
+
"de-AT",
|
|
46353
|
+
"th-TH",
|
|
46354
|
+
"vi-VN",
|
|
46355
|
+
"id-ID",
|
|
46356
|
+
"ms-MY",
|
|
46357
|
+
"fil-PH",
|
|
46358
|
+
"fr-CA",
|
|
46359
|
+
"hi-IN",
|
|
46360
|
+
"uk-UA",
|
|
46361
|
+
"bg-BG",
|
|
46362
|
+
"sk-SK",
|
|
46363
|
+
"sl-SI",
|
|
46364
|
+
"sr-RS"
|
|
46317
46365
|
]).describe("The code of the language.");
|
|
46318
46366
|
Language$zodSchema = objectType({
|
|
46319
46367
|
code: Code$zodSchema
|
|
@@ -46481,35 +46529,65 @@ Users can submit suggestions with details about what they're looking for, which
|
|
|
46481
46529
|
});
|
|
46482
46530
|
|
|
46483
46531
|
// src/models/answersrequest.ts
|
|
46484
|
-
var AnswersRequestType$zodSchema, AnswersRequestChannel$zodSchema,
|
|
46532
|
+
var AnswersRequestType$zodSchema, AnswersRequestChannel$zodSchema, AnswersRequest$zodSchema;
|
|
46485
46533
|
var init_answersrequest = __esm(() => {
|
|
46486
46534
|
init_zod();
|
|
46487
46535
|
AnswersRequestType$zodSchema = enumType([
|
|
46488
46536
|
"portal",
|
|
46489
46537
|
"custom"
|
|
46490
|
-
]).describe(
|
|
46538
|
+
]).describe(`Optional channel type. Defaults to "portal" if omitted.
|
|
46539
|
+
` + `Accepts "portal" or "custom". Only include if channel object is provided.
|
|
46540
|
+
` + "");
|
|
46491
46541
|
AnswersRequestChannel$zodSchema = objectType({
|
|
46492
46542
|
name: stringType().default("portal"),
|
|
46493
46543
|
type: AnswersRequestType$zodSchema.default("portal")
|
|
46494
|
-
})
|
|
46495
|
-
|
|
46496
|
-
|
|
46497
|
-
|
|
46498
|
-
|
|
46499
|
-
|
|
46544
|
+
}).describe(`**Optional** channel information. **Recommended: Omit this field** unless specifically needed.
|
|
46545
|
+
` + `
|
|
46546
|
+
` + `**Important Notes:**
|
|
46547
|
+
` + `- The API works reliably without this field (defaults are applied automatically)
|
|
46548
|
+
` + `- Including channel may cause validation errors (400 Bad Request) in some cases
|
|
46549
|
+
` + `- If you receive a 400 error when including channel, retry the request without it
|
|
46550
|
+
` + `- When channel is provided, both type and name are optional, but name should be non-empty if provided
|
|
46551
|
+
` + `
|
|
46552
|
+
` + `**Working examples:**
|
|
46553
|
+
` + `- Omit channel entirely (recommended)
|
|
46554
|
+
` + `- channel: {type: "portal", name: "portal"}
|
|
46555
|
+
` + `- channel: {type: "custom", name: "test"}
|
|
46556
|
+
` + `- channel: {name: "portal"} (type defaults to "portal")
|
|
46557
|
+
` + "");
|
|
46500
46558
|
AnswersRequest$zodSchema = objectType({
|
|
46501
46559
|
channel: lazyType(() => AnswersRequestChannel$zodSchema).optional(),
|
|
46502
|
-
|
|
46560
|
+
clientSessionId: stringType().optional(),
|
|
46503
46561
|
eventId: stringType(),
|
|
46504
46562
|
sessionId: stringType()
|
|
46505
46563
|
});
|
|
46506
46564
|
});
|
|
46507
46565
|
|
|
46566
|
+
// src/models/aitopicsummary.ts
|
|
46567
|
+
var AITopicSummary$zodSchema;
|
|
46568
|
+
var init_aitopicsummary = __esm(() => {
|
|
46569
|
+
init_zod();
|
|
46570
|
+
AITopicSummary$zodSchema = objectType({
|
|
46571
|
+
id: stringType().optional(),
|
|
46572
|
+
name: stringType().optional()
|
|
46573
|
+
}).describe("This schema contains the topic ID and name of the topics. This is used by TopicBreadcrumb.");
|
|
46574
|
+
});
|
|
46575
|
+
|
|
46576
|
+
// src/models/aitopicbreadcrumb.ts
|
|
46577
|
+
var AITopicBreadcrumb$zodSchema;
|
|
46578
|
+
var init_aitopicbreadcrumb = __esm(() => {
|
|
46579
|
+
init_zod();
|
|
46580
|
+
init_aitopicsummary();
|
|
46581
|
+
AITopicBreadcrumb$zodSchema = objectType({
|
|
46582
|
+
topicSummary: arrayType(AITopicSummary$zodSchema).optional()
|
|
46583
|
+
}).describe("This schema contains one or more TopicSummary instances.");
|
|
46584
|
+
});
|
|
46585
|
+
|
|
46508
46586
|
// src/models/referenceresponse.ts
|
|
46509
46587
|
var ReferenceResponseDocType$zodSchema, ReferenceResponseSource$zodSchema, ReferenceResponse$zodSchema;
|
|
46510
46588
|
var init_referenceresponse = __esm(() => {
|
|
46511
46589
|
init_zod();
|
|
46512
|
-
|
|
46590
|
+
init_aitopicbreadcrumb();
|
|
46513
46591
|
ReferenceResponseDocType$zodSchema = enumType([
|
|
46514
46592
|
"HTML",
|
|
46515
46593
|
"DOCX",
|
|
@@ -46526,7 +46604,7 @@ var init_referenceresponse = __esm(() => {
|
|
|
46526
46604
|
id: stringType(),
|
|
46527
46605
|
name: stringType(),
|
|
46528
46606
|
source: ReferenceResponseSource$zodSchema,
|
|
46529
|
-
topicBreadcrumb: arrayType(
|
|
46607
|
+
topicBreadcrumb: arrayType(AITopicBreadcrumb$zodSchema).optional()
|
|
46530
46608
|
}).describe("One document used in generated response");
|
|
46531
46609
|
});
|
|
46532
46610
|
|
|
@@ -46534,7 +46612,7 @@ var init_referenceresponse = __esm(() => {
|
|
|
46534
46612
|
var SearchResultDocType$zodSchema, SearchResultSource$zodSchema, SearchResult$zodSchema;
|
|
46535
46613
|
var init_searchresult = __esm(() => {
|
|
46536
46614
|
init_zod();
|
|
46537
|
-
|
|
46615
|
+
init_aitopicbreadcrumb();
|
|
46538
46616
|
SearchResultDocType$zodSchema = enumType([
|
|
46539
46617
|
"HTML",
|
|
46540
46618
|
"DOCX",
|
|
@@ -46544,16 +46622,18 @@ var init_searchresult = __esm(() => {
|
|
|
46544
46622
|
SearchResultSource$zodSchema = enumType([
|
|
46545
46623
|
"eGain Article",
|
|
46546
46624
|
"eGain Attachment"
|
|
46547
|
-
]).describe("The repository or system where the content originated (e.g., eGain,
|
|
46625
|
+
]).describe("The repository or system where the content originated (e.g., eGain Article, eGain Attachment).");
|
|
46548
46626
|
SearchResult$zodSchema = objectType({
|
|
46627
|
+
contextualSummary: stringType().optional(),
|
|
46549
46628
|
docName: stringType().optional(),
|
|
46550
46629
|
docType: SearchResultDocType$zodSchema,
|
|
46551
46630
|
id: stringType(),
|
|
46552
46631
|
name: stringType(),
|
|
46553
|
-
|
|
46632
|
+
normalizedScore: numberType().optional(),
|
|
46633
|
+
relevanceScore: numberType().optional(),
|
|
46554
46634
|
snippet: stringType(),
|
|
46555
46635
|
source: SearchResultSource$zodSchema,
|
|
46556
|
-
topicBreadcrumb: arrayType(
|
|
46636
|
+
topicBreadcrumb: arrayType(AITopicBreadcrumb$zodSchema).optional()
|
|
46557
46637
|
}).describe("Represents a single document or snippet returned by search, along with its metadata and relevance score.");
|
|
46558
46638
|
});
|
|
46559
46639
|
|
|
@@ -46571,7 +46651,7 @@ var init_answersresponse = __esm(() => {
|
|
|
46571
46651
|
answerType: AnswersResponseAnswerType$zodSchema,
|
|
46572
46652
|
answerValue: stringType(),
|
|
46573
46653
|
references: arrayType(ReferenceResponse$zodSchema),
|
|
46574
|
-
relevanceScore: numberType()
|
|
46654
|
+
relevanceScore: numberType().optional()
|
|
46575
46655
|
});
|
|
46576
46656
|
AnswersResponseType$zodSchema = enumType([
|
|
46577
46657
|
"portal",
|
|
@@ -46584,17 +46664,18 @@ var init_answersresponse = __esm(() => {
|
|
|
46584
46664
|
AnswersResponse$zodSchema = objectType({
|
|
46585
46665
|
answer: lazyType(() => AnswersResponseAnswer$zodSchema),
|
|
46586
46666
|
channel: lazyType(() => AnswersResponseChannel$zodSchema).optional(),
|
|
46667
|
+
clientSessionId: stringType().optional(),
|
|
46587
46668
|
eventId: stringType().optional(),
|
|
46588
46669
|
searchResults: arrayType(SearchResult$zodSchema),
|
|
46589
46670
|
sessionId: stringType()
|
|
46590
46671
|
});
|
|
46591
46672
|
});
|
|
46592
46673
|
|
|
46593
|
-
// src/models/
|
|
46594
|
-
var
|
|
46595
|
-
var
|
|
46674
|
+
// src/models/requiredlanguagecode.ts
|
|
46675
|
+
var RequiredLanguageCode$zodSchema;
|
|
46676
|
+
var init_requiredlanguagecode = __esm(() => {
|
|
46596
46677
|
init_zod();
|
|
46597
|
-
|
|
46678
|
+
RequiredLanguageCode$zodSchema = enumType([
|
|
46598
46679
|
"en-US",
|
|
46599
46680
|
"fr-FR",
|
|
46600
46681
|
"en-GB",
|
|
@@ -46626,28 +46707,33 @@ var init_languagecodeparameter = __esm(() => {
|
|
|
46626
46707
|
"ro-RO",
|
|
46627
46708
|
"th-TH",
|
|
46628
46709
|
"xx-XX"
|
|
46629
|
-
]).describe("The language that describes the details of a resource. Resources available in different languages may differ from each other
|
|
46710
|
+
]).describe("The language that describes the details of a resource. Resources available in different languages may differ from each other.");
|
|
46630
46711
|
});
|
|
46631
46712
|
|
|
46632
|
-
// src/models/
|
|
46633
|
-
var
|
|
46634
|
-
var
|
|
46713
|
+
// src/models/getbestanswerop.ts
|
|
46714
|
+
var GetBestAnswerRequest$zodSchema, GetBestAnswerResponse$zodSchema;
|
|
46715
|
+
var init_getbestanswerop = __esm(() => {
|
|
46635
46716
|
init_zod();
|
|
46636
46717
|
init_answersrequest();
|
|
46637
46718
|
init_answersresponse();
|
|
46638
|
-
|
|
46639
|
-
|
|
46719
|
+
init_requiredlanguagecode();
|
|
46720
|
+
GetBestAnswerRequest$zodSchema = objectType({
|
|
46640
46721
|
AnswersRequest: AnswersRequest$zodSchema.optional(),
|
|
46641
|
-
Dollar_lang:
|
|
46722
|
+
Dollar_lang: RequiredLanguageCode$zodSchema,
|
|
46642
46723
|
dollarFilterTags: recordType(arrayType(stringType())).describe(`An object where each key is a **Category Tag ID** (numeric string),
|
|
46643
46724
|
` + `and each value is an array of **Tag IDs** for that category.
|
|
46725
|
+
` + ` **Note**:
|
|
46726
|
+
` + ` - The '$filter[tags]' query parameter JSON value should be url encoded.
|
|
46727
|
+
` + ` - Some developer tools for invoking APIs may not url encode the '$filter[tags]' query parameter JSON value by default. Ensure that only url encoded values are used.
|
|
46728
|
+
` + ` - Example of JSON value: {"BASE-40845":["BASE-40849","BASE-40853"]}
|
|
46729
|
+
` + ` - Example of URL encoded value: %7B%22BASE-40845%22%3A%5B%22BASE-40849%22%2C%22BASE-40853%22%5D%7D
|
|
46644
46730
|
` + "").optional(),
|
|
46645
|
-
dollarFilterTopicIds: arrayType(stringType()).optional(),
|
|
46731
|
+
dollarFilterTopicIds: arrayType(stringType()).describe("An array of topic IDs. It is used to restrict search results to specific topics.").optional(),
|
|
46646
46732
|
dollarFilterUserProfileID: stringType().optional(),
|
|
46647
46733
|
portalID: stringType().describe("The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits."),
|
|
46648
46734
|
q: stringType().describe("The search query string.")
|
|
46649
46735
|
});
|
|
46650
|
-
|
|
46736
|
+
GetBestAnswerResponse$zodSchema = objectType({
|
|
46651
46737
|
AnswersResponse: AnswersResponse$zodSchema.optional(),
|
|
46652
46738
|
ContentType: stringType(),
|
|
46653
46739
|
RawResponse: instanceOfType(Response),
|
|
@@ -46660,7 +46746,7 @@ function queryAnswers(client$, request, options) {
|
|
|
46660
46746
|
return new APIPromise($do6(client$, request, options));
|
|
46661
46747
|
}
|
|
46662
46748
|
async function $do6(client$, request, options) {
|
|
46663
|
-
const parsed$ = safeParse(request, (value$) =>
|
|
46749
|
+
const parsed$ = safeParse(request, (value$) => GetBestAnswerRequest$zodSchema.parse(value$), "Input validation failed");
|
|
46664
46750
|
if (!parsed$.ok) {
|
|
46665
46751
|
return [parsed$, { status: "invalid" }];
|
|
46666
46752
|
}
|
|
@@ -46689,7 +46775,7 @@ async function $do6(client$, request, options) {
|
|
|
46689
46775
|
const context = {
|
|
46690
46776
|
options: client$._options,
|
|
46691
46777
|
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
46692
|
-
operationID: "
|
|
46778
|
+
operationID: "getBestAnswer",
|
|
46693
46779
|
oAuth2Scopes: null,
|
|
46694
46780
|
resolvedSecurity: requestSecurity,
|
|
46695
46781
|
securitySource: client$._options.security,
|
|
@@ -46730,9 +46816,7 @@ async function $do6(client$, request, options) {
|
|
|
46730
46816
|
const responseFields$ = {
|
|
46731
46817
|
HttpMeta: { Response: response, Request: req$ }
|
|
46732
46818
|
};
|
|
46733
|
-
const [result$] = await match(json(200,
|
|
46734
|
-
key: "AnswersResponse"
|
|
46735
|
-
}), nil(400, PostPortalIDAnswersResponse$zodSchema), nil(500, PostPortalIDAnswersResponse$zodSchema))(response, req$, { extraFields: responseFields$ });
|
|
46819
|
+
const [result$] = await match(json(200, GetBestAnswerResponse$zodSchema, { key: "AnswersResponse" }), nil(400, GetBestAnswerResponse$zodSchema), nil(500, GetBestAnswerResponse$zodSchema))(response, req$, { extraFields: responseFields$ });
|
|
46736
46820
|
return [result$, { status: "complete", request: req$, response }];
|
|
46737
46821
|
}
|
|
46738
46822
|
var init_queryAnswers = __esm(() => {
|
|
@@ -46742,7 +46826,7 @@ var init_queryAnswers = __esm(() => {
|
|
|
46742
46826
|
init_schemas();
|
|
46743
46827
|
init_security();
|
|
46744
46828
|
init_url();
|
|
46745
|
-
|
|
46829
|
+
init_getbestanswerop();
|
|
46746
46830
|
init_async();
|
|
46747
46831
|
});
|
|
46748
46832
|
|
|
@@ -46750,14 +46834,14 @@ var init_queryAnswers = __esm(() => {
|
|
|
46750
46834
|
var args6, tool$queryAnswers;
|
|
46751
46835
|
var init_queryAnswers2 = __esm(() => {
|
|
46752
46836
|
init_queryAnswers();
|
|
46753
|
-
|
|
46837
|
+
init_getbestanswerop();
|
|
46754
46838
|
init_tools();
|
|
46755
46839
|
args6 = {
|
|
46756
|
-
request:
|
|
46840
|
+
request: GetBestAnswerRequest$zodSchema
|
|
46757
46841
|
};
|
|
46758
46842
|
tool$queryAnswers = {
|
|
46759
46843
|
name: "query-answers",
|
|
46760
|
-
description: `
|
|
46844
|
+
description: `Generate an Answer
|
|
46761
46845
|
|
|
46762
46846
|
Get Answers
|
|
46763
46847
|
|
|
@@ -46769,6 +46853,10 @@ Get Answers
|
|
|
46769
46853
|
The Answers API enables users to get the best answer for a user query. This API can return certified answers or generative answers along with search results, providing users with comprehensive responses to their questions.
|
|
46770
46854
|
|
|
46771
46855
|
The API leverages AI capabilities to provide intelligent answers based on the knowledge base content, making it easier for users to find the information they need quickly and accurately.
|
|
46856
|
+
|
|
46857
|
+
## Request Body Notes
|
|
46858
|
+
- **channel field**: Optional. **Recommended to omit** unless specifically needed. The API works reliably without it. If you receive a 400 Bad Request error when including channel, retry the request without the channel field.
|
|
46859
|
+
- **Required fields**: eventId and sessionId are required in the request body.
|
|
46772
46860
|
`,
|
|
46773
46861
|
annotations: {
|
|
46774
46862
|
destructiveHint: false,
|
|
@@ -46805,6 +46893,7 @@ var init_retrieverequest = __esm(() => {
|
|
|
46805
46893
|
});
|
|
46806
46894
|
RetrieveRequest$zodSchema = objectType({
|
|
46807
46895
|
channel: lazyType(() => RetrieveRequestChannel$zodSchema).optional(),
|
|
46896
|
+
clientSessionId: stringType().optional(),
|
|
46808
46897
|
eventId: stringType().optional(),
|
|
46809
46898
|
sessionId: stringType().optional()
|
|
46810
46899
|
});
|
|
@@ -46823,7 +46912,7 @@ var init_retrieveresponse = __esm(() => {
|
|
|
46823
46912
|
answerType: RetrieveResponseAnswerType$zodSchema,
|
|
46824
46913
|
answerValue: stringType(),
|
|
46825
46914
|
references: arrayType(ReferenceResponse$zodSchema),
|
|
46826
|
-
relevanceScore: numberType()
|
|
46915
|
+
relevanceScore: numberType().optional()
|
|
46827
46916
|
}).describe("If a certified answer is given. The answer object will be present. <br><br> This will be shown only if certified answers are configured and the certified answer meets the configured threshold.");
|
|
46828
46917
|
RetrieveResponseType$zodSchema = enumType([
|
|
46829
46918
|
"portal",
|
|
@@ -46836,37 +46925,41 @@ var init_retrieveresponse = __esm(() => {
|
|
|
46836
46925
|
RetrieveResponse$zodSchema = objectType({
|
|
46837
46926
|
answer: lazyType(() => RetrieveResponseAnswer$zodSchema).optional(),
|
|
46838
46927
|
channel: lazyType(() => RetrieveResponseChannel$zodSchema).optional(),
|
|
46928
|
+
clientSessionId: stringType().optional(),
|
|
46839
46929
|
eventId: stringType().optional(),
|
|
46840
46930
|
searchResults: arrayType(SearchResult$zodSchema),
|
|
46841
46931
|
sessionId: stringType()
|
|
46842
46932
|
});
|
|
46843
46933
|
});
|
|
46844
46934
|
|
|
46845
|
-
// src/models/
|
|
46846
|
-
var
|
|
46847
|
-
var
|
|
46935
|
+
// src/models/retrievechunksop.ts
|
|
46936
|
+
var RetrieveChunksRequest$zodSchema, RetrieveChunksResponse$zodSchema;
|
|
46937
|
+
var init_retrievechunksop = __esm(() => {
|
|
46848
46938
|
init_zod();
|
|
46849
|
-
|
|
46939
|
+
init_requiredlanguagecode();
|
|
46850
46940
|
init_retrieverequest();
|
|
46851
46941
|
init_retrieveresponse();
|
|
46852
|
-
|
|
46853
|
-
|
|
46854
|
-
Dollar_lang: LanguageCodeParameter$zodSchema.default("en-US"),
|
|
46942
|
+
RetrieveChunksRequest$zodSchema = objectType({
|
|
46943
|
+
Dollar_lang: RequiredLanguageCode$zodSchema,
|
|
46855
46944
|
RetrieveRequest: RetrieveRequest$zodSchema.optional(),
|
|
46856
46945
|
dollarFilterTags: recordType(arrayType(stringType())).describe(`An object where each key is a **Category Tag ID** (numeric string),
|
|
46857
46946
|
` + `and each value is an array of **Tag IDs** for that category.
|
|
46947
|
+
` + ` **Note**:
|
|
46948
|
+
` + ` - The '$filter[tags]' query parameter JSON value should be url encoded.
|
|
46949
|
+
` + ` - Some developer tools for invoking APIs may not url encode the '$filter[tags]' query parameter JSON value by default. Ensure that only url encoded values are used.
|
|
46950
|
+
` + ` - Example of JSON value: {"BASE-40845":["BASE-40849","BASE-40853"]}
|
|
46951
|
+
` + ` - Example of URL encoded value: %7B%22BASE-40845%22%3A%5B%22BASE-40849%22%2C%22BASE-40853%22%5D%7D
|
|
46858
46952
|
` + "").optional(),
|
|
46859
|
-
dollarFilterTopicIds: arrayType(stringType()).optional(),
|
|
46953
|
+
dollarFilterTopicIds: arrayType(stringType()).describe("An array of topic IDs. It is used to restrict search results to specific topics.").optional(),
|
|
46860
46954
|
dollarFilterUserProfileID: stringType().optional(),
|
|
46861
46955
|
portalID: stringType().describe("The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits."),
|
|
46862
46956
|
q: stringType().describe("The search query string.")
|
|
46863
46957
|
});
|
|
46864
|
-
|
|
46958
|
+
RetrieveChunksResponse$zodSchema = objectType({
|
|
46865
46959
|
ContentType: stringType(),
|
|
46866
46960
|
RawResponse: instanceOfType(Response),
|
|
46867
46961
|
RetrieveResponse: RetrieveResponse$zodSchema.optional(),
|
|
46868
|
-
StatusCode: numberType().int()
|
|
46869
|
-
WSErrorCommon: WSErrorCommon$zodSchema.optional()
|
|
46962
|
+
StatusCode: numberType().int()
|
|
46870
46963
|
});
|
|
46871
46964
|
});
|
|
46872
46965
|
|
|
@@ -46875,7 +46968,7 @@ function queryRetrieve(client$, request, options) {
|
|
|
46875
46968
|
return new APIPromise($do7(client$, request, options));
|
|
46876
46969
|
}
|
|
46877
46970
|
async function $do7(client$, request, options) {
|
|
46878
|
-
const parsed$ = safeParse(request, (value$) =>
|
|
46971
|
+
const parsed$ = safeParse(request, (value$) => RetrieveChunksRequest$zodSchema.parse(value$), "Input validation failed");
|
|
46879
46972
|
if (!parsed$.ok) {
|
|
46880
46973
|
return [parsed$, { status: "invalid" }];
|
|
46881
46974
|
}
|
|
@@ -46904,7 +46997,7 @@ async function $do7(client$, request, options) {
|
|
|
46904
46997
|
const context = {
|
|
46905
46998
|
options: client$._options,
|
|
46906
46999
|
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
46907
|
-
operationID: "
|
|
47000
|
+
operationID: "retrieveChunks",
|
|
46908
47001
|
oAuth2Scopes: null,
|
|
46909
47002
|
resolvedSecurity: requestSecurity,
|
|
46910
47003
|
securitySource: client$._options.security,
|
|
@@ -46945,13 +47038,7 @@ async function $do7(client$, request, options) {
|
|
|
46945
47038
|
const responseFields$ = {
|
|
46946
47039
|
HttpMeta: { Response: response, Request: req$ }
|
|
46947
47040
|
};
|
|
46948
|
-
const [result$] = await match(json(200,
|
|
46949
|
-
key: "RetrieveResponse"
|
|
46950
|
-
}), json(400, PostPortalIDRetrieveResponse$zodSchema, {
|
|
46951
|
-
key: "WSErrorCommon"
|
|
46952
|
-
}), json(500, PostPortalIDRetrieveResponse$zodSchema, {
|
|
46953
|
-
key: "WSErrorCommon"
|
|
46954
|
-
}))(response, req$, { extraFields: responseFields$ });
|
|
47041
|
+
const [result$] = await match(json(200, RetrieveChunksResponse$zodSchema, { key: "RetrieveResponse" }), nil(400, RetrieveChunksResponse$zodSchema), nil(500, RetrieveChunksResponse$zodSchema))(response, req$, { extraFields: responseFields$ });
|
|
46955
47042
|
return [result$, { status: "complete", request: req$, response }];
|
|
46956
47043
|
}
|
|
46957
47044
|
var init_queryRetrieve = __esm(() => {
|
|
@@ -46961,7 +47048,7 @@ var init_queryRetrieve = __esm(() => {
|
|
|
46961
47048
|
init_schemas();
|
|
46962
47049
|
init_security();
|
|
46963
47050
|
init_url();
|
|
46964
|
-
|
|
47051
|
+
init_retrievechunksop();
|
|
46965
47052
|
init_async();
|
|
46966
47053
|
});
|
|
46967
47054
|
|
|
@@ -46969,10 +47056,10 @@ var init_queryRetrieve = __esm(() => {
|
|
|
46969
47056
|
var args7, tool$queryRetrieve;
|
|
46970
47057
|
var init_queryRetrieve2 = __esm(() => {
|
|
46971
47058
|
init_queryRetrieve();
|
|
46972
|
-
|
|
47059
|
+
init_retrievechunksop();
|
|
46973
47060
|
init_tools();
|
|
46974
47061
|
args7 = {
|
|
46975
|
-
request:
|
|
47062
|
+
request: RetrieveChunksRequest$zodSchema
|
|
46976
47063
|
};
|
|
46977
47064
|
tool$queryRetrieve = {
|
|
46978
47065
|
name: "query-retrieve",
|
|
@@ -47012,6 +47099,19 @@ By leveraging the Retrieve API, organizations can build tailored experiences whi
|
|
|
47012
47099
|
};
|
|
47013
47100
|
});
|
|
47014
47101
|
|
|
47102
|
+
// src/models/aispaginationinfo.ts
|
|
47103
|
+
var AISPaginationInfo$zodSchema;
|
|
47104
|
+
var init_aispaginationinfo = __esm(() => {
|
|
47105
|
+
init_zod();
|
|
47106
|
+
init_link();
|
|
47107
|
+
AISPaginationInfo$zodSchema = objectType({
|
|
47108
|
+
count: numberType().int().default(1),
|
|
47109
|
+
link: arrayType(Link$zodSchema).optional(),
|
|
47110
|
+
pagenum: numberType().int().default(1),
|
|
47111
|
+
pagesize: numberType().int().default(20)
|
|
47112
|
+
});
|
|
47113
|
+
});
|
|
47114
|
+
|
|
47015
47115
|
// src/models/additionalsnippets.ts
|
|
47016
47116
|
var AdditionalSnippetsDocType$zodSchema, AdditionalSnippets$zodSchema;
|
|
47017
47117
|
var init_additionalsnippets = __esm(() => {
|
|
@@ -47028,99 +47128,173 @@ var init_additionalsnippets = __esm(() => {
|
|
|
47028
47128
|
id: stringType(),
|
|
47029
47129
|
keywordSnippet: stringType().optional(),
|
|
47030
47130
|
name: stringType(),
|
|
47031
|
-
|
|
47131
|
+
normalizedScore: numberType().optional(),
|
|
47132
|
+
relevanceScore: numberType().optional(),
|
|
47032
47133
|
snippet: stringType()
|
|
47033
47134
|
});
|
|
47034
47135
|
});
|
|
47035
47136
|
|
|
47036
|
-
// src/models/
|
|
47037
|
-
var
|
|
47038
|
-
var
|
|
47137
|
+
// src/models/schemastags.ts
|
|
47138
|
+
var SchemasTags$zodSchema;
|
|
47139
|
+
var init_schemastags = __esm(() => {
|
|
47140
|
+
init_zod();
|
|
47141
|
+
SchemasTags$zodSchema = objectType({
|
|
47142
|
+
id: stringType().optional(),
|
|
47143
|
+
tags: arrayType(stringType()).optional()
|
|
47144
|
+
});
|
|
47145
|
+
});
|
|
47146
|
+
|
|
47147
|
+
// src/models/articleaisearchresult.ts
|
|
47148
|
+
var ArticleAISearchResultDocType$zodSchema, ArticleAISearchResultSource$zodSchema, ArticleAISearchResultType$zodSchema, ArticleAISearchResultCustomAttribute$zodSchema, ArticleTypeAttributes$zodSchema, ArticleAISearchResult$zodSchema;
|
|
47149
|
+
var init_articleaisearchresult = __esm(() => {
|
|
47039
47150
|
init_zod();
|
|
47040
47151
|
init_additionalsnippets();
|
|
47041
|
-
|
|
47042
|
-
|
|
47043
|
-
|
|
47152
|
+
init_aitopicbreadcrumb();
|
|
47153
|
+
init_schemastags();
|
|
47154
|
+
ArticleAISearchResultDocType$zodSchema = enumType([
|
|
47044
47155
|
"HTML",
|
|
47045
47156
|
"DOCX",
|
|
47046
47157
|
"PDF",
|
|
47047
47158
|
"PPTX"
|
|
47048
47159
|
]).describe("Format of the source document (HTML, DOCX, PPTX or PDF).");
|
|
47049
|
-
|
|
47160
|
+
ArticleAISearchResultSource$zodSchema = enumType([
|
|
47050
47161
|
"eGain Article",
|
|
47051
47162
|
"eGain Attachment"
|
|
47052
47163
|
]).describe("The source type.");
|
|
47053
|
-
|
|
47164
|
+
ArticleAISearchResultType$zodSchema = enumType([
|
|
47054
47165
|
"STRING",
|
|
47055
47166
|
"INTEGER",
|
|
47056
47167
|
"BOOLEAN",
|
|
47057
47168
|
"DATETIME"
|
|
47058
47169
|
]).describe("The custom attribute's type.");
|
|
47059
|
-
|
|
47170
|
+
ArticleAISearchResultCustomAttribute$zodSchema = objectType({
|
|
47060
47171
|
name: stringType().optional(),
|
|
47061
|
-
type:
|
|
47172
|
+
type: ArticleAISearchResultType$zodSchema.optional(),
|
|
47062
47173
|
value: arrayType(stringType()).optional()
|
|
47063
47174
|
});
|
|
47064
47175
|
ArticleTypeAttributes$zodSchema = objectType({
|
|
47065
|
-
articleTypeId:
|
|
47176
|
+
articleTypeId: anyType().optional(),
|
|
47066
47177
|
typeName: stringType().optional()
|
|
47067
47178
|
}).describe("The type of the Article and its attributes.");
|
|
47068
|
-
|
|
47179
|
+
ArticleAISearchResult$zodSchema = objectType({
|
|
47069
47180
|
additionalSnippetCount: numberType().int().optional(),
|
|
47070
47181
|
additionalSnippets: arrayType(AdditionalSnippets$zodSchema).optional(),
|
|
47071
47182
|
articleTypeAttributes: lazyType(() => ArticleTypeAttributes$zodSchema).optional(),
|
|
47072
47183
|
contextualSummary: stringType().optional(),
|
|
47073
|
-
customAttributes: arrayType(lazyType(() =>
|
|
47184
|
+
customAttributes: arrayType(lazyType(() => ArticleAISearchResultCustomAttribute$zodSchema)).optional(),
|
|
47074
47185
|
docName: stringType().optional(),
|
|
47075
|
-
docType:
|
|
47186
|
+
docType: ArticleAISearchResultDocType$zodSchema,
|
|
47076
47187
|
headerPath: stringType().optional(),
|
|
47077
47188
|
id: stringType(),
|
|
47078
47189
|
keywordSnippet: stringType().optional(),
|
|
47079
47190
|
modifiedDate: stringType().optional(),
|
|
47080
47191
|
name: stringType(),
|
|
47081
|
-
|
|
47082
|
-
|
|
47083
|
-
|
|
47084
|
-
|
|
47085
|
-
|
|
47192
|
+
normalizedScore: numberType().optional(),
|
|
47193
|
+
relevanceScore: numberType().optional(),
|
|
47194
|
+
snippet: stringType(),
|
|
47195
|
+
source: ArticleAISearchResultSource$zodSchema,
|
|
47196
|
+
tagCategories: arrayType(SchemasTags$zodSchema).optional(),
|
|
47197
|
+
topicBreadcrumb: arrayType(AITopicBreadcrumb$zodSchema)
|
|
47086
47198
|
}).describe("Represents a single document or snippet returned by search, along with its metadata and relevance score.");
|
|
47087
47199
|
});
|
|
47088
47200
|
|
|
47089
|
-
// src/models/
|
|
47090
|
-
var SearchResults$zodSchema,
|
|
47091
|
-
var
|
|
47201
|
+
// src/models/aisearchresponse.ts
|
|
47202
|
+
var SearchResults$zodSchema, AISearchResponse$zodSchema;
|
|
47203
|
+
var init_aisearchresponse = __esm(() => {
|
|
47092
47204
|
init_zod();
|
|
47093
|
-
|
|
47205
|
+
init_aispaginationinfo();
|
|
47206
|
+
init_articleaisearchresult();
|
|
47094
47207
|
SearchResults$zodSchema = objectType({
|
|
47095
|
-
article: arrayType(
|
|
47208
|
+
article: arrayType(ArticleAISearchResult$zodSchema).optional()
|
|
47096
47209
|
}).describe("Top search results with relevance scores");
|
|
47097
|
-
|
|
47210
|
+
AISearchResponse$zodSchema = objectType({
|
|
47211
|
+
paginationInfo: AISPaginationInfo$zodSchema.optional(),
|
|
47098
47212
|
searchResults: lazyType(() => SearchResults$zodSchema)
|
|
47099
47213
|
});
|
|
47100
47214
|
});
|
|
47101
47215
|
|
|
47216
|
+
// src/models/languagecodeparameter.ts
|
|
47217
|
+
var LanguageCodeParameter$zodSchema;
|
|
47218
|
+
var init_languagecodeparameter = __esm(() => {
|
|
47219
|
+
init_zod();
|
|
47220
|
+
LanguageCodeParameter$zodSchema = enumType([
|
|
47221
|
+
"en-US",
|
|
47222
|
+
"fr-FR",
|
|
47223
|
+
"en-GB",
|
|
47224
|
+
"es-ES",
|
|
47225
|
+
"it-IT",
|
|
47226
|
+
"nl-NL",
|
|
47227
|
+
"da-DA",
|
|
47228
|
+
"sv-SE",
|
|
47229
|
+
"pt-PT",
|
|
47230
|
+
"fi-FI",
|
|
47231
|
+
"no-NB",
|
|
47232
|
+
"no-NN",
|
|
47233
|
+
"ja-JA",
|
|
47234
|
+
"de-DE",
|
|
47235
|
+
"pt-BR",
|
|
47236
|
+
"zh-CN",
|
|
47237
|
+
"zh-TW",
|
|
47238
|
+
"ko-KO",
|
|
47239
|
+
"ru-RU",
|
|
47240
|
+
"el-EL",
|
|
47241
|
+
"tr-TR",
|
|
47242
|
+
"pl-PL",
|
|
47243
|
+
"cs-CS",
|
|
47244
|
+
"sk-SK",
|
|
47245
|
+
"hu-HU",
|
|
47246
|
+
"sr-SR",
|
|
47247
|
+
"ar-SA",
|
|
47248
|
+
"hr-HR",
|
|
47249
|
+
"ro-RO",
|
|
47250
|
+
"th-TH",
|
|
47251
|
+
"de-AT",
|
|
47252
|
+
"vi-VN",
|
|
47253
|
+
"id-ID",
|
|
47254
|
+
"ms-MY",
|
|
47255
|
+
"fil-PH",
|
|
47256
|
+
"fr-CA",
|
|
47257
|
+
"hi-IN",
|
|
47258
|
+
"uk-UA",
|
|
47259
|
+
"bg-BG",
|
|
47260
|
+
"sl-SI",
|
|
47261
|
+
"sr-RS",
|
|
47262
|
+
"xx-XX"
|
|
47263
|
+
]).describe("The language that describes the details of a resource. Resources available in different languages may differ from each other.<li>If <code>$lang</code> is not passed, then the portal's default language is used.</li><br><br>**Important**: When using this API via SDK or MCP, use the parameter name `Dollar_lang`, not `$lang` or `lang`.");
|
|
47264
|
+
});
|
|
47265
|
+
|
|
47102
47266
|
// src/models/aisearchop.ts
|
|
47103
|
-
var AiSearchRequest$zodSchema,
|
|
47267
|
+
var AiSearchRequest$zodSchema, AiSearchResponseResponse$zodSchema;
|
|
47104
47268
|
var init_aisearchop = __esm(() => {
|
|
47105
47269
|
init_zod();
|
|
47270
|
+
init_aisearchresponse();
|
|
47106
47271
|
init_languagecodeparameter();
|
|
47107
|
-
|
|
47272
|
+
init_wserrorcommon();
|
|
47108
47273
|
AiSearchRequest$zodSchema = objectType({
|
|
47109
47274
|
Dollar_lang: LanguageCodeParameter$zodSchema.default("en-US"),
|
|
47275
|
+
Dollar_pagenum: numberType().int().default(1).describe("Pagination parameter that specifies the page number of results to be returned. Used in conjunction with $pagesize."),
|
|
47276
|
+
Dollar_pagesize: numberType().int().default(20).describe("Pagination parameter that specifies the number of results per page. Used in conjunction with $pagenum."),
|
|
47110
47277
|
articleCustomAdditionalAttributes: stringType().describe("One or more comma-separated names for article custom attributes defined by the user to be returned.").optional(),
|
|
47111
47278
|
dollarFilterTags: recordType(arrayType(stringType())).describe(`An object where each key is a **Category Tag ID** (numeric string),
|
|
47112
47279
|
` + `and each value is an array of **Tag IDs** for that category.
|
|
47280
|
+
` + ` **Note**:
|
|
47281
|
+
` + ` - The '$filter[tags]' query parameter JSON value should be url encoded.
|
|
47282
|
+
` + ` - Some developer tools for invoking APIs may not url encode the '$filter[tags]' query parameter JSON value by default. Ensure that only url encoded values are used.
|
|
47283
|
+
` + ` - Example of JSON value: {"BASE-40845":["BASE-40849","BASE-40853"]}
|
|
47284
|
+
` + ` - Example of URL encoded value: %7B%22BASE-40845%22%3A%5B%22BASE-40849%22%2C%22BASE-40853%22%5D%7D
|
|
47285
|
+
` + "").optional(),
|
|
47286
|
+
dollarFilterTopicIds: arrayType(stringType()).describe("An array of topic IDs. It is used to restrict search results to specific topics.").optional(),
|
|
47287
|
+
dollarFilterUserProfileID: stringType().describe(`The ID of the user profile.
|
|
47113
47288
|
` + "").optional(),
|
|
47114
|
-
dollarFilterTopicIds: arrayType(stringType()).optional(),
|
|
47115
|
-
dollarFilterUserProfileID: stringType().describe("The Readable ID of the user profile.").optional(),
|
|
47116
47289
|
portalID: stringType().describe("The ID of the portal being accessed.<br><br>A portal ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits."),
|
|
47117
|
-
q: stringType().describe("The search query string.")
|
|
47290
|
+
q: stringType().describe("The search query string. The string must be escaped as required by the URL syntax rules.")
|
|
47118
47291
|
});
|
|
47119
|
-
|
|
47292
|
+
AiSearchResponseResponse$zodSchema = objectType({
|
|
47293
|
+
AISearchResponse: AISearchResponse$zodSchema.optional(),
|
|
47120
47294
|
ContentType: stringType(),
|
|
47121
47295
|
RawResponse: instanceOfType(Response),
|
|
47122
|
-
|
|
47123
|
-
|
|
47296
|
+
StatusCode: numberType().int(),
|
|
47297
|
+
WSErrorCommon: WSErrorCommon$zodSchema.optional()
|
|
47124
47298
|
});
|
|
47125
47299
|
});
|
|
47126
47300
|
|
|
@@ -47147,6 +47321,8 @@ async function $do8(client$, request, options) {
|
|
|
47147
47321
|
"$filter[topicIds]": payload$.dollarFilterTopicIds,
|
|
47148
47322
|
"$filter[userProfileID]": payload$.dollarFilterUserProfileID,
|
|
47149
47323
|
$lang: payload$.Dollar_lang,
|
|
47324
|
+
$pagenum: payload$.Dollar_pagenum,
|
|
47325
|
+
$pagesize: payload$.Dollar_pagesize,
|
|
47150
47326
|
articleCustomAdditionalAttributes: payload$.articleCustomAdditionalAttributes,
|
|
47151
47327
|
q: payload$.q
|
|
47152
47328
|
});
|
|
@@ -47199,7 +47375,11 @@ async function $do8(client$, request, options) {
|
|
|
47199
47375
|
const responseFields$ = {
|
|
47200
47376
|
HttpMeta: { Response: response, Request: req$ }
|
|
47201
47377
|
};
|
|
47202
|
-
const [result$] = await match(json(200,
|
|
47378
|
+
const [result$] = await match(json(200, AiSearchResponseResponse$zodSchema, {
|
|
47379
|
+
key: "AISearchResponse"
|
|
47380
|
+
}), nil(204, AiSearchResponseResponse$zodSchema), json([400, 401, 403, 404, 406], AiSearchResponseResponse$zodSchema, {
|
|
47381
|
+
key: "WSErrorCommon"
|
|
47382
|
+
}), json(500, AiSearchResponseResponse$zodSchema, { key: "WSErrorCommon" }))(response, req$, { extraFields: responseFields$ });
|
|
47203
47383
|
return [result$, { status: "complete", request: req$, response }];
|
|
47204
47384
|
}
|
|
47205
47385
|
var init_querySearch = __esm(() => {
|
|
@@ -47224,7 +47404,7 @@ var init_querySearch2 = __esm(() => {
|
|
|
47224
47404
|
};
|
|
47225
47405
|
tool$querySearch = {
|
|
47226
47406
|
name: "query-search",
|
|
47227
|
-
description: `
|
|
47407
|
+
description: `Hybrid Search
|
|
47228
47408
|
|
|
47229
47409
|
The Search API is a hybrid search service that combines semantic understanding with keyword precision to deliver fast, contextual, and relevant results from your enterprise knowledge base. It enables secure, role-aware access to articles, FAQs, and documentation across customer, agent, and employee interfaces. Each query returns a ranked list of results with snippets, metadata, and relevance scores. <br>**This endpoint is only available for Self Service environments.**
|
|
47230
47410
|
`,
|
|
@@ -47253,7 +47433,7 @@ The Search API is a hybrid search service that combines semantic understanding w
|
|
|
47253
47433
|
function createMCPServer(deps) {
|
|
47254
47434
|
const server = new McpServer({
|
|
47255
47435
|
name: "EgainMcp",
|
|
47256
|
-
version: "1.0.
|
|
47436
|
+
version: "1.0.22"
|
|
47257
47437
|
});
|
|
47258
47438
|
const getClient = deps.getSDK || (() => new EgainMcpCore({
|
|
47259
47439
|
security: deps.security,
|
|
@@ -47273,14 +47453,14 @@ function createMCPServer(deps) {
|
|
|
47273
47453
|
const resourceTemplate = createRegisterResourceTemplate(deps.logger, server, getClient, scopes);
|
|
47274
47454
|
const prompt = createRegisterPrompt(deps.logger, server, getClient, scopes);
|
|
47275
47455
|
const register = { tool, resource, resourceTemplate, prompt };
|
|
47456
|
+
tool(tool$queryRetrieve);
|
|
47457
|
+
tool(tool$queryAnswers);
|
|
47276
47458
|
tool(tool$getArticle);
|
|
47277
47459
|
tool(tool$getAnnouncements);
|
|
47278
47460
|
tool(tool$getPopularArticles);
|
|
47279
47461
|
tool(tool$getPortals);
|
|
47280
|
-
tool(tool$makeSuggestion);
|
|
47281
|
-
tool(tool$queryAnswers);
|
|
47282
47462
|
tool(tool$querySearch);
|
|
47283
|
-
tool(tool$
|
|
47463
|
+
tool(tool$makeSuggestion);
|
|
47284
47464
|
return server;
|
|
47285
47465
|
}
|
|
47286
47466
|
var init_server2 = __esm(() => {
|
|
@@ -48500,7 +48680,7 @@ var routes = ln({
|
|
|
48500
48680
|
var app = _e(routes, {
|
|
48501
48681
|
name: "mcp",
|
|
48502
48682
|
versionInfo: {
|
|
48503
|
-
currentVersion: "1.0.
|
|
48683
|
+
currentVersion: "1.0.22"
|
|
48504
48684
|
}
|
|
48505
48685
|
});
|
|
48506
48686
|
Yt(app, process3.argv.slice(2), buildContext(process3));
|
|
@@ -48508,5 +48688,5 @@ export {
|
|
|
48508
48688
|
app
|
|
48509
48689
|
};
|
|
48510
48690
|
|
|
48511
|
-
//# debugId=
|
|
48691
|
+
//# debugId=02EDC3F243E098BE64756E2164756E21
|
|
48512
48692
|
//# sourceMappingURL=mcp-server.js.map
|