@xpert-ai/contracts 3.18.4 → 3.18.6
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/index.cjs.js +328 -127
- package/index.esm.js +312 -128
- package/package.json +1 -1
- package/src/ai/index.d.ts +5 -0
- package/src/ai/knowledge-chunking.model.d.ts +59 -0
- package/src/ai/knowledge-doc-chunk.model.d.ts +23 -0
- package/src/ai/knowledge-doc.model.d.ts +50 -1
- package/src/ai/knowledge-filter.model.d.ts +26 -1
- package/src/ai/knowledge-graph.model.d.ts +18 -1
- package/src/ai/knowledge-parser-selection.d.ts +13 -0
- package/src/ai/knowledge-parser.model.d.ts +5 -2
- package/src/ai/knowledge-pipeline.d.ts +12 -0
- package/src/ai/knowledge-question.model.d.ts +26 -0
- package/src/ai/knowledge-table.model.d.ts +72 -0
- package/src/ai/knowledge-tag.model.d.ts +32 -0
- package/src/ai/knowledgebase.model.d.ts +38 -8
- package/src/ai/mcp-publication.model.d.ts +9 -2
- package/src/tag-entity.model.d.ts +22 -0
- package/src/view-extension/model.d.ts +20 -0
package/index.cjs.js
CHANGED
|
@@ -87,30 +87,30 @@ function resolveI18nText(value) {
|
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
function _array_like_to_array$
|
|
90
|
+
function _array_like_to_array$b(arr, len) {
|
|
91
91
|
if (len == null || len > arr.length) len = arr.length;
|
|
92
92
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
93
93
|
return arr2;
|
|
94
94
|
}
|
|
95
|
-
function _array_without_holes$
|
|
96
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
95
|
+
function _array_without_holes$5(arr) {
|
|
96
|
+
if (Array.isArray(arr)) return _array_like_to_array$b(arr);
|
|
97
97
|
}
|
|
98
|
-
function _iterable_to_array$
|
|
98
|
+
function _iterable_to_array$7(iter) {
|
|
99
99
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
100
100
|
}
|
|
101
|
-
function _non_iterable_spread$
|
|
101
|
+
function _non_iterable_spread$5() {
|
|
102
102
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
103
103
|
}
|
|
104
|
-
function _to_consumable_array$
|
|
105
|
-
return _array_without_holes$
|
|
104
|
+
function _to_consumable_array$5(arr) {
|
|
105
|
+
return _array_without_holes$5(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$5();
|
|
106
106
|
}
|
|
107
|
-
function _unsupported_iterable_to_array$
|
|
107
|
+
function _unsupported_iterable_to_array$b(o, minLen) {
|
|
108
108
|
if (!o) return;
|
|
109
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
109
|
+
if (typeof o === "string") return _array_like_to_array$b(o, minLen);
|
|
110
110
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
111
111
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
112
112
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
113
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
113
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
|
|
114
114
|
}
|
|
115
115
|
var _uuidGenerator;
|
|
116
116
|
var uuidGenerator = new ShortUniqueId({
|
|
@@ -120,7 +120,7 @@ var uuid = function() {
|
|
|
120
120
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
121
121
|
args[_key] = arguments[_key];
|
|
122
122
|
}
|
|
123
|
-
return (_uuidGenerator = uuidGenerator).randomUUID.apply(_uuidGenerator, _to_consumable_array$
|
|
123
|
+
return (_uuidGenerator = uuidGenerator).randomUUID.apply(_uuidGenerator, _to_consumable_array$5(args));
|
|
124
124
|
};
|
|
125
125
|
// Parameters
|
|
126
126
|
exports.ParameterTypeEnum = void 0;
|
|
@@ -1224,7 +1224,7 @@ function toIsoString(value) {
|
|
|
1224
1224
|
return new Date().toISOString();
|
|
1225
1225
|
}
|
|
1226
1226
|
|
|
1227
|
-
function _array_like_to_array$
|
|
1227
|
+
function _array_like_to_array$a(arr, len) {
|
|
1228
1228
|
if (len == null || len > arr.length) len = arr.length;
|
|
1229
1229
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1230
1230
|
return arr2;
|
|
@@ -1232,8 +1232,8 @@ function _array_like_to_array$9(arr, len) {
|
|
|
1232
1232
|
function _array_with_holes$7(arr) {
|
|
1233
1233
|
if (Array.isArray(arr)) return arr;
|
|
1234
1234
|
}
|
|
1235
|
-
function _array_without_holes$
|
|
1236
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
1235
|
+
function _array_without_holes$4(arr) {
|
|
1236
|
+
if (Array.isArray(arr)) return _array_like_to_array$a(arr);
|
|
1237
1237
|
}
|
|
1238
1238
|
function _define_property$b(obj, key, value) {
|
|
1239
1239
|
if (key in obj) {
|
|
@@ -1248,7 +1248,7 @@ function _define_property$b(obj, key, value) {
|
|
|
1248
1248
|
}
|
|
1249
1249
|
return obj;
|
|
1250
1250
|
}
|
|
1251
|
-
function _iterable_to_array$
|
|
1251
|
+
function _iterable_to_array$6(iter) {
|
|
1252
1252
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1253
1253
|
}
|
|
1254
1254
|
function _iterable_to_array_limit$5(arr, i) {
|
|
@@ -1278,7 +1278,7 @@ function _iterable_to_array_limit$5(arr, i) {
|
|
|
1278
1278
|
function _non_iterable_rest$7() {
|
|
1279
1279
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1280
1280
|
}
|
|
1281
|
-
function _non_iterable_spread$
|
|
1281
|
+
function _non_iterable_spread$4() {
|
|
1282
1282
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1283
1283
|
}
|
|
1284
1284
|
function _object_spread$a(target) {
|
|
@@ -1316,18 +1316,18 @@ function _object_spread_props$7(target, source) {
|
|
|
1316
1316
|
return target;
|
|
1317
1317
|
}
|
|
1318
1318
|
function _sliced_to_array$5(arr, i) {
|
|
1319
|
-
return _array_with_holes$7(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$
|
|
1319
|
+
return _array_with_holes$7(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$7();
|
|
1320
1320
|
}
|
|
1321
|
-
function _to_consumable_array$
|
|
1322
|
-
return _array_without_holes$
|
|
1321
|
+
function _to_consumable_array$4(arr) {
|
|
1322
|
+
return _array_without_holes$4(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$4();
|
|
1323
1323
|
}
|
|
1324
|
-
function _unsupported_iterable_to_array$
|
|
1324
|
+
function _unsupported_iterable_to_array$a(o, minLen) {
|
|
1325
1325
|
if (!o) return;
|
|
1326
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1326
|
+
if (typeof o === "string") return _array_like_to_array$a(o, minLen);
|
|
1327
1327
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1328
1328
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1329
1329
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1330
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1330
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
1331
1331
|
}
|
|
1332
1332
|
exports.AssistantCode = void 0;
|
|
1333
1333
|
(function(AssistantCode) {
|
|
@@ -1503,7 +1503,7 @@ function updateAssistantBindingToolPreferences(preferences, sourceType, nodeKey,
|
|
|
1503
1503
|
var disabledTools = getAssistantBindingDisabledTools(normalizedPreferences, sourceType, normalizedNodeKey);
|
|
1504
1504
|
var nextDisabledTools = enabled ? disabledTools.filter(function(item) {
|
|
1505
1505
|
return item !== normalizedToolName;
|
|
1506
|
-
}) : normalizeAssistantBindingPreferenceIds(_to_consumable_array$
|
|
1506
|
+
}) : normalizeAssistantBindingPreferenceIds(_to_consumable_array$4(disabledTools).concat([
|
|
1507
1507
|
normalizedToolName
|
|
1508
1508
|
]));
|
|
1509
1509
|
var toolsets = normalizedPreferences.toolsets ? _object_spread$a({}, normalizedPreferences.toolsets) : undefined;
|
|
@@ -1568,7 +1568,7 @@ function updateAssistantBindingSkillPreferences(preferences, workspaceId, skillI
|
|
|
1568
1568
|
var disabledSkillIds = getAssistantBindingDisabledSkillIds(normalizedPreferences, normalizedWorkspaceId);
|
|
1569
1569
|
var nextDisabledSkillIds = enabled ? disabledSkillIds.filter(function(item) {
|
|
1570
1570
|
return item !== normalizedSkillId;
|
|
1571
|
-
}) : normalizeAssistantBindingPreferenceIds(_to_consumable_array$
|
|
1571
|
+
}) : normalizeAssistantBindingPreferenceIds(_to_consumable_array$4(disabledSkillIds).concat([
|
|
1572
1572
|
normalizedSkillId
|
|
1573
1573
|
]));
|
|
1574
1574
|
var skills = normalizedPreferences.skills ? _object_spread$a({}, normalizedPreferences.skills) : {};
|
|
@@ -2464,7 +2464,7 @@ var VariableOperations = [
|
|
|
2464
2464
|
}
|
|
2465
2465
|
];
|
|
2466
2466
|
|
|
2467
|
-
function _array_like_to_array$
|
|
2467
|
+
function _array_like_to_array$9(arr, len) {
|
|
2468
2468
|
if (len == null || len > arr.length) len = arr.length;
|
|
2469
2469
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2470
2470
|
return arr2;
|
|
@@ -2547,15 +2547,15 @@ function _object_spread_props$5(target, source) {
|
|
|
2547
2547
|
return target;
|
|
2548
2548
|
}
|
|
2549
2549
|
function _sliced_to_array$4(arr, i) {
|
|
2550
|
-
return _array_with_holes$6(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$
|
|
2550
|
+
return _array_with_holes$6(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$6();
|
|
2551
2551
|
}
|
|
2552
|
-
function _unsupported_iterable_to_array$
|
|
2552
|
+
function _unsupported_iterable_to_array$9(o, minLen) {
|
|
2553
2553
|
if (!o) return;
|
|
2554
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2554
|
+
if (typeof o === "string") return _array_like_to_array$9(o, minLen);
|
|
2555
2555
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2556
2556
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2557
2557
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2558
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
2558
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
|
|
2559
2559
|
}
|
|
2560
2560
|
/**
|
|
2561
2561
|
* @deprecated can use getCurrentTaskInput instead?
|
|
@@ -2912,7 +2912,120 @@ var _retrieval_recall_contentScope;
|
|
|
2912
2912
|
});
|
|
2913
2913
|
}
|
|
2914
2914
|
|
|
2915
|
-
|
|
2915
|
+
function _array_like_to_array$8(arr, len) {
|
|
2916
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
2917
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2918
|
+
return arr2;
|
|
2919
|
+
}
|
|
2920
|
+
function _array_without_holes$3(arr) {
|
|
2921
|
+
if (Array.isArray(arr)) return _array_like_to_array$8(arr);
|
|
2922
|
+
}
|
|
2923
|
+
function _iterable_to_array$5(iter) {
|
|
2924
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
2925
|
+
}
|
|
2926
|
+
function _non_iterable_spread$3() {
|
|
2927
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2928
|
+
}
|
|
2929
|
+
function _to_consumable_array$3(arr) {
|
|
2930
|
+
return _array_without_holes$3(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$3();
|
|
2931
|
+
}
|
|
2932
|
+
function _unsupported_iterable_to_array$8(o, minLen) {
|
|
2933
|
+
if (!o) return;
|
|
2934
|
+
if (typeof o === "string") return _array_like_to_array$8(o, minLen);
|
|
2935
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2936
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2937
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2938
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
|
|
2939
|
+
}
|
|
2940
|
+
var BUILTIN_KNOWLEDGE_PARSER = "builtin";
|
|
2941
|
+
/** Only formats with a real builtin reader; unknown binary formats are not advertised as text. */ var BUILTIN_KNOWLEDGE_FILE_TYPES = [
|
|
2942
|
+
"pdf",
|
|
2943
|
+
"docx",
|
|
2944
|
+
"pptx",
|
|
2945
|
+
"epub",
|
|
2946
|
+
"md",
|
|
2947
|
+
"mdx",
|
|
2948
|
+
"markdown",
|
|
2949
|
+
"txt",
|
|
2950
|
+
"json",
|
|
2951
|
+
"csv",
|
|
2952
|
+
"xls",
|
|
2953
|
+
"xlsx",
|
|
2954
|
+
"apng",
|
|
2955
|
+
"avif",
|
|
2956
|
+
"bmp",
|
|
2957
|
+
"gif",
|
|
2958
|
+
"heic",
|
|
2959
|
+
"heif",
|
|
2960
|
+
"jpeg",
|
|
2961
|
+
"jpg",
|
|
2962
|
+
"png",
|
|
2963
|
+
"svg",
|
|
2964
|
+
"tif",
|
|
2965
|
+
"tiff",
|
|
2966
|
+
"webp"
|
|
2967
|
+
];
|
|
2968
|
+
var MIME_SUBTYPE_EXTENSIONS = {
|
|
2969
|
+
plain: "txt",
|
|
2970
|
+
"x-rtf": "rtf",
|
|
2971
|
+
msword: "doc",
|
|
2972
|
+
"vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
|
|
2973
|
+
"vnd.ms-word.document.macroenabled.12": "docm",
|
|
2974
|
+
"vnd.openxmlformats-officedocument.presentationml.presentation": "pptx",
|
|
2975
|
+
"vnd.ms-powerpoint": "ppt",
|
|
2976
|
+
"vnd.ms-powerpoint.presentation.macroenabled.12": "pptm",
|
|
2977
|
+
"vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
|
|
2978
|
+
"vnd.ms-excel": "xls",
|
|
2979
|
+
"vnd.ms-excel.sheet.macroenabled.12": "xlsm",
|
|
2980
|
+
"vnd.oasis.opendocument.presentation": "odp",
|
|
2981
|
+
"vnd.oasis.opendocument.spreadsheet": "ods",
|
|
2982
|
+
"vnd.oasis.opendocument.text": "odt",
|
|
2983
|
+
"epub+zip": "epub",
|
|
2984
|
+
"x-mimearchive": "mhtml",
|
|
2985
|
+
rfc822: "mhtml",
|
|
2986
|
+
"x-markdown": "markdown",
|
|
2987
|
+
"x-png": "png",
|
|
2988
|
+
mpeg: "mp3",
|
|
2989
|
+
"x-wav": "wav",
|
|
2990
|
+
"x-m4a": "m4a",
|
|
2991
|
+
"x-flac": "flac",
|
|
2992
|
+
"vnd.xmind.workbook": "xmind"
|
|
2993
|
+
};
|
|
2994
|
+
function knowledgeDocumentFileType(document) {
|
|
2995
|
+
var value = document.type && document.type !== "unknown" ? document.type : document.mimeType;
|
|
2996
|
+
var _value_split__trim_toLowerCase_replace_replace;
|
|
2997
|
+
var subtype = (_value_split__trim_toLowerCase_replace_replace = value === null || value === void 0 ? void 0 : value.split(";")[0].trim().toLowerCase().replace(/^.*\//, "").replace(/^\./, "")) !== null && _value_split__trim_toLowerCase_replace_replace !== void 0 ? _value_split__trim_toLowerCase_replace_replace : "";
|
|
2998
|
+
return Object.prototype.hasOwnProperty.call(MIME_SUBTYPE_EXTENSIONS, subtype) ? MIME_SUBTYPE_EXTENSIONS[subtype] : subtype;
|
|
2999
|
+
}
|
|
3000
|
+
function knowledgebaseParserSelection(config, documentType) {
|
|
3001
|
+
var format = knowledgeDocumentFileType({
|
|
3002
|
+
type: documentType
|
|
3003
|
+
});
|
|
3004
|
+
if ((config === null || config === void 0 ? void 0 : config.parsers) && Object.prototype.hasOwnProperty.call(config.parsers, format)) {
|
|
3005
|
+
var _config_parsers_format;
|
|
3006
|
+
return (_config_parsers_format = config.parsers[format]) !== null && _config_parsers_format !== void 0 ? _config_parsers_format : undefined;
|
|
3007
|
+
}
|
|
3008
|
+
return format === "pdf" ? config === null || config === void 0 ? void 0 : config.pdfParser : undefined;
|
|
3009
|
+
}
|
|
3010
|
+
/** Existing uploader/importer defaults plus capabilities advertised by installed document parsers.
|
|
3011
|
+
* Explicit caller restrictions remain authoritative; this does not grant builtin parsing support.
|
|
3012
|
+
*/ function knowledgeUploadFileTypes(defaults, providers, accepts) {
|
|
3013
|
+
var candidates = (accepts === null || accepts === void 0 ? void 0 : accepts.length) ? accepts : _to_consumable_array$3(defaults).concat(_to_consumable_array$3(providers.flatMap(function(provider) {
|
|
3014
|
+
var _provider_supportedFileTypes;
|
|
3015
|
+
return (_provider_supportedFileTypes = provider.supportedFileTypes) !== null && _provider_supportedFileTypes !== void 0 ? _provider_supportedFileTypes : [];
|
|
3016
|
+
})));
|
|
3017
|
+
return _to_consumable_array$3(new Set(candidates.filter(function(type) {
|
|
3018
|
+
return /^\.?[a-z0-9]+$|^(application|text|image|audio|video)\/[a-z0-9.+-]+(?:;.*)?$/i.test(type.trim());
|
|
3019
|
+
}).map(function(type) {
|
|
3020
|
+
return knowledgeDocumentFileType({
|
|
3021
|
+
type: type
|
|
3022
|
+
});
|
|
3023
|
+
}).filter(function(type) {
|
|
3024
|
+
return /^[a-z0-9]+$/.test(type);
|
|
3025
|
+
})));
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
function _array_like_to_array$7(arr, len) {
|
|
2916
3029
|
if (len == null || len > arr.length) len = arr.length;
|
|
2917
3030
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2918
3031
|
return arr2;
|
|
@@ -2965,9 +3078,19 @@ function _unsupported_iterable_to_array$7(o, minLen) {
|
|
|
2965
3078
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2966
3079
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
|
|
2967
3080
|
}
|
|
2968
|
-
function knowledgebaseDocumentParserDefaults(config, documentType) {
|
|
3081
|
+
/** Only copy configured defaults; do not turn built-in defaults into document overrides. */ function knowledgebaseDocumentParserDefaults(config, documentType) {
|
|
2969
3082
|
if (!config) return {};
|
|
2970
|
-
return _object_spread$5({}, config.
|
|
3083
|
+
return _object_spread$5({}, config.spreadsheet ? {
|
|
3084
|
+
spreadsheet: _object_spread$5({}, config.spreadsheet)
|
|
3085
|
+
} : {}, config.tableMetadataRequirements !== undefined ? {
|
|
3086
|
+
tableMetadataRequirements: config.tableMetadataRequirements
|
|
3087
|
+
} : {}, config.questionGeneration ? {
|
|
3088
|
+
questionGeneration: _object_spread$5({}, config.questionGeneration)
|
|
3089
|
+
} : {}, config.chunkLanguageHint !== undefined ? {
|
|
3090
|
+
chunkLanguageHint: config.chunkLanguageHint
|
|
3091
|
+
} : {}, config.maxChunkTokens !== undefined ? {
|
|
3092
|
+
maxChunkTokens: config.maxChunkTokens
|
|
3093
|
+
} : {}, config.chunkSize != null ? {
|
|
2971
3094
|
chunkSize: config.chunkSize
|
|
2972
3095
|
} : {}, config.chunkOverlap != null ? {
|
|
2973
3096
|
chunkOverlap: config.chunkOverlap
|
|
@@ -2989,7 +3112,7 @@ function knowledgebaseDocumentParserDefaults(config, documentType) {
|
|
|
2989
3112
|
imageUnderstandingType: config.imageUnderstandingType
|
|
2990
3113
|
} : {}, config.imageUnderstanding ? {
|
|
2991
3114
|
imageUnderstanding: _object_spread$5({}, config.imageUnderstanding)
|
|
2992
|
-
} : {}, (documentType
|
|
3115
|
+
} : {}, knowledgebaseParserSelection(config, documentType !== null && documentType !== void 0 ? documentType : ""));
|
|
2993
3116
|
}
|
|
2994
3117
|
/** Arrays are the canonical ordered format; retain the plugin's legacy comma syntax. */ function decodeKnowledgeSeparators(value) {
|
|
2995
3118
|
var items = Array.isArray(value) ? value : value ? value.replace(/,,/g, "\x00").split(",").map(function(item) {
|
|
@@ -3016,100 +3139,6 @@ function knowledgebaseDocumentParserDefaults(config, documentType) {
|
|
|
3016
3139
|
});
|
|
3017
3140
|
}
|
|
3018
3141
|
|
|
3019
|
-
var KNOWLEDGE_FAQ_STANDARD_QUESTION_MAX_LENGTH = 500;
|
|
3020
|
-
var KNOWLEDGE_FAQ_SIMILAR_QUESTION_MAX_COUNT = 10;
|
|
3021
|
-
var KNOWLEDGE_FAQ_SIMILAR_QUESTION_MAX_LENGTH = 500;
|
|
3022
|
-
var KNOWLEDGE_FAQ_NEGATIVE_QUESTION_MAX_COUNT = 10;
|
|
3023
|
-
var KNOWLEDGE_FAQ_NEGATIVE_QUESTION_MAX_LENGTH = 500;
|
|
3024
|
-
var KNOWLEDGE_FAQ_ANSWER_BLOCK_MAX_COUNT = 5;
|
|
3025
|
-
var KNOWLEDGE_FAQ_ANSWER_TOTAL_MAX_LENGTH = 10000;
|
|
3026
|
-
var KNOWLEDGE_FAQ_MAX_LOGICAL_VECTOR_COUNT = 1 + KNOWLEDGE_FAQ_SIMILAR_QUESTION_MAX_COUNT + KNOWLEDGE_FAQ_ANSWER_BLOCK_MAX_COUNT;
|
|
3027
|
-
|
|
3028
|
-
var KNOWLEDGE_WIKI_SCHEMA_VERSION = 1;
|
|
3029
|
-
var KNOWLEDGE_WIKI_MAX_CUSTOM_INSTRUCTION_LENGTH = 4000;
|
|
3030
|
-
var DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG = {
|
|
3031
|
-
enabled: false,
|
|
3032
|
-
extractionGranularity: "standard",
|
|
3033
|
-
contentGenerationRequirements: "",
|
|
3034
|
-
extractionFocus: ""
|
|
3035
|
-
};
|
|
3036
|
-
function normalizeKnowledgebaseWikiConfig(config) {
|
|
3037
|
-
var _config_enabled, _config_extractionGranularity, _config_contentGenerationRequirements, _config_extractionFocus;
|
|
3038
|
-
return {
|
|
3039
|
-
enabled: (_config_enabled = config === null || config === void 0 ? void 0 : config.enabled) !== null && _config_enabled !== void 0 ? _config_enabled : DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG.enabled,
|
|
3040
|
-
extractionGranularity: (_config_extractionGranularity = config === null || config === void 0 ? void 0 : config.extractionGranularity) !== null && _config_extractionGranularity !== void 0 ? _config_extractionGranularity : DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG.extractionGranularity,
|
|
3041
|
-
contentGenerationRequirements: (_config_contentGenerationRequirements = config === null || config === void 0 ? void 0 : config.contentGenerationRequirements) !== null && _config_contentGenerationRequirements !== void 0 ? _config_contentGenerationRequirements : DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG.contentGenerationRequirements,
|
|
3042
|
-
extractionFocus: (_config_extractionFocus = config === null || config === void 0 ? void 0 : config.extractionFocus) !== null && _config_extractionFocus !== void 0 ? _config_extractionFocus : DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG.extractionFocus
|
|
3043
|
-
};
|
|
3044
|
-
}
|
|
3045
|
-
var KNOWLEDGE_WIKI_DOCUMENT_STATUS_BATCH_SIZE = 100;
|
|
3046
|
-
var KNOWLEDGE_WIKI_MAX_ALIASES = 20;
|
|
3047
|
-
var KNOWLEDGE_WIKI_MAX_FACTS = 100;
|
|
3048
|
-
var KNOWLEDGE_WIKI_MAX_SUGGESTED_LINKS = 50;
|
|
3049
|
-
var KNOWLEDGE_WIKI_MAX_SOURCE_CHUNKS_PER_FACT = 50;
|
|
3050
|
-
var KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH = 512;
|
|
3051
|
-
var KNOWLEDGE_WIKI_MAX_SUMMARY_LENGTH = 8000;
|
|
3052
|
-
var KNOWLEDGE_WIKI_MAX_FACT_LENGTH = 4000;
|
|
3053
|
-
function isBoundedString(value, maxLength) {
|
|
3054
|
-
var allowEmpty = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
3055
|
-
return typeof value === "string" && value.length <= maxLength && (allowEmpty || value.trim().length > 0);
|
|
3056
|
-
}
|
|
3057
|
-
function isBoundedStringArray(value, maxItems, maxItemLength) {
|
|
3058
|
-
return Array.isArray(value) && value.length <= maxItems && value.every(function(item) {
|
|
3059
|
-
return isBoundedString(item, maxItemLength);
|
|
3060
|
-
});
|
|
3061
|
-
}
|
|
3062
|
-
function isKnowledgeWikiFact(value) {
|
|
3063
|
-
var aggregated = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
3064
|
-
return !!value && typeof value === "object" && "text" in value && isBoundedString(value.text, KNOWLEDGE_WIKI_MAX_FACT_LENGTH) && "sourceChunkIds" in value && isBoundedStringArray(value.sourceChunkIds, aggregated ? Infinity : KNOWLEDGE_WIKI_MAX_SOURCE_CHUNKS_PER_FACT, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH) && value.sourceChunkIds.length > 0;
|
|
3065
|
-
}
|
|
3066
|
-
function isKnowledgeWikiSuggestedLink(value) {
|
|
3067
|
-
return !!value && typeof value === "object" && "targetType" in value && isWikiPageType(value.targetType) && "targetCanonicalName" in value && isBoundedString(value.targetCanonicalName, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH) && (!("label" in value) || value.label === undefined || isBoundedString(value.label, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH));
|
|
3068
|
-
}
|
|
3069
|
-
function isKnowledgeWikiPageContributionPayload(value) {
|
|
3070
|
-
return isWikiContribution(value, false);
|
|
3071
|
-
}
|
|
3072
|
-
function isKnowledgeWikiPageSourcePayload(value) {
|
|
3073
|
-
return isWikiContribution(value, true);
|
|
3074
|
-
}
|
|
3075
|
-
function isWikiContribution(value, aggregated) {
|
|
3076
|
-
return !!value && typeof value === "object" && "schemaVersion" in value && value.schemaVersion === KNOWLEDGE_WIKI_SCHEMA_VERSION && "pageType" in value && (value.pageType === "summary" || value.pageType === "entity" || value.pageType === "concept") && "canonicalName" in value && isBoundedString(value.canonicalName, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH) && "aliases" in value && isBoundedStringArray(value.aliases, aggregated ? Infinity : KNOWLEDGE_WIKI_MAX_ALIASES, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH) && "summary" in value && isBoundedString(value.summary, aggregated ? Infinity : KNOWLEDGE_WIKI_MAX_SUMMARY_LENGTH) && "facts" in value && Array.isArray(value.facts) && (aggregated || value.facts.length <= KNOWLEDGE_WIKI_MAX_FACTS) && value.facts.every(function(fact) {
|
|
3077
|
-
return isKnowledgeWikiFact(fact, aggregated);
|
|
3078
|
-
}) && "suggestedLinks" in value && Array.isArray(value.suggestedLinks) && (aggregated || value.suggestedLinks.length <= KNOWLEDGE_WIKI_MAX_SUGGESTED_LINKS) && value.suggestedLinks.every(isKnowledgeWikiSuggestedLink);
|
|
3079
|
-
}
|
|
3080
|
-
function isWikiPageType(value) {
|
|
3081
|
-
return value === "summary" || value === "entity" || value === "concept" || value === "index";
|
|
3082
|
-
}
|
|
3083
|
-
function isWikiProjectionStatus(value) {
|
|
3084
|
-
return value === "pending" || value === "ready" || value === "failed" || value === "disabled";
|
|
3085
|
-
}
|
|
3086
|
-
function isKnowledgeWikiChunkMetadata(value) {
|
|
3087
|
-
return !!value && typeof value === "object" && "chunkId" in value && typeof value.chunkId === "string" && "contentKind" in value && value.contentKind === "wiki" && "wikiPageId" in value && typeof value.wikiPageId === "string" && "wikiPageVersionId" in value && typeof value.wikiPageVersionId === "string" && "wikiPageKey" in value && typeof value.wikiPageKey === "string" && "wikiPageType" in value && isWikiPageType(value.wikiPageType) && "wikiRevision" in value && typeof value.wikiRevision === "number" && Number.isInteger(value.wikiRevision) && value.wikiRevision >= 0 && "sectionAnchor" in value && typeof value.sectionAnchor === "string" && "projectionStatus" in value && isWikiProjectionStatus(value.projectionStatus);
|
|
3088
|
-
}
|
|
3089
|
-
var KNOWLEDGE_WIKI_DEFAULT_PAGE_SIZE = 50;
|
|
3090
|
-
var KNOWLEDGE_WIKI_MAX_PAGE_SIZE = 100;
|
|
3091
|
-
var KNOWLEDGE_WIKI_MAX_SEARCH_LENGTH = 200;
|
|
3092
|
-
var KNOWLEDGE_WIKI_FAILED_CONTENT_RETENTION_DAYS = 7;
|
|
3093
|
-
var KNOWLEDGE_WIKI_OPERATION_RETENTION_DAYS = 30;
|
|
3094
|
-
var KNOWLEDGE_WIKI_DELETION_RECEIPT_RETENTION_DAYS = 90;
|
|
3095
|
-
var KNOWLEDGE_WIKI_STALE_VECTOR_CLEANUP_SLO_HOURS = 24;
|
|
3096
|
-
|
|
3097
|
-
var KNOWLEDGE_FILTER_VERSION = 2;
|
|
3098
|
-
var KNOWLEDGE_FILTER_MAX_DEPTH = 3;
|
|
3099
|
-
var KNOWLEDGE_FILTER_MAX_CONDITIONS = 20;
|
|
3100
|
-
var KNOWLEDGE_FILTER_MAX_SET_VALUES = 100;
|
|
3101
|
-
var KNOWLEDGE_FILTER_MAX_STRING_LENGTH = 512;
|
|
3102
|
-
var KNOWLEDGE_SYSTEM_FILTER_FIELDS = [
|
|
3103
|
-
"document.fileName",
|
|
3104
|
-
"document.folderPath",
|
|
3105
|
-
"document.fileExtension",
|
|
3106
|
-
"document.mimeType",
|
|
3107
|
-
"document.category",
|
|
3108
|
-
"document.sourceType",
|
|
3109
|
-
"document.createdAt",
|
|
3110
|
-
"document.updatedAt"
|
|
3111
|
-
];
|
|
3112
|
-
|
|
3113
3142
|
/**
|
|
3114
3143
|
* Category of document source provider
|
|
3115
3144
|
*/ exports.DocumentSourceProviderCategoryEnum = void 0;
|
|
@@ -3215,12 +3244,17 @@ exports.KBDocumentStatusEnum = void 0;
|
|
|
3215
3244
|
KBDocumentStatusEnum["FINISH"] = "finish";
|
|
3216
3245
|
KBDocumentStatusEnum["ERROR"] = "error";
|
|
3217
3246
|
})(exports.KBDocumentStatusEnum || (exports.KBDocumentStatusEnum = {}));
|
|
3247
|
+
var KNOWLEDGE_DOCUMENT_AGENT_WRITER_TYPE = "agent-writer";
|
|
3248
|
+
/** Agent publications are inspectable; internal Wiki/FAQ backing indexes stay hidden. */ function isKnowledgeDocumentVisible(metadata) {
|
|
3249
|
+
return (metadata === null || metadata === void 0 ? void 0 : metadata.systemManaged) !== true || metadata.systemManagedType === KNOWLEDGE_DOCUMENT_AGENT_WRITER_TYPE;
|
|
3250
|
+
}
|
|
3218
3251
|
function isDocumentSheet(type) {
|
|
3219
3252
|
return [
|
|
3220
3253
|
"csv",
|
|
3221
3254
|
"xls",
|
|
3222
3255
|
"xlsx",
|
|
3223
3256
|
"ods",
|
|
3257
|
+
"vnd.ms-excel",
|
|
3224
3258
|
"vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
3225
3259
|
].includes(type);
|
|
3226
3260
|
}
|
|
@@ -3300,6 +3334,134 @@ function classificateDocumentCategory(entity) {
|
|
|
3300
3334
|
}
|
|
3301
3335
|
];
|
|
3302
3336
|
|
|
3337
|
+
function isNativeKnowledgeTableDocument(document) {
|
|
3338
|
+
var _document_type, _document_parserConfig_spreadsheet, _document_parserConfig, _document_parserConfig1;
|
|
3339
|
+
var type = (_document_type = document.type) === null || _document_type === void 0 ? void 0 : _document_type.replace(/^\./, "").toLowerCase();
|
|
3340
|
+
return document.category === exports.KBDocumentCategoryEnum.Sheet && [
|
|
3341
|
+
"csv",
|
|
3342
|
+
"xls",
|
|
3343
|
+
"xlsx",
|
|
3344
|
+
"vnd.ms-excel",
|
|
3345
|
+
"vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
3346
|
+
].includes(type !== null && type !== void 0 ? type : "") && !document.sourceConfig && ((_document_parserConfig = document.parserConfig) === null || _document_parserConfig === void 0 ? void 0 : (_document_parserConfig_spreadsheet = _document_parserConfig.spreadsheet) === null || _document_parserConfig_spreadsheet === void 0 ? void 0 : _document_parserConfig_spreadsheet.interpretation) !== "form_document" && (!((_document_parserConfig1 = document.parserConfig) === null || _document_parserConfig1 === void 0 ? void 0 : _document_parserConfig1.transformerType) || document.parserConfig.transformerType === "default" || document.parserConfig.transformerType === "builtin");
|
|
3347
|
+
}
|
|
3348
|
+
/** Parse persisted JSON at the read boundary before using the shared result contract. */ function isKnowledgeTableMetadata(value) {
|
|
3349
|
+
return !!value && typeof value === "object" && "schemaVersion" in value && value.schemaVersion === 1 && "status" in value && typeof value.status === "string" && [
|
|
3350
|
+
"generating",
|
|
3351
|
+
"generated",
|
|
3352
|
+
"ready",
|
|
3353
|
+
"failed",
|
|
3354
|
+
"skipped"
|
|
3355
|
+
].includes(value.status) && "inputHash" in value && typeof value.inputHash === "string" && (!("sourceFingerprint" in value) || value.sourceFingerprint === undefined || typeof value.sourceFingerprint === "string") && (!("language" in value) || value.language === undefined || typeof value.language === "string" && /^[a-z]{2,3}$/.test(value.language)) && "generationId" in value && typeof value.generationId === "string" && "updatedAt" in value && typeof value.updatedAt === "string" && (!("resultHash" in value) || value.resultHash === undefined || typeof value.resultHash === "string") && (!("appliedResultHash" in value) || value.appliedResultHash === undefined || typeof value.appliedResultHash === "string") && (!("error" in value) || value.error === undefined || typeof value.error === "string") && (!("completedColumns" in value) || value.completedColumns === undefined || !!value.completedColumns && typeof value.completedColumns === "object" && !Array.isArray(value.completedColumns) && Object.values(value.completedColumns).every(function(columns) {
|
|
3356
|
+
return Array.isArray(columns) && columns.every(function(column) {
|
|
3357
|
+
return typeof column === "string";
|
|
3358
|
+
});
|
|
3359
|
+
})) && (!("reason" in value) || value.reason === undefined || value.reason === "missing_model" || value.reason === "no_data" || value.reason === "unsupported") && "tables" in value && Array.isArray(value.tables) && value.tables.every(isKnowledgeTableResult);
|
|
3360
|
+
}
|
|
3361
|
+
function isKnowledgeTableResult(value) {
|
|
3362
|
+
return !!value && typeof value === "object" && "tableId" in value && typeof value.tableId === "string" && "sheetName" in value && typeof value.sheetName === "string" && "range" in value && typeof value.range === "string" && "rowCount" in value && typeof value.rowCount === "number" && Number.isSafeInteger(value.rowCount) && value.rowCount >= 0 && (!("headerRow" in value) || value.headerRow === undefined || typeof value.headerRow === "number" && Number.isSafeInteger(value.headerRow)) && "summary" in value && typeof value.summary === "string" && "columns" in value && Array.isArray(value.columns) && value.columns.every(isKnowledgeTableColumnDescription);
|
|
3363
|
+
}
|
|
3364
|
+
function isKnowledgeTableColumnDescription(value) {
|
|
3365
|
+
return !!value && typeof value === "object" && (!("valueType" in value) || value.valueType === undefined || value.valueType === "boolean") && "columnId" in value && typeof value.columnId === "string" && "key" in value && typeof value.key === "string" && "label" in value && typeof value.label === "string" && "column" in value && typeof value.column === "number" && Number.isSafeInteger(value.column) && value.column > 0 && "description" in value && typeof value.description === "string" && (!("unit" in value) || value.unit === undefined || typeof value.unit === "string") && (!("valueMeanings" in value) || value.valueMeanings === undefined || typeof value.valueMeanings === "string");
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3368
|
+
/** Shared fallback for ordinary documents without an explicitly configured strategy. */ var DEFAULT_KNOWLEDGE_TEXT_SPLITTER = "auto";
|
|
3369
|
+
/** Shared revision for structured execution diagnostics and cache invalidation. */ var KNOWLEDGE_CHUNKING_ALGORITHM_VERSION = 5;
|
|
3370
|
+
|
|
3371
|
+
var KNOWLEDGE_FAQ_STANDARD_QUESTION_MAX_LENGTH = 500;
|
|
3372
|
+
var KNOWLEDGE_FAQ_SIMILAR_QUESTION_MAX_COUNT = 10;
|
|
3373
|
+
var KNOWLEDGE_FAQ_SIMILAR_QUESTION_MAX_LENGTH = 500;
|
|
3374
|
+
var KNOWLEDGE_FAQ_NEGATIVE_QUESTION_MAX_COUNT = 10;
|
|
3375
|
+
var KNOWLEDGE_FAQ_NEGATIVE_QUESTION_MAX_LENGTH = 500;
|
|
3376
|
+
var KNOWLEDGE_FAQ_ANSWER_BLOCK_MAX_COUNT = 5;
|
|
3377
|
+
var KNOWLEDGE_FAQ_ANSWER_TOTAL_MAX_LENGTH = 10000;
|
|
3378
|
+
var KNOWLEDGE_FAQ_MAX_LOGICAL_VECTOR_COUNT = 1 + KNOWLEDGE_FAQ_SIMILAR_QUESTION_MAX_COUNT + KNOWLEDGE_FAQ_ANSWER_BLOCK_MAX_COUNT;
|
|
3379
|
+
|
|
3380
|
+
var KNOWLEDGE_WIKI_SCHEMA_VERSION = 1;
|
|
3381
|
+
var KNOWLEDGE_WIKI_MAX_CUSTOM_INSTRUCTION_LENGTH = 4000;
|
|
3382
|
+
var DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG = {
|
|
3383
|
+
enabled: false,
|
|
3384
|
+
extractionGranularity: "standard",
|
|
3385
|
+
contentGenerationRequirements: "",
|
|
3386
|
+
extractionFocus: ""
|
|
3387
|
+
};
|
|
3388
|
+
function normalizeKnowledgebaseWikiConfig(config) {
|
|
3389
|
+
var _config_enabled, _config_extractionGranularity, _config_contentGenerationRequirements, _config_extractionFocus;
|
|
3390
|
+
return {
|
|
3391
|
+
enabled: (_config_enabled = config === null || config === void 0 ? void 0 : config.enabled) !== null && _config_enabled !== void 0 ? _config_enabled : DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG.enabled,
|
|
3392
|
+
extractionGranularity: (_config_extractionGranularity = config === null || config === void 0 ? void 0 : config.extractionGranularity) !== null && _config_extractionGranularity !== void 0 ? _config_extractionGranularity : DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG.extractionGranularity,
|
|
3393
|
+
contentGenerationRequirements: (_config_contentGenerationRequirements = config === null || config === void 0 ? void 0 : config.contentGenerationRequirements) !== null && _config_contentGenerationRequirements !== void 0 ? _config_contentGenerationRequirements : DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG.contentGenerationRequirements,
|
|
3394
|
+
extractionFocus: (_config_extractionFocus = config === null || config === void 0 ? void 0 : config.extractionFocus) !== null && _config_extractionFocus !== void 0 ? _config_extractionFocus : DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG.extractionFocus
|
|
3395
|
+
};
|
|
3396
|
+
}
|
|
3397
|
+
var KNOWLEDGE_WIKI_DOCUMENT_STATUS_BATCH_SIZE = 100;
|
|
3398
|
+
var KNOWLEDGE_WIKI_MAX_ALIASES = 20;
|
|
3399
|
+
var KNOWLEDGE_WIKI_MAX_FACTS = 100;
|
|
3400
|
+
var KNOWLEDGE_WIKI_MAX_SUGGESTED_LINKS = 50;
|
|
3401
|
+
var KNOWLEDGE_WIKI_MAX_SOURCE_CHUNKS_PER_FACT = 50;
|
|
3402
|
+
var KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH = 512;
|
|
3403
|
+
var KNOWLEDGE_WIKI_MAX_SUMMARY_LENGTH = 8000;
|
|
3404
|
+
var KNOWLEDGE_WIKI_MAX_FACT_LENGTH = 4000;
|
|
3405
|
+
function isBoundedString(value, maxLength) {
|
|
3406
|
+
var allowEmpty = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
3407
|
+
return typeof value === "string" && value.length <= maxLength && (allowEmpty || value.trim().length > 0);
|
|
3408
|
+
}
|
|
3409
|
+
function isBoundedStringArray(value, maxItems, maxItemLength) {
|
|
3410
|
+
return Array.isArray(value) && value.length <= maxItems && value.every(function(item) {
|
|
3411
|
+
return isBoundedString(item, maxItemLength);
|
|
3412
|
+
});
|
|
3413
|
+
}
|
|
3414
|
+
function isKnowledgeWikiFact(value) {
|
|
3415
|
+
var aggregated = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
3416
|
+
return !!value && typeof value === "object" && "text" in value && isBoundedString(value.text, KNOWLEDGE_WIKI_MAX_FACT_LENGTH) && "sourceChunkIds" in value && isBoundedStringArray(value.sourceChunkIds, aggregated ? Infinity : KNOWLEDGE_WIKI_MAX_SOURCE_CHUNKS_PER_FACT, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH) && value.sourceChunkIds.length > 0;
|
|
3417
|
+
}
|
|
3418
|
+
function isKnowledgeWikiSuggestedLink(value) {
|
|
3419
|
+
return !!value && typeof value === "object" && "targetType" in value && isWikiPageType(value.targetType) && "targetCanonicalName" in value && isBoundedString(value.targetCanonicalName, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH) && (!("label" in value) || value.label === undefined || isBoundedString(value.label, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH));
|
|
3420
|
+
}
|
|
3421
|
+
function isKnowledgeWikiPageContributionPayload(value) {
|
|
3422
|
+
return isWikiContribution(value, false);
|
|
3423
|
+
}
|
|
3424
|
+
function isKnowledgeWikiPageSourcePayload(value) {
|
|
3425
|
+
return isWikiContribution(value, true);
|
|
3426
|
+
}
|
|
3427
|
+
function isWikiContribution(value, aggregated) {
|
|
3428
|
+
return !!value && typeof value === "object" && "schemaVersion" in value && value.schemaVersion === KNOWLEDGE_WIKI_SCHEMA_VERSION && "pageType" in value && (value.pageType === "summary" || value.pageType === "entity" || value.pageType === "concept") && "canonicalName" in value && isBoundedString(value.canonicalName, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH) && "aliases" in value && isBoundedStringArray(value.aliases, aggregated ? Infinity : KNOWLEDGE_WIKI_MAX_ALIASES, KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH) && "summary" in value && isBoundedString(value.summary, aggregated ? Infinity : KNOWLEDGE_WIKI_MAX_SUMMARY_LENGTH) && "facts" in value && Array.isArray(value.facts) && (aggregated || value.facts.length <= KNOWLEDGE_WIKI_MAX_FACTS) && value.facts.every(function(fact) {
|
|
3429
|
+
return isKnowledgeWikiFact(fact, aggregated);
|
|
3430
|
+
}) && "suggestedLinks" in value && Array.isArray(value.suggestedLinks) && (aggregated || value.suggestedLinks.length <= KNOWLEDGE_WIKI_MAX_SUGGESTED_LINKS) && value.suggestedLinks.every(isKnowledgeWikiSuggestedLink);
|
|
3431
|
+
}
|
|
3432
|
+
function isWikiPageType(value) {
|
|
3433
|
+
return value === "summary" || value === "entity" || value === "concept" || value === "index";
|
|
3434
|
+
}
|
|
3435
|
+
function isWikiProjectionStatus(value) {
|
|
3436
|
+
return value === "pending" || value === "ready" || value === "failed" || value === "disabled";
|
|
3437
|
+
}
|
|
3438
|
+
function isKnowledgeWikiChunkMetadata(value) {
|
|
3439
|
+
return !!value && typeof value === "object" && "chunkId" in value && typeof value.chunkId === "string" && "contentKind" in value && value.contentKind === "wiki" && "wikiPageId" in value && typeof value.wikiPageId === "string" && "wikiPageVersionId" in value && typeof value.wikiPageVersionId === "string" && "wikiPageKey" in value && typeof value.wikiPageKey === "string" && "wikiPageType" in value && isWikiPageType(value.wikiPageType) && "wikiRevision" in value && typeof value.wikiRevision === "number" && Number.isInteger(value.wikiRevision) && value.wikiRevision >= 0 && "sectionAnchor" in value && typeof value.sectionAnchor === "string" && "projectionStatus" in value && isWikiProjectionStatus(value.projectionStatus);
|
|
3440
|
+
}
|
|
3441
|
+
var KNOWLEDGE_WIKI_DEFAULT_PAGE_SIZE = 50;
|
|
3442
|
+
var KNOWLEDGE_WIKI_MAX_PAGE_SIZE = 100;
|
|
3443
|
+
var KNOWLEDGE_WIKI_MAX_SEARCH_LENGTH = 200;
|
|
3444
|
+
var KNOWLEDGE_WIKI_FAILED_CONTENT_RETENTION_DAYS = 7;
|
|
3445
|
+
var KNOWLEDGE_WIKI_OPERATION_RETENTION_DAYS = 30;
|
|
3446
|
+
var KNOWLEDGE_WIKI_DELETION_RECEIPT_RETENTION_DAYS = 90;
|
|
3447
|
+
var KNOWLEDGE_WIKI_STALE_VECTOR_CLEANUP_SLO_HOURS = 24;
|
|
3448
|
+
|
|
3449
|
+
var KNOWLEDGE_FILTER_VERSION = 2;
|
|
3450
|
+
var KNOWLEDGE_FILTER_MAX_DEPTH = 3;
|
|
3451
|
+
var KNOWLEDGE_FILTER_MAX_CONDITIONS = 20;
|
|
3452
|
+
var KNOWLEDGE_FILTER_MAX_SET_VALUES = 100;
|
|
3453
|
+
var KNOWLEDGE_FILTER_MAX_STRING_LENGTH = 512;
|
|
3454
|
+
var KNOWLEDGE_SYSTEM_FILTER_FIELDS = [
|
|
3455
|
+
"document.fileName",
|
|
3456
|
+
"document.folderPath",
|
|
3457
|
+
"document.fileExtension",
|
|
3458
|
+
"document.mimeType",
|
|
3459
|
+
"document.category",
|
|
3460
|
+
"document.sourceType",
|
|
3461
|
+
"document.createdAt",
|
|
3462
|
+
"document.updatedAt"
|
|
3463
|
+
];
|
|
3464
|
+
|
|
3303
3465
|
exports.AIPermissionsEnum = void 0;
|
|
3304
3466
|
(function(AIPermissionsEnum) {
|
|
3305
3467
|
/**
|
|
@@ -5894,6 +6056,7 @@ var MCP_PROTOCOL_VERSION = "2026-07-28";
|
|
|
5894
6056
|
var MCP_TASK_EXTENSION_ID = "io.modelcontextprotocol/tasks";
|
|
5895
6057
|
var MCP_HTTP_CORS_REQUEST_HEADERS = [
|
|
5896
6058
|
"MCP-Protocol-Version",
|
|
6059
|
+
"Mcp-Session-Id",
|
|
5897
6060
|
"Mcp-Method",
|
|
5898
6061
|
"Mcp-Name",
|
|
5899
6062
|
"Traceparent",
|
|
@@ -5904,6 +6067,7 @@ var MCP_HTTP_CORS_REQUEST_HEADERS = [
|
|
|
5904
6067
|
var MCP_HTTP_CORS_EXPOSED_HEADERS = [
|
|
5905
6068
|
"WWW-Authenticate",
|
|
5906
6069
|
"MCP-Protocol-Version",
|
|
6070
|
+
"Mcp-Session-Id",
|
|
5907
6071
|
"X-Request-Id"
|
|
5908
6072
|
];
|
|
5909
6073
|
var MCP_PUBLICATION_STATUSES = [
|
|
@@ -5944,6 +6108,10 @@ var MCP_INVOCATION_STATUSES = [
|
|
|
5944
6108
|
"denied"
|
|
5945
6109
|
];
|
|
5946
6110
|
|
|
6111
|
+
var KNOWLEDGE_AUTOMATIC_TAG_CANDIDATES = 50;
|
|
6112
|
+
var KNOWLEDGE_AUTOMATIC_TAG_MAXIMUM = 10;
|
|
6113
|
+
var KNOWLEDGE_AUTOMATIC_TAG_TEXT_BUDGET = 12000;
|
|
6114
|
+
|
|
5947
6115
|
var STATE_VARIABLE_HUMAN = "human";
|
|
5948
6116
|
|
|
5949
6117
|
exports.PermissionsEnum = void 0;
|
|
@@ -6047,6 +6215,12 @@ var PermissionGroups = {
|
|
|
6047
6215
|
]
|
|
6048
6216
|
};
|
|
6049
6217
|
|
|
6218
|
+
function getTagTargets(tag) {
|
|
6219
|
+
var _tag_targets;
|
|
6220
|
+
return ((_tag_targets = tag.targets) === null || _tag_targets === void 0 ? void 0 : _tag_targets.length) ? tag.targets : tag.category ? [
|
|
6221
|
+
tag.category
|
|
6222
|
+
] : [];
|
|
6223
|
+
}
|
|
6050
6224
|
exports.TagCategoryEnum = void 0;
|
|
6051
6225
|
(function(TagCategoryEnum) {
|
|
6052
6226
|
TagCategoryEnum["INDICATOR"] = "indicator";
|
|
@@ -6054,6 +6228,15 @@ exports.TagCategoryEnum = void 0;
|
|
|
6054
6228
|
TagCategoryEnum["TOOLSET"] = "toolset";
|
|
6055
6229
|
TagCategoryEnum["XPERT"] = "xpert";
|
|
6056
6230
|
})(exports.TagCategoryEnum || (exports.TagCategoryEnum = {}));
|
|
6231
|
+
var TAG_TARGETS = [
|
|
6232
|
+
exports.TagCategoryEnum.XPERT,
|
|
6233
|
+
"knowledgebase",
|
|
6234
|
+
exports.TagCategoryEnum.TOOLSET,
|
|
6235
|
+
exports.TagCategoryEnum.INDICATOR,
|
|
6236
|
+
exports.TagCategoryEnum.STORY,
|
|
6237
|
+
"people",
|
|
6238
|
+
"integration"
|
|
6239
|
+
];
|
|
6057
6240
|
|
|
6058
6241
|
var DEFAULT_TENANT = "Default Tenant";
|
|
6059
6242
|
|
|
@@ -6930,6 +7113,7 @@ var WORKBENCH_EXTENSION_VIEW_TARGET = "workbench.view";
|
|
|
6930
7113
|
var XPERT_REMOTE_COMPONENT_INVOKE_CLIENT_COMMAND_MESSAGE_TYPE = "invokeClientCommand";
|
|
6931
7114
|
var ASSISTANT_CITATION_OPEN_EVENT = "assistant.citation.open";
|
|
6932
7115
|
var KNOWLEDGEBASE_OPEN_CITATION_EFFECT = "knowledgebase.open_citation";
|
|
7116
|
+
/** Append text selections to the current draft without sending or replacing it. */ var ASSISTANT_COMPOSER_APPEND_REFERENCES_COMMAND = "assistant.composer.append_references";
|
|
6933
7117
|
|
|
6934
7118
|
var AGENT_PROFILE_TABS_SLOT = "agent.profile.tabs";
|
|
6935
7119
|
|
|
@@ -6940,9 +7124,12 @@ exports.AI_MODEL_TYPE_VARIABLE = AI_MODEL_TYPE_VARIABLE;
|
|
|
6940
7124
|
exports.API_PRINCIPAL_USER_ID_HEADER = API_PRINCIPAL_USER_ID_HEADER;
|
|
6941
7125
|
exports.ASSISTANT_CHAT_SEND_MESSAGE_COMMAND = ASSISTANT_CHAT_SEND_MESSAGE_COMMAND;
|
|
6942
7126
|
exports.ASSISTANT_CITATION_OPEN_EVENT = ASSISTANT_CITATION_OPEN_EVENT;
|
|
7127
|
+
exports.ASSISTANT_COMPOSER_APPEND_REFERENCES_COMMAND = ASSISTANT_COMPOSER_APPEND_REFERENCES_COMMAND;
|
|
6943
7128
|
exports.ASSISTANT_CONTEXT_SET_COMMAND = ASSISTANT_CONTEXT_SET_COMMAND;
|
|
6944
7129
|
exports.ASSISTANT_USER_PREFERENCES_VERSION = ASSISTANT_USER_PREFERENCES_VERSION;
|
|
6945
7130
|
exports.Attachment_Type_Options = Attachment_Type_Options;
|
|
7131
|
+
exports.BUILTIN_KNOWLEDGE_FILE_TYPES = BUILTIN_KNOWLEDGE_FILE_TYPES;
|
|
7132
|
+
exports.BUILTIN_KNOWLEDGE_PARSER = BUILTIN_KNOWLEDGE_PARSER;
|
|
6946
7133
|
exports.CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY;
|
|
6947
7134
|
exports.CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED;
|
|
6948
7135
|
exports.CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE;
|
|
@@ -6963,6 +7150,7 @@ exports.DEFAULT_KNOWLEDGEBASE_FAQ_RECALL = DEFAULT_KNOWLEDGEBASE_FAQ_RECALL;
|
|
|
6963
7150
|
exports.DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG = DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG;
|
|
6964
7151
|
exports.DEFAULT_KNOWLEDGE_RRF_RANK_CONSTANT = DEFAULT_KNOWLEDGE_RRF_RANK_CONSTANT;
|
|
6965
7152
|
exports.DEFAULT_KNOWLEDGE_RRF_WEIGHTS = DEFAULT_KNOWLEDGE_RRF_WEIGHTS;
|
|
7153
|
+
exports.DEFAULT_KNOWLEDGE_TEXT_SPLITTER = DEFAULT_KNOWLEDGE_TEXT_SPLITTER;
|
|
6966
7154
|
exports.DEFAULT_MEMBERSHIP_CNY_PER_POINT = DEFAULT_MEMBERSHIP_CNY_PER_POINT;
|
|
6967
7155
|
exports.DEFAULT_MODEL_GATEWAY_BODY_RETENTION_DAYS = DEFAULT_MODEL_GATEWAY_BODY_RETENTION_DAYS;
|
|
6968
7156
|
exports.DEFAULT_MODEL_GATEWAY_CALL_RETENTION_DAYS = DEFAULT_MODEL_GATEWAY_CALL_RETENTION_DAYS;
|
|
@@ -6992,7 +7180,12 @@ exports.KDocumentSourceType = KDocumentSourceType;
|
|
|
6992
7180
|
exports.KDocumentWebTypeOptions = KDocumentWebTypeOptions;
|
|
6993
7181
|
exports.KNOWLEDGEBASE_FAQ_RETRIEVAL_MODES = KNOWLEDGEBASE_FAQ_RETRIEVAL_MODES;
|
|
6994
7182
|
exports.KNOWLEDGEBASE_OPEN_CITATION_EFFECT = KNOWLEDGEBASE_OPEN_CITATION_EFFECT;
|
|
7183
|
+
exports.KNOWLEDGE_AUTOMATIC_TAG_CANDIDATES = KNOWLEDGE_AUTOMATIC_TAG_CANDIDATES;
|
|
7184
|
+
exports.KNOWLEDGE_AUTOMATIC_TAG_MAXIMUM = KNOWLEDGE_AUTOMATIC_TAG_MAXIMUM;
|
|
7185
|
+
exports.KNOWLEDGE_AUTOMATIC_TAG_TEXT_BUDGET = KNOWLEDGE_AUTOMATIC_TAG_TEXT_BUDGET;
|
|
7186
|
+
exports.KNOWLEDGE_CHUNKING_ALGORITHM_VERSION = KNOWLEDGE_CHUNKING_ALGORITHM_VERSION;
|
|
6995
7187
|
exports.KNOWLEDGE_DOCUMENTS_NAME = KNOWLEDGE_DOCUMENTS_NAME;
|
|
7188
|
+
exports.KNOWLEDGE_DOCUMENT_AGENT_WRITER_TYPE = KNOWLEDGE_DOCUMENT_AGENT_WRITER_TYPE;
|
|
6996
7189
|
exports.KNOWLEDGE_FAQ_ANSWER_BLOCK_MAX_COUNT = KNOWLEDGE_FAQ_ANSWER_BLOCK_MAX_COUNT;
|
|
6997
7190
|
exports.KNOWLEDGE_FAQ_ANSWER_TOTAL_MAX_LENGTH = KNOWLEDGE_FAQ_ANSWER_TOTAL_MAX_LENGTH;
|
|
6998
7191
|
exports.KNOWLEDGE_FAQ_MAX_LOGICAL_VECTOR_COUNT = KNOWLEDGE_FAQ_MAX_LOGICAL_VECTOR_COUNT;
|
|
@@ -7107,6 +7300,7 @@ exports.STATE_VARIABLE_HUMAN = STATE_VARIABLE_HUMAN;
|
|
|
7107
7300
|
exports.STATE_VARIABLE_INPUT = STATE_VARIABLE_INPUT;
|
|
7108
7301
|
exports.STATE_VARIABLE_SYS = STATE_VARIABLE_SYS;
|
|
7109
7302
|
exports.STATE_VARIABLE_TITLE_CHANNEL = STATE_VARIABLE_TITLE_CHANNEL;
|
|
7303
|
+
exports.TAG_TARGETS = TAG_TARGETS;
|
|
7110
7304
|
exports.TASK_DESCRIPTION_PREFIX = TASK_DESCRIPTION_PREFIX;
|
|
7111
7305
|
exports.TASK_DESCRIPTION_SUFFIX = TASK_DESCRIPTION_SUFFIX;
|
|
7112
7306
|
exports.THREAD_GOAL_STATUS_VALUES = THREAD_GOAL_STATUS_VALUES;
|
|
@@ -7192,6 +7386,7 @@ exports.getCurrentGraph = getCurrentGraph;
|
|
|
7192
7386
|
exports.getEnabledTools = getEnabledTools;
|
|
7193
7387
|
exports.getStoreNamespace = getStoreNamespace;
|
|
7194
7388
|
exports.getSwarmPartners = getSwarmPartners;
|
|
7389
|
+
exports.getTagTargets = getTagTargets;
|
|
7195
7390
|
exports.getToolCallFromConfig = getToolCallFromConfig;
|
|
7196
7391
|
exports.getToolCallIdFromConfig = getToolCallIdFromConfig;
|
|
7197
7392
|
exports.getToolLabel = getToolLabel;
|
|
@@ -7220,12 +7415,15 @@ exports.isImageType = isImageType;
|
|
|
7220
7415
|
exports.isInterruptMessage = isInterruptMessage;
|
|
7221
7416
|
exports.isIteratingKey = isIteratingKey;
|
|
7222
7417
|
exports.isIteratorKey = isIteratorKey;
|
|
7418
|
+
exports.isKnowledgeDocumentVisible = isKnowledgeDocumentVisible;
|
|
7419
|
+
exports.isKnowledgeTableMetadata = isKnowledgeTableMetadata;
|
|
7223
7420
|
exports.isKnowledgeWikiChunkMetadata = isKnowledgeWikiChunkMetadata;
|
|
7224
7421
|
exports.isKnowledgeWikiPageContributionPayload = isKnowledgeWikiPageContributionPayload;
|
|
7225
7422
|
exports.isKnowledgeWikiPageSourcePayload = isKnowledgeWikiPageSourcePayload;
|
|
7226
7423
|
exports.isLearningProposal = isLearningProposal;
|
|
7227
7424
|
exports.isMessageGroup = isMessageGroup;
|
|
7228
7425
|
exports.isMiddlewareToolEnabled = isMiddlewareToolEnabled;
|
|
7426
|
+
exports.isNativeKnowledgeTableDocument = isNativeKnowledgeTableDocument;
|
|
7229
7427
|
exports.isNil = isNil$1;
|
|
7230
7428
|
exports.isOrganizationSharedXpertWorkspace = isOrganizationSharedXpertWorkspace;
|
|
7231
7429
|
exports.isOutputTokenParameter = isOutputTokenParameter;
|
|
@@ -7246,7 +7444,10 @@ exports.isUserManagedAssistant = isUserManagedAssistant;
|
|
|
7246
7444
|
exports.isUserOrganizationEntryGuideKey = isUserOrganizationEntryGuideKey;
|
|
7247
7445
|
exports.isVideoType = isVideoType;
|
|
7248
7446
|
exports.isXpertNodeType = isXpertNodeType;
|
|
7447
|
+
exports.knowledgeDocumentFileType = knowledgeDocumentFileType;
|
|
7448
|
+
exports.knowledgeUploadFileTypes = knowledgeUploadFileTypes;
|
|
7249
7449
|
exports.knowledgebaseDocumentParserDefaults = knowledgebaseDocumentParserDefaults;
|
|
7450
|
+
exports.knowledgebaseParserSelection = knowledgebaseParserSelection;
|
|
7250
7451
|
exports.letterStartSUID = letterStartSUID;
|
|
7251
7452
|
exports.locateNodes = locateNodes;
|
|
7252
7453
|
exports.mapTranslationLanguage = mapTranslationLanguage;
|