@metad/contracts 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +518 -66
- package/index.esm.js +511 -67
- package/package.json +1 -1
- package/src/ai/chat-message.model.d.ts +1 -1
- package/src/ai/index.d.ts +1 -0
- package/src/ai/message-content.utils.d.ts +52 -0
- package/src/ai/xpert-tool-mcp.model.d.ts +20 -1
- package/src/plugin.d.ts +16 -1
package/index.esm.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import ShortUniqueId from 'short-unique-id';
|
|
2
2
|
export * from '@xpert-ai/chatkit-types';
|
|
3
3
|
|
|
4
|
-
function _array_like_to_array$
|
|
4
|
+
function _array_like_to_array$6(arr, len) {
|
|
5
5
|
if (len == null || len > arr.length) len = arr.length;
|
|
6
6
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
7
7
|
return arr2;
|
|
8
8
|
}
|
|
9
|
-
function _array_without_holes$
|
|
10
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
9
|
+
function _array_without_holes$2(arr) {
|
|
10
|
+
if (Array.isArray(arr)) return _array_like_to_array$6(arr);
|
|
11
11
|
}
|
|
12
|
-
function _iterable_to_array$
|
|
12
|
+
function _iterable_to_array$3(iter) {
|
|
13
13
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
14
14
|
}
|
|
15
|
-
function _non_iterable_spread$
|
|
15
|
+
function _non_iterable_spread$2() {
|
|
16
16
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
17
17
|
}
|
|
18
|
-
function _to_consumable_array$
|
|
19
|
-
return _array_without_holes$
|
|
18
|
+
function _to_consumable_array$2(arr) {
|
|
19
|
+
return _array_without_holes$2(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$2();
|
|
20
20
|
}
|
|
21
|
-
function _unsupported_iterable_to_array$
|
|
21
|
+
function _unsupported_iterable_to_array$6(o, minLen) {
|
|
22
22
|
if (!o) return;
|
|
23
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
23
|
+
if (typeof o === "string") return _array_like_to_array$6(o, minLen);
|
|
24
24
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
25
25
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
26
26
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
27
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
27
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
|
|
28
28
|
}
|
|
29
29
|
var _uuidGenerator;
|
|
30
30
|
var uuidGenerator = new ShortUniqueId({
|
|
@@ -34,7 +34,7 @@ var uuid = function() {
|
|
|
34
34
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
35
35
|
args[_key] = arguments[_key];
|
|
36
36
|
}
|
|
37
|
-
return (_uuidGenerator = uuidGenerator).randomUUID.apply(_uuidGenerator, _to_consumable_array$
|
|
37
|
+
return (_uuidGenerator = uuidGenerator).randomUUID.apply(_uuidGenerator, _to_consumable_array$2(args));
|
|
38
38
|
};
|
|
39
39
|
var ParameterTypeEnum;
|
|
40
40
|
(function(ParameterTypeEnum) {
|
|
@@ -1789,15 +1789,15 @@ var VariableOperations = [
|
|
|
1789
1789
|
}
|
|
1790
1790
|
];
|
|
1791
1791
|
|
|
1792
|
-
function _array_like_to_array$
|
|
1792
|
+
function _array_like_to_array$5(arr, len) {
|
|
1793
1793
|
if (len == null || len > arr.length) len = arr.length;
|
|
1794
1794
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1795
1795
|
return arr2;
|
|
1796
1796
|
}
|
|
1797
|
-
function _array_with_holes$
|
|
1797
|
+
function _array_with_holes$4(arr) {
|
|
1798
1798
|
if (Array.isArray(arr)) return arr;
|
|
1799
1799
|
}
|
|
1800
|
-
function _define_property$
|
|
1800
|
+
function _define_property$4(obj, key, value) {
|
|
1801
1801
|
if (key in obj) {
|
|
1802
1802
|
Object.defineProperty(obj, key, {
|
|
1803
1803
|
value: value,
|
|
@@ -1810,7 +1810,7 @@ function _define_property$3(obj, key, value) {
|
|
|
1810
1810
|
}
|
|
1811
1811
|
return obj;
|
|
1812
1812
|
}
|
|
1813
|
-
function _iterable_to_array_limit$
|
|
1813
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
1814
1814
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1815
1815
|
if (_i == null) return;
|
|
1816
1816
|
var _arr = [];
|
|
@@ -1834,10 +1834,10 @@ function _iterable_to_array_limit$2(arr, i) {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
return _arr;
|
|
1836
1836
|
}
|
|
1837
|
-
function _non_iterable_rest$
|
|
1837
|
+
function _non_iterable_rest$4() {
|
|
1838
1838
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1839
1839
|
}
|
|
1840
|
-
function _object_spread$
|
|
1840
|
+
function _object_spread$3(target) {
|
|
1841
1841
|
for(var i = 1; i < arguments.length; i++){
|
|
1842
1842
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1843
1843
|
var ownKeys = Object.keys(source);
|
|
@@ -1847,12 +1847,12 @@ function _object_spread$2(target) {
|
|
|
1847
1847
|
}));
|
|
1848
1848
|
}
|
|
1849
1849
|
ownKeys.forEach(function(key) {
|
|
1850
|
-
_define_property$
|
|
1850
|
+
_define_property$4(target, key, source[key]);
|
|
1851
1851
|
});
|
|
1852
1852
|
}
|
|
1853
1853
|
return target;
|
|
1854
1854
|
}
|
|
1855
|
-
function ownKeys$
|
|
1855
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
1856
1856
|
var keys = Object.keys(object);
|
|
1857
1857
|
if (Object.getOwnPropertySymbols) {
|
|
1858
1858
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -1860,27 +1860,27 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
return keys;
|
|
1862
1862
|
}
|
|
1863
|
-
function _object_spread_props$
|
|
1863
|
+
function _object_spread_props$2(target, source) {
|
|
1864
1864
|
source = source != null ? source : {};
|
|
1865
1865
|
if (Object.getOwnPropertyDescriptors) {
|
|
1866
1866
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1867
1867
|
} else {
|
|
1868
|
-
ownKeys$
|
|
1868
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
1869
1869
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1870
1870
|
});
|
|
1871
1871
|
}
|
|
1872
1872
|
return target;
|
|
1873
1873
|
}
|
|
1874
|
-
function _sliced_to_array$
|
|
1875
|
-
return _array_with_holes$
|
|
1874
|
+
function _sliced_to_array$3(arr, i) {
|
|
1875
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$4();
|
|
1876
1876
|
}
|
|
1877
|
-
function _unsupported_iterable_to_array$
|
|
1877
|
+
function _unsupported_iterable_to_array$5(o, minLen) {
|
|
1878
1878
|
if (!o) return;
|
|
1879
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1879
|
+
if (typeof o === "string") return _array_like_to_array$5(o, minLen);
|
|
1880
1880
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1881
1881
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1882
1882
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1883
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1883
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
|
|
1884
1884
|
}
|
|
1885
1885
|
/**
|
|
1886
1886
|
* @deprecated can use getCurrentTaskInput instead?
|
|
@@ -1954,10 +1954,10 @@ function configurableStoreNamespace(configurable) {
|
|
|
1954
1954
|
* @param value
|
|
1955
1955
|
* @returns
|
|
1956
1956
|
*/ function setStateVariable(state, varName, value) {
|
|
1957
|
-
var _varName_split = _sliced_to_array$
|
|
1957
|
+
var _varName_split = _sliced_to_array$3(varName.split("."), 2), agentChannelName = _varName_split[0], variableName = _varName_split[1];
|
|
1958
1958
|
if (variableName) {
|
|
1959
1959
|
var _state_agentChannelName;
|
|
1960
|
-
state[agentChannelName] = _object_spread_props$
|
|
1960
|
+
state[agentChannelName] = _object_spread_props$2(_object_spread$3({}, (_state_agentChannelName = state[agentChannelName]) !== null && _state_agentChannelName !== void 0 ? _state_agentChannelName : {}), _define_property$4({}, variableName, value));
|
|
1961
1961
|
} else {
|
|
1962
1962
|
state[agentChannelName] = value;
|
|
1963
1963
|
}
|
|
@@ -2124,7 +2124,7 @@ function genPipelineKnowledgeBaseKey() {
|
|
|
2124
2124
|
return letterStartSUID("KnowledgeBase_");
|
|
2125
2125
|
}
|
|
2126
2126
|
|
|
2127
|
-
function _define_property$
|
|
2127
|
+
function _define_property$3(obj, key, value) {
|
|
2128
2128
|
if (key in obj) {
|
|
2129
2129
|
Object.defineProperty(obj, key, {
|
|
2130
2130
|
value: value,
|
|
@@ -2137,7 +2137,7 @@ function _define_property$2(obj, key, value) {
|
|
|
2137
2137
|
}
|
|
2138
2138
|
return obj;
|
|
2139
2139
|
}
|
|
2140
|
-
function _object_spread$
|
|
2140
|
+
function _object_spread$2(target) {
|
|
2141
2141
|
for(var i = 1; i < arguments.length; i++){
|
|
2142
2142
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2143
2143
|
var ownKeys = Object.keys(source);
|
|
@@ -2147,7 +2147,7 @@ function _object_spread$1(target) {
|
|
|
2147
2147
|
}));
|
|
2148
2148
|
}
|
|
2149
2149
|
ownKeys.forEach(function(key) {
|
|
2150
|
-
_define_property$
|
|
2150
|
+
_define_property$3(target, key, source[key]);
|
|
2151
2151
|
});
|
|
2152
2152
|
}
|
|
2153
2153
|
return target;
|
|
@@ -2162,7 +2162,7 @@ var DocumentTypeEnum;
|
|
|
2162
2162
|
* @deprecated use DocumentSourceProviderCategoryEnum local file type instead
|
|
2163
2163
|
*/ DocumentTypeEnum["FILE"] = "file";
|
|
2164
2164
|
})(DocumentTypeEnum || (DocumentTypeEnum = {}));
|
|
2165
|
-
var KDocumentSourceType = _object_spread$
|
|
2165
|
+
var KDocumentSourceType = _object_spread$2({}, DocumentSourceProviderCategoryEnum, DocumentTypeEnum);
|
|
2166
2166
|
var KBDocumentCategoryEnum;
|
|
2167
2167
|
(function(KBDocumentCategoryEnum) {
|
|
2168
2168
|
KBDocumentCategoryEnum["Text"] = "text";
|
|
@@ -2449,23 +2449,23 @@ function genXpertDBSqlKey() {
|
|
|
2449
2449
|
return letterStartSUID("DBSql_");
|
|
2450
2450
|
}
|
|
2451
2451
|
|
|
2452
|
-
function _array_like_to_array$
|
|
2452
|
+
function _array_like_to_array$4(arr, len) {
|
|
2453
2453
|
if (len == null || len > arr.length) len = arr.length;
|
|
2454
2454
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2455
2455
|
return arr2;
|
|
2456
2456
|
}
|
|
2457
|
-
function _array_without_holes(arr) {
|
|
2458
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
2457
|
+
function _array_without_holes$1(arr) {
|
|
2458
|
+
if (Array.isArray(arr)) return _array_like_to_array$4(arr);
|
|
2459
2459
|
}
|
|
2460
|
-
function _iterable_to_array$
|
|
2460
|
+
function _iterable_to_array$2(iter) {
|
|
2461
2461
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
2462
2462
|
}
|
|
2463
|
-
function _non_iterable_spread() {
|
|
2463
|
+
function _non_iterable_spread$1() {
|
|
2464
2464
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2465
2465
|
}
|
|
2466
|
-
function _object_without_properties(source, excluded) {
|
|
2466
|
+
function _object_without_properties$1(source, excluded) {
|
|
2467
2467
|
if (source == null) return {};
|
|
2468
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
2468
|
+
var target = _object_without_properties_loose$1(source, excluded);
|
|
2469
2469
|
var key, i;
|
|
2470
2470
|
if (Object.getOwnPropertySymbols) {
|
|
2471
2471
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -2478,7 +2478,7 @@ function _object_without_properties(source, excluded) {
|
|
|
2478
2478
|
}
|
|
2479
2479
|
return target;
|
|
2480
2480
|
}
|
|
2481
|
-
function _object_without_properties_loose(source, excluded) {
|
|
2481
|
+
function _object_without_properties_loose$1(source, excluded) {
|
|
2482
2482
|
if (source == null) return {};
|
|
2483
2483
|
var target = {};
|
|
2484
2484
|
var sourceKeys = Object.keys(source);
|
|
@@ -2490,21 +2490,21 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
2490
2490
|
}
|
|
2491
2491
|
return target;
|
|
2492
2492
|
}
|
|
2493
|
-
function _to_consumable_array(arr) {
|
|
2494
|
-
return _array_without_holes(arr) || _iterable_to_array$
|
|
2493
|
+
function _to_consumable_array$1(arr) {
|
|
2494
|
+
return _array_without_holes$1(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$1();
|
|
2495
2495
|
}
|
|
2496
|
-
function _unsupported_iterable_to_array$
|
|
2496
|
+
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
2497
2497
|
if (!o) return;
|
|
2498
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2498
|
+
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
2499
2499
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2500
2500
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2501
2501
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2502
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
2502
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
2503
2503
|
}
|
|
2504
2504
|
// Helpers
|
|
2505
2505
|
function omitXpertRelations(xpert) {
|
|
2506
2506
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2507
|
-
var _ref = xpert !== null && xpert !== void 0 ? xpert : {}; _ref.draft; _ref.agent; _ref.agents; _ref.executors; _ref.leaders; _ref.knowledgebases; _ref.knowledgebase; _ref.environment; _ref.integrations; _ref.toolsets; _ref.managers; var rest = _object_without_properties(_ref, [
|
|
2507
|
+
var _ref = xpert !== null && xpert !== void 0 ? xpert : {}; _ref.draft; _ref.agent; _ref.agents; _ref.executors; _ref.leaders; _ref.knowledgebases; _ref.knowledgebase; _ref.environment; _ref.integrations; _ref.toolsets; _ref.managers; var rest = _object_without_properties$1(_ref, [
|
|
2508
2508
|
"draft",
|
|
2509
2509
|
"agent",
|
|
2510
2510
|
"agents",
|
|
@@ -2568,12 +2568,12 @@ function locateNodes(nodes, position) {
|
|
|
2568
2568
|
}) // Node height min 70
|
|
2569
2569
|
;
|
|
2570
2570
|
var xRange = {
|
|
2571
|
-
min: (_Math = Math).min.apply(_Math, _to_consumable_array(x0Positions)),
|
|
2572
|
-
max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array(x1Positions))
|
|
2571
|
+
min: (_Math = Math).min.apply(_Math, _to_consumable_array$1(x0Positions)),
|
|
2572
|
+
max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array$1(x1Positions))
|
|
2573
2573
|
};
|
|
2574
2574
|
var yRange = {
|
|
2575
|
-
min: (_Math2 = Math).min.apply(_Math2, _to_consumable_array(y0Positions)),
|
|
2576
|
-
max: (_Math3 = Math).max.apply(_Math3, _to_consumable_array(y1Positions))
|
|
2575
|
+
min: (_Math2 = Math).min.apply(_Math2, _to_consumable_array$1(y0Positions)),
|
|
2576
|
+
max: (_Math3 = Math).max.apply(_Math3, _to_consumable_array$1(y1Positions))
|
|
2577
2577
|
};
|
|
2578
2578
|
var size = {
|
|
2579
2579
|
width: xRange.max - xRange.min + 50,
|
|
@@ -2610,9 +2610,9 @@ function locateNodes(nodes, position) {
|
|
|
2610
2610
|
}
|
|
2611
2611
|
if ((_xpert_agents = xpert.agents) === null || _xpert_agents === void 0 ? void 0 : _xpert_agents.length) {
|
|
2612
2612
|
var _agents;
|
|
2613
|
-
(_agents = agents).push.apply(_agents, _to_consumable_array(xpert.agents));
|
|
2613
|
+
(_agents = agents).push.apply(_agents, _to_consumable_array$1(xpert.agents));
|
|
2614
2614
|
}
|
|
2615
|
-
(_nodes = nodes).push.apply(_nodes, _to_consumable_array(agents.map(function(_) {
|
|
2615
|
+
(_nodes = nodes).push.apply(_nodes, _to_consumable_array$1(agents.map(function(_) {
|
|
2616
2616
|
var _xpert_options_agent___key, _xpert_options_agent, _xpert_options, _xpert_options_agent___key1, _xpert_options_agent1, _xpert_options1;
|
|
2617
2617
|
var _xpert_options_agent___key_position;
|
|
2618
2618
|
return {
|
|
@@ -2644,7 +2644,7 @@ function locateNodes(nodes, position) {
|
|
|
2644
2644
|
});
|
|
2645
2645
|
});
|
|
2646
2646
|
var _xpert_knowledgebases;
|
|
2647
|
-
(_nodes1 = nodes).push.apply(_nodes1, _to_consumable_array(((_xpert_knowledgebases = xpert.knowledgebases) !== null && _xpert_knowledgebases !== void 0 ? _xpert_knowledgebases : []).map(function(x) {
|
|
2647
|
+
(_nodes1 = nodes).push.apply(_nodes1, _to_consumable_array$1(((_xpert_knowledgebases = xpert.knowledgebases) !== null && _xpert_knowledgebases !== void 0 ? _xpert_knowledgebases : []).map(function(x) {
|
|
2648
2648
|
var _xpert_options_knowledge_x_id, _xpert_options_knowledge, _xpert_options, _xpert_options_knowledge_x_id1, _xpert_options_knowledge1, _xpert_options1;
|
|
2649
2649
|
var _xpert_options_knowledge_x_id_position;
|
|
2650
2650
|
return {
|
|
@@ -2659,7 +2659,7 @@ function locateNodes(nodes, position) {
|
|
|
2659
2659
|
};
|
|
2660
2660
|
})));
|
|
2661
2661
|
var _xpert_toolsets;
|
|
2662
|
-
(_nodes2 = nodes).push.apply(_nodes2, _to_consumable_array(((_xpert_toolsets = xpert.toolsets) !== null && _xpert_toolsets !== void 0 ? _xpert_toolsets : []).map(function(x) {
|
|
2662
|
+
(_nodes2 = nodes).push.apply(_nodes2, _to_consumable_array$1(((_xpert_toolsets = xpert.toolsets) !== null && _xpert_toolsets !== void 0 ? _xpert_toolsets : []).map(function(x) {
|
|
2663
2663
|
var _xpert_options_toolset_x_id, _xpert_options_toolset, _xpert_options, _xpert_options_toolset_x_id1, _xpert_options_toolset1, _xpert_options1;
|
|
2664
2664
|
var _xpert_options_toolset_x_id_position;
|
|
2665
2665
|
return {
|
|
@@ -2696,12 +2696,12 @@ function locateNodes(nodes, position) {
|
|
|
2696
2696
|
}) // Node height min 70
|
|
2697
2697
|
;
|
|
2698
2698
|
var xRange = {
|
|
2699
|
-
min: (_Math = Math).min.apply(_Math, _to_consumable_array(x0Positions)),
|
|
2700
|
-
max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array(x1Positions))
|
|
2699
|
+
min: (_Math = Math).min.apply(_Math, _to_consumable_array$1(x0Positions)),
|
|
2700
|
+
max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array$1(x1Positions))
|
|
2701
2701
|
};
|
|
2702
2702
|
var yRange = {
|
|
2703
|
-
min: (_Math2 = Math).min.apply(_Math2, _to_consumable_array(y0Positions)),
|
|
2704
|
-
max: (_Math3 = Math).max.apply(_Math3, _to_consumable_array(y1Positions))
|
|
2703
|
+
min: (_Math2 = Math).min.apply(_Math2, _to_consumable_array$1(y0Positions)),
|
|
2704
|
+
max: (_Math3 = Math).max.apply(_Math3, _to_consumable_array$1(y1Positions))
|
|
2705
2705
|
};
|
|
2706
2706
|
var size = {
|
|
2707
2707
|
width: xRange.max - xRange.min + 50,
|
|
@@ -2839,9 +2839,10 @@ var MCPServerType;
|
|
|
2839
2839
|
MCPServerType["SSE"] = "sse";
|
|
2840
2840
|
MCPServerType["STDIO"] = "stdio";
|
|
2841
2841
|
MCPServerType["CODE"] = "code";
|
|
2842
|
+
MCPServerType["HTTP"] = "http";
|
|
2842
2843
|
})(MCPServerType || (MCPServerType = {}));
|
|
2843
2844
|
|
|
2844
|
-
function _define_property$
|
|
2845
|
+
function _define_property$2(obj, key, value) {
|
|
2845
2846
|
if (key in obj) {
|
|
2846
2847
|
Object.defineProperty(obj, key, {
|
|
2847
2848
|
value: value,
|
|
@@ -2854,7 +2855,7 @@ function _define_property$1(obj, key, value) {
|
|
|
2854
2855
|
}
|
|
2855
2856
|
return obj;
|
|
2856
2857
|
}
|
|
2857
|
-
function _object_spread(target) {
|
|
2858
|
+
function _object_spread$1(target) {
|
|
2858
2859
|
for(var i = 1; i < arguments.length; i++){
|
|
2859
2860
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2860
2861
|
var ownKeys = Object.keys(source);
|
|
@@ -2864,12 +2865,12 @@ function _object_spread(target) {
|
|
|
2864
2865
|
}));
|
|
2865
2866
|
}
|
|
2866
2867
|
ownKeys.forEach(function(key) {
|
|
2867
|
-
_define_property$
|
|
2868
|
+
_define_property$2(target, key, source[key]);
|
|
2868
2869
|
});
|
|
2869
2870
|
}
|
|
2870
2871
|
return target;
|
|
2871
2872
|
}
|
|
2872
|
-
function ownKeys(object, enumerableOnly) {
|
|
2873
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
2873
2874
|
var keys = Object.keys(object);
|
|
2874
2875
|
if (Object.getOwnPropertySymbols) {
|
|
2875
2876
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -2877,12 +2878,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
2877
2878
|
}
|
|
2878
2879
|
return keys;
|
|
2879
2880
|
}
|
|
2880
|
-
function _object_spread_props(target, source) {
|
|
2881
|
+
function _object_spread_props$1(target, source) {
|
|
2881
2882
|
source = source != null ? source : {};
|
|
2882
2883
|
if (Object.getOwnPropertyDescriptors) {
|
|
2883
2884
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2884
2885
|
} else {
|
|
2885
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
2886
|
+
ownKeys$1(Object(source)).forEach(function(key) {
|
|
2886
2887
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2887
2888
|
});
|
|
2888
2889
|
}
|
|
@@ -2905,8 +2906,8 @@ function _object_spread_props(target, source) {
|
|
|
2905
2906
|
var doc = _step.value;
|
|
2906
2907
|
var _doc_metadata;
|
|
2907
2908
|
if ((_doc_metadata = doc.metadata) === null || _doc_metadata === void 0 ? void 0 : _doc_metadata.chunkId) {
|
|
2908
|
-
map.set(doc.metadata.chunkId, _object_spread_props(_object_spread({}, doc), {
|
|
2909
|
-
metadata: _object_spread_props(_object_spread({}, doc.metadata), {
|
|
2909
|
+
map.set(doc.metadata.chunkId, _object_spread_props$1(_object_spread$1({}, doc), {
|
|
2910
|
+
metadata: _object_spread_props$1(_object_spread$1({}, doc.metadata), {
|
|
2910
2911
|
children: []
|
|
2911
2912
|
})
|
|
2912
2913
|
}));
|
|
@@ -3049,6 +3050,444 @@ function getAgentMiddlewareNodes(graph, agentKey) {
|
|
|
3049
3050
|
return middlewares;
|
|
3050
3051
|
}
|
|
3051
3052
|
|
|
3053
|
+
function _array_like_to_array$3(arr, len) {
|
|
3054
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3055
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3056
|
+
return arr2;
|
|
3057
|
+
}
|
|
3058
|
+
function _array_with_holes$3(arr) {
|
|
3059
|
+
if (Array.isArray(arr)) return arr;
|
|
3060
|
+
}
|
|
3061
|
+
function _array_without_holes(arr) {
|
|
3062
|
+
if (Array.isArray(arr)) return _array_like_to_array$3(arr);
|
|
3063
|
+
}
|
|
3064
|
+
function _define_property$1(obj, key, value) {
|
|
3065
|
+
if (key in obj) {
|
|
3066
|
+
Object.defineProperty(obj, key, {
|
|
3067
|
+
value: value,
|
|
3068
|
+
enumerable: true,
|
|
3069
|
+
configurable: true,
|
|
3070
|
+
writable: true
|
|
3071
|
+
});
|
|
3072
|
+
} else {
|
|
3073
|
+
obj[key] = value;
|
|
3074
|
+
}
|
|
3075
|
+
return obj;
|
|
3076
|
+
}
|
|
3077
|
+
function _iterable_to_array$1(iter) {
|
|
3078
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
3079
|
+
}
|
|
3080
|
+
function _iterable_to_array_limit$2(arr, i) {
|
|
3081
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3082
|
+
if (_i == null) return;
|
|
3083
|
+
var _arr = [];
|
|
3084
|
+
var _n = true;
|
|
3085
|
+
var _d = false;
|
|
3086
|
+
var _s, _e;
|
|
3087
|
+
try {
|
|
3088
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
3089
|
+
_arr.push(_s.value);
|
|
3090
|
+
if (i && _arr.length === i) break;
|
|
3091
|
+
}
|
|
3092
|
+
} catch (err) {
|
|
3093
|
+
_d = true;
|
|
3094
|
+
_e = err;
|
|
3095
|
+
} finally{
|
|
3096
|
+
try {
|
|
3097
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3098
|
+
} finally{
|
|
3099
|
+
if (_d) throw _e;
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
return _arr;
|
|
3103
|
+
}
|
|
3104
|
+
function _non_iterable_rest$3() {
|
|
3105
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3106
|
+
}
|
|
3107
|
+
function _non_iterable_spread() {
|
|
3108
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3109
|
+
}
|
|
3110
|
+
function _object_spread(target) {
|
|
3111
|
+
for(var i = 1; i < arguments.length; i++){
|
|
3112
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
3113
|
+
var ownKeys = Object.keys(source);
|
|
3114
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3115
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3116
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3117
|
+
}));
|
|
3118
|
+
}
|
|
3119
|
+
ownKeys.forEach(function(key) {
|
|
3120
|
+
_define_property$1(target, key, source[key]);
|
|
3121
|
+
});
|
|
3122
|
+
}
|
|
3123
|
+
return target;
|
|
3124
|
+
}
|
|
3125
|
+
function ownKeys(object, enumerableOnly) {
|
|
3126
|
+
var keys = Object.keys(object);
|
|
3127
|
+
if (Object.getOwnPropertySymbols) {
|
|
3128
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
3129
|
+
keys.push.apply(keys, symbols);
|
|
3130
|
+
}
|
|
3131
|
+
return keys;
|
|
3132
|
+
}
|
|
3133
|
+
function _object_spread_props(target, source) {
|
|
3134
|
+
source = source != null ? source : {};
|
|
3135
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
3136
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3137
|
+
} else {
|
|
3138
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
3139
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3140
|
+
});
|
|
3141
|
+
}
|
|
3142
|
+
return target;
|
|
3143
|
+
}
|
|
3144
|
+
function _object_without_properties(source, excluded) {
|
|
3145
|
+
if (source == null) return {};
|
|
3146
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
3147
|
+
var key, i;
|
|
3148
|
+
if (Object.getOwnPropertySymbols) {
|
|
3149
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
3150
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
3151
|
+
key = sourceSymbolKeys[i];
|
|
3152
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3153
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
3154
|
+
target[key] = source[key];
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
return target;
|
|
3158
|
+
}
|
|
3159
|
+
function _object_without_properties_loose(source, excluded) {
|
|
3160
|
+
if (source == null) return {};
|
|
3161
|
+
var target = {};
|
|
3162
|
+
var sourceKeys = Object.keys(source);
|
|
3163
|
+
var key, i;
|
|
3164
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
3165
|
+
key = sourceKeys[i];
|
|
3166
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3167
|
+
target[key] = source[key];
|
|
3168
|
+
}
|
|
3169
|
+
return target;
|
|
3170
|
+
}
|
|
3171
|
+
function _sliced_to_array$2(arr, i) {
|
|
3172
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
3173
|
+
}
|
|
3174
|
+
function _to_consumable_array(arr) {
|
|
3175
|
+
return _array_without_holes(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread();
|
|
3176
|
+
}
|
|
3177
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
3178
|
+
if (!o) return;
|
|
3179
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
3180
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3181
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3182
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3183
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
3184
|
+
}
|
|
3185
|
+
function isNil(value) {
|
|
3186
|
+
return value === null || value === undefined;
|
|
3187
|
+
}
|
|
3188
|
+
function isTextContent(content) {
|
|
3189
|
+
return !!content && typeof content === "object" && content.type === "text";
|
|
3190
|
+
}
|
|
3191
|
+
function isReasoningContent(content) {
|
|
3192
|
+
return !!content && typeof content === "object" && content.type === "reasoning";
|
|
3193
|
+
}
|
|
3194
|
+
function isComponentContent(content) {
|
|
3195
|
+
return !!content && typeof content === "object" && content.type === "component";
|
|
3196
|
+
}
|
|
3197
|
+
function inferContentSource(content) {
|
|
3198
|
+
if (typeof content === "string") {
|
|
3199
|
+
return "text";
|
|
3200
|
+
}
|
|
3201
|
+
switch(content === null || content === void 0 ? void 0 : content.type){
|
|
3202
|
+
case "text":
|
|
3203
|
+
return "text";
|
|
3204
|
+
case "reasoning":
|
|
3205
|
+
return "reasoning";
|
|
3206
|
+
case "component":
|
|
3207
|
+
return "component";
|
|
3208
|
+
case "memory":
|
|
3209
|
+
return "memory";
|
|
3210
|
+
default:
|
|
3211
|
+
return "content";
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3214
|
+
function mapJoinHint(hint) {
|
|
3215
|
+
switch(hint){
|
|
3216
|
+
case "none":
|
|
3217
|
+
return "";
|
|
3218
|
+
case "space":
|
|
3219
|
+
return " ";
|
|
3220
|
+
case "line":
|
|
3221
|
+
return "\n";
|
|
3222
|
+
case "paragraph":
|
|
3223
|
+
return "\n\n";
|
|
3224
|
+
default:
|
|
3225
|
+
return "";
|
|
3226
|
+
}
|
|
3227
|
+
}
|
|
3228
|
+
function endsWithCodeFence(text) {
|
|
3229
|
+
var normalized = (text !== null && text !== void 0 ? text : "").replace(/[ \t]+$/g, "");
|
|
3230
|
+
return normalized.endsWith("```");
|
|
3231
|
+
}
|
|
3232
|
+
function shouldJoinWithoutSeparator(previous, current) {
|
|
3233
|
+
return !!(previous === null || previous === void 0 ? void 0 : previous.streamId) && previous.source === current.source && previous.streamId === current.streamId;
|
|
3234
|
+
}
|
|
3235
|
+
function getSeparator(previousType, previousText, nextText, joinHint) {
|
|
3236
|
+
if (!nextText || /^\s/.test(nextText)) {
|
|
3237
|
+
return "";
|
|
3238
|
+
}
|
|
3239
|
+
if (joinHint) {
|
|
3240
|
+
return mapJoinHint(joinHint);
|
|
3241
|
+
}
|
|
3242
|
+
if (previousType === "component") {
|
|
3243
|
+
return "\n\n";
|
|
3244
|
+
}
|
|
3245
|
+
if (endsWithCodeFence(previousText)) {
|
|
3246
|
+
return "\n";
|
|
3247
|
+
}
|
|
3248
|
+
if (previousText && !/[\s\n]$/.test(previousText)) {
|
|
3249
|
+
return "\n";
|
|
3250
|
+
}
|
|
3251
|
+
return "";
|
|
3252
|
+
}
|
|
3253
|
+
function normalizeIncomingContent(content, context) {
|
|
3254
|
+
if (typeof content !== "string") {
|
|
3255
|
+
return content;
|
|
3256
|
+
}
|
|
3257
|
+
return _object_spread({
|
|
3258
|
+
type: "text",
|
|
3259
|
+
text: content
|
|
3260
|
+
}, context.streamId ? {
|
|
3261
|
+
id: context.streamId
|
|
3262
|
+
} : {});
|
|
3263
|
+
}
|
|
3264
|
+
function ensureArrayContent(content) {
|
|
3265
|
+
if (Array.isArray(content)) {
|
|
3266
|
+
return content;
|
|
3267
|
+
}
|
|
3268
|
+
if (typeof content === "string" && content.length > 0) {
|
|
3269
|
+
return [
|
|
3270
|
+
{
|
|
3271
|
+
type: "text",
|
|
3272
|
+
text: content
|
|
3273
|
+
}
|
|
3274
|
+
];
|
|
3275
|
+
}
|
|
3276
|
+
return [];
|
|
3277
|
+
}
|
|
3278
|
+
function stringifySingle(content) {
|
|
3279
|
+
if (content.type === "text") {
|
|
3280
|
+
return content.text;
|
|
3281
|
+
}
|
|
3282
|
+
if (content.type === "component") {
|
|
3283
|
+
return JSON.stringify(content.data);
|
|
3284
|
+
}
|
|
3285
|
+
return JSON.stringify(content);
|
|
3286
|
+
}
|
|
3287
|
+
function filterText(content) {
|
|
3288
|
+
if (typeof content === "string") {
|
|
3289
|
+
return content;
|
|
3290
|
+
}
|
|
3291
|
+
if ((content === null || content === void 0 ? void 0 : content.type) === "text") {
|
|
3292
|
+
return content.text;
|
|
3293
|
+
}
|
|
3294
|
+
return "";
|
|
3295
|
+
}
|
|
3296
|
+
function mergeComponentData(previous, incoming) {
|
|
3297
|
+
var _previous_data, _incoming_data;
|
|
3298
|
+
var _incoming_data1;
|
|
3299
|
+
var mergedIncomingData = Object.entries((_incoming_data1 = incoming.data) !== null && _incoming_data1 !== void 0 ? _incoming_data1 : {}).reduce(function(acc, param) {
|
|
3300
|
+
var _param = _sliced_to_array$2(param, 2), key = _param[0], value = _param[1];
|
|
3301
|
+
if (!isNil(value)) {
|
|
3302
|
+
acc[key] = value;
|
|
3303
|
+
}
|
|
3304
|
+
return acc;
|
|
3305
|
+
}, {});
|
|
3306
|
+
var _previous_data1;
|
|
3307
|
+
return _object_spread_props(_object_spread({}, previous, incoming), {
|
|
3308
|
+
data: _object_spread_props(_object_spread({}, (_previous_data1 = previous.data) !== null && _previous_data1 !== void 0 ? _previous_data1 : {}, mergedIncomingData), {
|
|
3309
|
+
created_date: ((_previous_data = previous.data) === null || _previous_data === void 0 ? void 0 : _previous_data.created_date) || ((_incoming_data = incoming.data) === null || _incoming_data === void 0 ? void 0 : _incoming_data.created_date)
|
|
3310
|
+
})
|
|
3311
|
+
});
|
|
3312
|
+
}
|
|
3313
|
+
function inferMessageAppendContext(content, fallbackSource) {
|
|
3314
|
+
return _object_spread({
|
|
3315
|
+
source: fallbackSource !== null && fallbackSource !== void 0 ? fallbackSource : inferContentSource(content)
|
|
3316
|
+
}, typeof content !== "string" && (content === null || content === void 0 ? void 0 : content.id) ? {
|
|
3317
|
+
streamId: String(content.id)
|
|
3318
|
+
} : {});
|
|
3319
|
+
}
|
|
3320
|
+
function resolveMessageAppendContext(options) {
|
|
3321
|
+
var inferredContext = inferMessageAppendContext(options.incoming, options.fallbackSource);
|
|
3322
|
+
var appendContext = typeof options.incoming === "string" && !inferredContext.streamId && options.fallbackStreamId ? _object_spread_props(_object_spread({}, inferredContext), {
|
|
3323
|
+
streamId: options.fallbackStreamId
|
|
3324
|
+
}) : inferredContext;
|
|
3325
|
+
var messageContext = shouldJoinWithoutSeparator(options.previous, appendContext) ? _object_spread_props(_object_spread({}, appendContext), {
|
|
3326
|
+
joinHint: "none"
|
|
3327
|
+
}) : appendContext;
|
|
3328
|
+
return {
|
|
3329
|
+
appendContext: appendContext,
|
|
3330
|
+
messageContext: messageContext
|
|
3331
|
+
};
|
|
3332
|
+
}
|
|
3333
|
+
/**
|
|
3334
|
+
* Stateful helper for streaming append.
|
|
3335
|
+
*
|
|
3336
|
+
* It keeps the previous append context and resolves the current one, so callers
|
|
3337
|
+
* can avoid passing `previous` manually for every chunk and still get stable
|
|
3338
|
+
* join behavior (for example, same source + same stream -> `joinHint: 'none'`).
|
|
3339
|
+
*
|
|
3340
|
+
* Call `reset()` at turn/session boundaries to prevent cross-turn contamination.
|
|
3341
|
+
*/ function createMessageAppendContextTracker() {
|
|
3342
|
+
var initial = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
3343
|
+
var previous = initial;
|
|
3344
|
+
return {
|
|
3345
|
+
resolve: function resolve(options) {
|
|
3346
|
+
var resolved = resolveMessageAppendContext(_object_spread_props(_object_spread({}, options), {
|
|
3347
|
+
previous: previous
|
|
3348
|
+
}));
|
|
3349
|
+
previous = resolved.appendContext;
|
|
3350
|
+
return resolved;
|
|
3351
|
+
},
|
|
3352
|
+
reset: function reset() {
|
|
3353
|
+
previous = null;
|
|
3354
|
+
},
|
|
3355
|
+
current: function current() {
|
|
3356
|
+
return previous;
|
|
3357
|
+
}
|
|
3358
|
+
};
|
|
3359
|
+
}
|
|
3360
|
+
/**
|
|
3361
|
+
* Append one incoming chunk into a chat message in place.
|
|
3362
|
+
*
|
|
3363
|
+
* Behavior:
|
|
3364
|
+
* - Keeps `aiMessage` object reference stable (caller may hold this object).
|
|
3365
|
+
* - Updates message properties with new references (`content`/`reasoning` arrays)
|
|
3366
|
+
* so UI change detection that relies on reference changes can react reliably.
|
|
3367
|
+
* - Applies context-aware merge rules for text/reasoning/component chunks.
|
|
3368
|
+
* - `previous` must be supplied by caller when same-stream join inference is needed.
|
|
3369
|
+
*/ function appendMessageContent(aiMessage, incoming, context) {
|
|
3370
|
+
aiMessage.status = "answering";
|
|
3371
|
+
var _ref = context !== null && context !== void 0 ? context : {}, previous = _ref.previous, contextWithoutPrevious = _object_without_properties(_ref, [
|
|
3372
|
+
"previous"
|
|
3373
|
+
]);
|
|
3374
|
+
var resolvedContext = _object_spread({}, inferMessageAppendContext(incoming), contextWithoutPrevious);
|
|
3375
|
+
var content = normalizeIncomingContent(incoming, resolvedContext);
|
|
3376
|
+
if (isReasoningContent(content)) {
|
|
3377
|
+
var _aiMessage_reasoning;
|
|
3378
|
+
var reasoning = (_aiMessage_reasoning = aiMessage.reasoning) !== null && _aiMessage_reasoning !== void 0 ? _aiMessage_reasoning : [];
|
|
3379
|
+
var lastReasoning = reasoning[reasoning.length - 1];
|
|
3380
|
+
if ((lastReasoning === null || lastReasoning === void 0 ? void 0 : lastReasoning.id) === content.id) {
|
|
3381
|
+
var mergedReasoning = _object_spread_props(_object_spread({}, lastReasoning), {
|
|
3382
|
+
text: "".concat(lastReasoning.text).concat(content.text)
|
|
3383
|
+
});
|
|
3384
|
+
aiMessage.reasoning = _to_consumable_array(reasoning.slice(0, reasoning.length - 1)).concat([
|
|
3385
|
+
mergedReasoning
|
|
3386
|
+
]);
|
|
3387
|
+
} else {
|
|
3388
|
+
aiMessage.reasoning = _to_consumable_array(reasoning).concat([
|
|
3389
|
+
content
|
|
3390
|
+
]);
|
|
3391
|
+
}
|
|
3392
|
+
aiMessage.status = "reasoning";
|
|
3393
|
+
return;
|
|
3394
|
+
}
|
|
3395
|
+
var chunks = ensureArrayContent(aiMessage.content);
|
|
3396
|
+
if (isTextContent(content)) {
|
|
3397
|
+
var _resolvedContext_joinHint;
|
|
3398
|
+
var joinHint = (_resolvedContext_joinHint = resolvedContext.joinHint) !== null && _resolvedContext_joinHint !== void 0 ? _resolvedContext_joinHint : shouldJoinWithoutSeparator(previous, resolvedContext) ? "none" : undefined;
|
|
3399
|
+
var lastContent = chunks[chunks.length - 1];
|
|
3400
|
+
if (isTextContent(lastContent) && (joinHint === "none" || !!content.id && !!lastContent.id && lastContent.id === content.id)) {
|
|
3401
|
+
var mergedLastContent = _object_spread(_object_spread_props(_object_spread({}, lastContent), {
|
|
3402
|
+
text: "".concat(lastContent.text).concat(content.text)
|
|
3403
|
+
}), !lastContent.id && content.id ? {
|
|
3404
|
+
id: content.id
|
|
3405
|
+
} : {});
|
|
3406
|
+
aiMessage.content = _to_consumable_array(chunks.slice(0, chunks.length - 1)).concat([
|
|
3407
|
+
mergedLastContent
|
|
3408
|
+
]);
|
|
3409
|
+
return;
|
|
3410
|
+
}
|
|
3411
|
+
var _lastContent_type;
|
|
3412
|
+
var previousType = (_lastContent_type = lastContent === null || lastContent === void 0 ? void 0 : lastContent.type) !== null && _lastContent_type !== void 0 ? _lastContent_type : null;
|
|
3413
|
+
var previousText = isTextContent(lastContent) ? lastContent.text : "";
|
|
3414
|
+
var separator = getSeparator(previousType, previousText, content.text, joinHint);
|
|
3415
|
+
var appended = _object_spread_props(_object_spread({}, content), {
|
|
3416
|
+
text: separator + content.text
|
|
3417
|
+
});
|
|
3418
|
+
aiMessage.content = _to_consumable_array(chunks).concat([
|
|
3419
|
+
appended
|
|
3420
|
+
]);
|
|
3421
|
+
return;
|
|
3422
|
+
}
|
|
3423
|
+
var nextChunks = _to_consumable_array(chunks);
|
|
3424
|
+
if (isComponentContent(content) && content.id) {
|
|
3425
|
+
var index = nextChunks.findIndex(function(item) {
|
|
3426
|
+
return isComponentContent(item) && item.id === content.id;
|
|
3427
|
+
});
|
|
3428
|
+
if (index > -1) {
|
|
3429
|
+
nextChunks[index] = mergeComponentData(nextChunks[index], content);
|
|
3430
|
+
} else {
|
|
3431
|
+
nextChunks.push(content);
|
|
3432
|
+
}
|
|
3433
|
+
} else {
|
|
3434
|
+
nextChunks.push(content);
|
|
3435
|
+
}
|
|
3436
|
+
aiMessage.content = nextChunks;
|
|
3437
|
+
}
|
|
3438
|
+
function appendMessagePlainText(accumulator, incoming, context) {
|
|
3439
|
+
var resolvedContext = _object_spread({}, inferMessageAppendContext(incoming), context !== null && context !== void 0 ? context : {});
|
|
3440
|
+
var nextText = filterText(incoming);
|
|
3441
|
+
if (!nextText) {
|
|
3442
|
+
return accumulator !== null && accumulator !== void 0 ? accumulator : "";
|
|
3443
|
+
}
|
|
3444
|
+
var previous = accumulator !== null && accumulator !== void 0 ? accumulator : "";
|
|
3445
|
+
var separator = getSeparator("text", previous, nextText, resolvedContext.joinHint);
|
|
3446
|
+
return previous + separator + nextText;
|
|
3447
|
+
}
|
|
3448
|
+
function stringifyMessageContent(content) {
|
|
3449
|
+
if (typeof content === "string") {
|
|
3450
|
+
return content;
|
|
3451
|
+
}
|
|
3452
|
+
if (Array.isArray(content)) {
|
|
3453
|
+
var result = "";
|
|
3454
|
+
var previousContext = null;
|
|
3455
|
+
content.forEach(function(item) {
|
|
3456
|
+
var itemContext = inferMessageAppendContext(item);
|
|
3457
|
+
var joinHint = shouldJoinWithoutSeparator(previousContext, itemContext) ? "none" : undefined;
|
|
3458
|
+
result = appendMessagePlainText(result, stringifySingle(item), _object_spread({}, itemContext, joinHint ? {
|
|
3459
|
+
joinHint: joinHint
|
|
3460
|
+
} : {}));
|
|
3461
|
+
previousContext = itemContext;
|
|
3462
|
+
});
|
|
3463
|
+
return result;
|
|
3464
|
+
}
|
|
3465
|
+
return stringifySingle(content);
|
|
3466
|
+
}
|
|
3467
|
+
function filterMessageText(content) {
|
|
3468
|
+
if (typeof content === "string") {
|
|
3469
|
+
return content;
|
|
3470
|
+
}
|
|
3471
|
+
if (Array.isArray(content)) {
|
|
3472
|
+
var result = "";
|
|
3473
|
+
var previousContext = null;
|
|
3474
|
+
content.forEach(function(item) {
|
|
3475
|
+
var nextText = filterText(item);
|
|
3476
|
+
if (!nextText) {
|
|
3477
|
+
return;
|
|
3478
|
+
}
|
|
3479
|
+
var itemContext = inferMessageAppendContext(item);
|
|
3480
|
+
var joinHint = shouldJoinWithoutSeparator(previousContext, itemContext) ? "none" : undefined;
|
|
3481
|
+
result = appendMessagePlainText(result, nextText, _object_spread({}, itemContext, joinHint ? {
|
|
3482
|
+
joinHint: joinHint
|
|
3483
|
+
} : {}));
|
|
3484
|
+
previousContext = itemContext;
|
|
3485
|
+
});
|
|
3486
|
+
return result || null;
|
|
3487
|
+
}
|
|
3488
|
+
return filterText(content) || null;
|
|
3489
|
+
}
|
|
3490
|
+
|
|
3052
3491
|
var PermissionsEnum;
|
|
3053
3492
|
(function(PermissionsEnum) {
|
|
3054
3493
|
PermissionsEnum["PROFILE_EDIT"] = "PROFILE_EDIT";
|
|
@@ -3908,4 +4347,9 @@ var InterruptMessageType;
|
|
|
3908
4347
|
InterruptMessageType["Select"] = "select";
|
|
3909
4348
|
})(InterruptMessageType || (InterruptMessageType = {}));
|
|
3910
4349
|
|
|
3911
|
-
|
|
4350
|
+
var PLUGIN_LEVEL = {
|
|
4351
|
+
SYSTEM: "system",
|
|
4352
|
+
ORGANIZATION: "organization"
|
|
4353
|
+
};
|
|
4354
|
+
|
|
4355
|
+
export { AIPermissionsEnum, AI_MODEL_TYPE_VARIABLE, AccessEnum, AgentEventType, AgentType, AiBusinessRole, AiFeatureEnum, AiModelTypeEnum, AiProtocol, AiProvider, AiProviderRole, AlignmentOptions, AnalyticsFeatures, AnalyticsPermissionsEnum, ApiAuthType, ApiProviderSchemaType, ApprovalPolicyTypesEnum, ApprovalPolicyTypesStringEnum, Attachment_Type_Options, AuthenticationEnum, BIInterruptMessageType, BonusTypeEnum, BusinessAreaRole, BusinessType, CONTEXT_VARIABLE_CURRENTSTATE, ChatDashboardMessageType, ChatGatewayEvent, ChatMessageFeedbackRatingEnum, ClientFocusEnum, ConfigurateMethod, ContactOrganizationInviteStatus, ContactType, CredentialFormTypeEnum, CredentialsType, CrudActionEnum, CurrenciesEnum, CurrencyPosition, DEFAULT_CURRENCIES, DEFAULT_DATE_FORMATS, DEFAULT_INTEGRATION_PAID_FILTERS, DEFAULT_INVITE_EXPIRY_PERIOD, DEFAULT_PROFIT_BASED_BONUS, DEFAULT_REVENUE_BASED_BONUS, DEFAULT_TENANT, DEFAULT_TIME_FORMATS, DEFAULT_TYPE, DataSourceProtocolEnum, DataSourceSyntaxEnum, DataSourceTypeEnum, DefaultValueDateTypeEnum, DocumentSourceProviderCategoryEnum, DocumentTypeEnum, EmailTemplateEnum, EmailTemplateNameEnum, EmbeddingStatusEnum, FILE_VARIABLES, FeatureEnum, FeatureStatusEnum, FeedTypeEnum, FetchFrom, FileStorageProviderEnum, GRAPH_NODE_SUMMARIZE_CONVERSATION, GRAPH_NODE_TITLE_CONVERSATION, HttpStatus, IFeatureToggleTypeEnum, INTEGRATION_PROVIDERS, ImportHistoryStatusEnum, ImportTypeEnum, IndicatorDraftFields, IndicatorOptionFields, IndicatorStatusEnum, IndicatorTagEnum, IndicatorType, IntegrationEnum, IntegrationFeatureEnum, IntegrationFilterEnum, IntegrationGitHubProvider, IntegrationLarkProvider, InterruptMessageType, InvitationExpirationEnum, InvitationTypeEnum, InviteStatusEnum, IteratingIndexParameterName, IteratingItemParameterName, IteratorIndexParameterName, IteratorItemParameterName, KBDocumentCategoryEnum, KBDocumentStatusEnum, KDocumentSourceType, KDocumentWebTypeEnum, KDocumentWebTypeOptions, KNOWLEDGE_DOCUMENTS_NAME, KNOWLEDGE_FOLDER_ID_NAME, KNOWLEDGE_SOURCES_NAME, KNOWLEDGE_STAGE_NAME, KnowledgeProviderEnum, KnowledgeStructureEnum, KnowledgeTask, KnowledgebaseChannel, KnowledgebasePermission, KnowledgebaseTypeEnum, LanguagesEnum, LanguagesMap, ListsInputTypeEnum, LocalAgentType, LongTermMemoryTypeEnum, MCPServerType, schema as MDX, MEMORY_PROFILE_PROMPT, MEMORY_QA_PROMPT, MinimumProjectSizeEnum, ModelEntityType, ModelFeature, ModelPropertyKey, ModelTypeEnum, OllamaEmbeddingsProviders, OpenAIEmbeddingsProviders, OrderTypeEnum, OrganizationContactBudgetTypeEnum, OrganizationDemoNetworkEnum, OrganizationPermissionsEnum, OrganizationProjectBudgetTypeEnum, OrganizationSelectInput, PLUGIN_LEVEL, ParameterType, ParameterTypeEnum, PayPeriodEnum, PermissionApprovalStatus, PermissionApprovalStatusTypesEnum, PermissionGroups, PermissionsEnum, PriceType, ProjectBillingEnum, ProjectOwnerEnum, ProjectStatusEnum, ProviderEnum, ProviderType, QueryStatusEnum, RegionsEnum, RequestMethodEnum, RoleTypeEnum, RolesEnum, SMTPSecureEnum, STANDARD_METADATA_FIELDS, STATE_SYS_VOLUME, STATE_SYS_WORKSPACE_PATH, STATE_SYS_WORKSPACE_URL, STATE_VARIABLE_FILES, STATE_VARIABLE_INPUT, STATE_VARIABLE_SYS, STATE_VARIABLE_TITLE_CHANNEL, ScheduleTaskStatus, SemanticModelStatusEnum, StoryStatusEnum, StoryTemplateType, SubscriptionType, TASK_DESCRIPTION_PREFIX, TASK_DESCRIPTION_SUFFIX, TENANT_AGENT_LOCAL_URL, TOOL_NAME_REGEX, TagCategoryEnum, TaskFrequency, TaskListTypeEnum, TimeGranularity, ToolParameterForm, ToolParameterType, ToolTagEnum, TranslationLanguageMap, USAGE_HOUR_FORMAT, UserType, VariableOperationEnum, VariableOperations, VectorTypeEnum, Visibility, VisitEntityEnum, VisitTypeEnum, WeekDaysEnum, WorkflowComparisonOperator, WorkflowLogicalOperator, WorkflowNodeTypeEnum, XpertAgentExecutionStatusEnum, XpertParameterTypeEnum, XpertTableStatus, XpertToolsetCategoryEnum, XpertTypeEnum, agentLabel, agentUniqueName, allChannels, appendMessageContent, appendMessagePlainText, buildChunkTree, channelName, classificateDocumentCategory, collectTreeLeaves, configurableStoreNamespace, convertToUrlPath, createAgentConnections, createMessageAppendContextTracker, createXpertGraph, createXpertNodes, embeddingCubeCollectionName, extractSemanticModelDraft, figureOutXpert, filterMessageText, findStartNodes, genJSONParseKey, genJSONStringifyKey, genListOperatorKey, genPipelineChunkerKey, genPipelineKnowledgeBaseKey, genPipelineProcessorKey, genPipelineSourceKey, genPipelineUnderstandingKey, genVariableAggregatorKey, genXpertDBDeleteKey, genXpertDBInsertKey, genXpertDBQueryKey, genXpertDBSqlKey, genXpertDBUpdateKey, genXpertIteratorKey, genXpertMiddlewareKey, genXpertSkillKey, genXpertStartKey, genXpertTriggerKey, generateCronExpression, getAgentMiddlewareNodes, getAgentVarGroup, getCurrentGraph, getEnabledTools, getStoreNamespace, getSwarmPartners, getToolCallFromConfig, getToolCallIdFromConfig, getToolLabel, getVariableSchema, getWorkflowTriggers, getWorkspaceFromRunnable, inferMessageAppendContext, isAgentKey, isAudioType, isDocumentSheet, isEnableTool, isImageType, isInterruptMessage, isIteratingKey, isIteratorKey, isMessageGroup, isMiddlewareToolEnabled, isRouterKey, isToolEnabled, isVideoType, isXpertNodeType, letterStartSUID, locateNodes, mapTranslationLanguage, messageContentText, omitXpertRelations, resolveMessageAppendContext, setStateVariable, shortTitle, stringifyMessageContent, transformInstallation, uuid, workflowNodeIdentifier, xpertLabel };
|