@metad/contracts 3.8.4 → 3.9.0-beta.0

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 CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var ShortUniqueId = require('short-unique-id');
4
- var chatkitTypes = require('@xpert-ai/chatkit-types');
5
4
 
6
5
  function _array_like_to_array$6(arr, len) {
7
6
  if (len == null || len > arr.length) len = arr.length;
@@ -38,6 +37,7 @@ var uuid = function() {
38
37
  }
39
38
  return (_uuidGenerator = uuidGenerator).randomUUID.apply(_uuidGenerator, _to_consumable_array$2(args));
40
39
  };
40
+ // Parameters
41
41
  exports.ParameterTypeEnum = void 0;
42
42
  (function(ParameterTypeEnum) {
43
43
  ParameterTypeEnum["STRING"] = "string";
@@ -918,26 +918,31 @@ exports.OrganizationDemoNetworkEnum = void 0;
918
918
  /**
919
919
  * Here is the intermediate type definition converted from the actual schema type to the xmla file format.
920
920
  * But the type definition here can also be referenced by the actual schema definition.
921
+ */ /**
922
+ * Mondrian 仅支持三种 Dimension 类型,
923
+ * 更丰富的语义可以通过 Semantics 来定义
921
924
  */ var DimensionType;
922
925
  (function(DimensionType) {
923
926
  DimensionType["StandardDimension"] = "StandardDimension";
924
927
  DimensionType["TimeDimension"] = "TimeDimension";
925
928
  DimensionType["MeasuresDimension"] = "MeasuresDimension";
926
929
  })(DimensionType || (DimensionType = {}));
927
- var Access;
930
+ /**
931
+ * enumerates the allowable access rights.
932
+ */ var Access;
928
933
  (function(Access) {
929
934
  /**
930
- * No access to an object and its children.
931
- */ Access["none"] = "none";
935
+ * No access to an object and its children.
936
+ */ Access["none"] = "none";
932
937
  /**
933
- * A grant that covers none of the children unless explicitly granted.
934
- */ Access["custom"] = "custom";
938
+ * A grant that covers none of the children unless explicitly granted.
939
+ */ Access["custom"] = "custom";
935
940
  /**
936
- * Access to all shared dimensions (applies to schema grant).
937
- */ Access["all_dimensions"] = "all_dimensions";
941
+ * Access to all shared dimensions (applies to schema grant).
942
+ */ Access["all_dimensions"] = "all_dimensions";
938
943
  /**
939
- * All access to an object and its children.
940
- */ Access["all"] = "all";
944
+ * All access to an object and its children.
945
+ */ Access["all"] = "all";
941
946
  })(Access || (Access = {}));
942
947
  var RollupPolicy;
943
948
  (function(RollupPolicy) {
@@ -947,10 +952,10 @@ var RollupPolicy;
947
952
  })(RollupPolicy || (RollupPolicy = {}));
948
953
 
949
954
  var schema = /*#__PURE__*/Object.freeze({
950
- __proto__: null,
951
- get Access () { return Access; },
952
- get DimensionType () { return DimensionType; },
953
- get RollupPolicy () { return RollupPolicy; }
955
+ __proto__: null,
956
+ get Access () { return Access; },
957
+ get DimensionType () { return DimensionType; },
958
+ get RollupPolicy () { return RollupPolicy; }
954
959
  });
955
960
 
956
961
  exports.ChatDashboardMessageType = void 0;
@@ -1073,22 +1078,28 @@ var IndicatorOptionFields = [
1073
1078
  "aggregator",
1074
1079
  "calendar"
1075
1080
  ];
1076
- exports.IndicatorType = void 0;
1081
+ /**
1082
+ * Indicator Type:
1083
+ * * Basic indicators
1084
+ * * Derivative Indicators
1085
+ */ exports.IndicatorType = void 0;
1077
1086
  (function(IndicatorType) {
1078
1087
  IndicatorType["BASIC"] = "BASIC";
1079
1088
  IndicatorType["DERIVE"] = "DERIVE";
1080
1089
  })(exports.IndicatorType || (exports.IndicatorType = {}));
1081
- exports.IndicatorStatusEnum = void 0;
1090
+ /**
1091
+ * Status of the indicator
1092
+ */ exports.IndicatorStatusEnum = void 0;
1082
1093
  (function(IndicatorStatusEnum) {
1083
1094
  /**
1084
- * draft
1085
- */ IndicatorStatusEnum["DRAFT"] = "DRAFT";
1095
+ * draft
1096
+ */ IndicatorStatusEnum["DRAFT"] = "DRAFT";
1086
1097
  /**
1087
- * Published
1088
- */ IndicatorStatusEnum["RELEASED"] = "RELEASED";
1098
+ * Published
1099
+ */ IndicatorStatusEnum["RELEASED"] = "RELEASED";
1089
1100
  /**
1090
- * Offline Archive
1091
- */ IndicatorStatusEnum["ARCHIVED"] = "ARCHIVED";
1101
+ * Offline Archive
1102
+ */ IndicatorStatusEnum["ARCHIVED"] = "ARCHIVED";
1092
1103
  })(exports.IndicatorStatusEnum || (exports.IndicatorStatusEnum = {}));
1093
1104
 
1094
1105
  exports.TimeGranularity = void 0;
@@ -1098,6 +1109,7 @@ exports.TimeGranularity = void 0;
1098
1109
  TimeGranularity["Month"] = "Month";
1099
1110
  TimeGranularity["Week"] = "Week";
1100
1111
  TimeGranularity["Day"] = "Day";
1112
+ // @todo more
1101
1113
  })(exports.TimeGranularity || (exports.TimeGranularity = {}));
1102
1114
  exports.IndicatorTagEnum = void 0;
1103
1115
  (function(IndicatorTagEnum) {
@@ -1142,31 +1154,39 @@ exports.AnalyticsPermissionsEnum = void 0;
1142
1154
  AnalyticsPermissionsEnum["PERMISSION_APPROVAL_EDIT"] = "PERMISSION_APPROVAL_EDIT";
1143
1155
  })(exports.AnalyticsPermissionsEnum || (exports.AnalyticsPermissionsEnum = {}));
1144
1156
 
1145
- exports.AgentType = void 0;
1157
+ /**
1158
+ * Data agent types
1159
+ */ exports.AgentType = void 0;
1146
1160
  (function(AgentType) {
1147
1161
  AgentType["Local"] = "local";
1148
1162
  AgentType["Browser"] = "browser";
1149
1163
  AgentType["Server"] = "server";
1150
1164
  AgentType["Wasm"] = "wasm";
1151
1165
  })(exports.AgentType || (exports.AgentType = {}));
1152
- exports.ModelTypeEnum = void 0;
1166
+ /**
1167
+ * Types of semantic model
1168
+ */ exports.ModelTypeEnum = void 0;
1153
1169
  (function(ModelTypeEnum) {
1154
1170
  ModelTypeEnum["XMLA"] = "XMLA";
1155
1171
  ModelTypeEnum["SQL"] = "SQL";
1156
1172
  })(exports.ModelTypeEnum || (exports.ModelTypeEnum = {}));
1157
- exports.RoleTypeEnum = void 0;
1173
+ /**
1174
+ * Role types
1175
+ */ exports.RoleTypeEnum = void 0;
1158
1176
  (function(RoleTypeEnum) {
1159
1177
  RoleTypeEnum["single"] = "single";
1160
1178
  RoleTypeEnum["union"] = "union";
1161
1179
  })(exports.RoleTypeEnum || (exports.RoleTypeEnum = {}));
1162
- exports.SemanticModelStatusEnum = void 0;
1180
+ /**
1181
+ * Status of semantic model
1182
+ */ exports.SemanticModelStatusEnum = void 0;
1163
1183
  (function(SemanticModelStatusEnum) {
1164
1184
  /**
1165
- * Using
1166
- */ SemanticModelStatusEnum["Progressing"] = "progressing";
1185
+ * Using
1186
+ */ SemanticModelStatusEnum["Progressing"] = "progressing";
1167
1187
  /**
1168
- * Archived
1169
- */ SemanticModelStatusEnum["Archived"] = "archived";
1188
+ * Archived
1189
+ */ SemanticModelStatusEnum["Archived"] = "archived";
1170
1190
  })(exports.SemanticModelStatusEnum || (exports.SemanticModelStatusEnum = {}));
1171
1191
  function extractSemanticModelDraft(model) {
1172
1192
  var _model_options, _model_options1;
@@ -1199,38 +1219,40 @@ function embeddingCubeCollectionName(modelKey, cube, isDraft) {
1199
1219
  exports.StoryStatusEnum = void 0;
1200
1220
  (function(StoryStatusEnum) {
1201
1221
  /**
1202
- * 草稿
1203
- */ StoryStatusEnum["DRAFT"] = "DRAFT";
1222
+ * 草稿
1223
+ */ StoryStatusEnum["DRAFT"] = "DRAFT";
1204
1224
  /**
1205
- * 重新编辑
1206
- */ StoryStatusEnum["CHANGING"] = "CHANGING";
1225
+ * 重新编辑
1226
+ */ StoryStatusEnum["CHANGING"] = "CHANGING";
1207
1227
  /**
1208
- * 审阅中
1209
- */ StoryStatusEnum["REVIEW"] = "REVIEW";
1228
+ * 审阅中
1229
+ */ StoryStatusEnum["REVIEW"] = "REVIEW";
1210
1230
  /**
1211
- * 通过
1212
- */ StoryStatusEnum["APPROVED"] = "APPROVED";
1231
+ * 通过
1232
+ */ StoryStatusEnum["APPROVED"] = "APPROVED";
1213
1233
  /**
1214
- * 退回
1215
- */ StoryStatusEnum["REJECTED"] = "REJECTED";
1234
+ * 退回
1235
+ */ StoryStatusEnum["REJECTED"] = "REJECTED";
1216
1236
  /**
1217
- * 已发布
1218
- */ StoryStatusEnum["RELEASED"] = "RELEASED";
1237
+ * 已发布
1238
+ */ StoryStatusEnum["RELEASED"] = "RELEASED";
1219
1239
  /**
1220
- * 下线存档
1221
- */ StoryStatusEnum["ARCHIVED"] = "ARCHIVED";
1240
+ * 下线存档
1241
+ */ StoryStatusEnum["ARCHIVED"] = "ARCHIVED";
1222
1242
  })(exports.StoryStatusEnum || (exports.StoryStatusEnum = {}));
1223
- exports.AccessEnum = void 0;
1243
+ /**
1244
+ * 用户对某个实体的访问权限
1245
+ */ exports.AccessEnum = void 0;
1224
1246
  (function(AccessEnum) {
1225
1247
  /**
1226
- * 可看到
1227
- */ AccessEnum["View"] = "View";
1248
+ * 可看到
1249
+ */ AccessEnum["View"] = "View";
1228
1250
  /**
1229
- * 可读取详情
1230
- */ AccessEnum["Read"] = "Read";
1251
+ * 可读取详情
1252
+ */ AccessEnum["Read"] = "Read";
1231
1253
  /**
1232
- * 可编辑
1233
- */ AccessEnum["Write"] = "Write";
1254
+ * 可编辑
1255
+ */ AccessEnum["Write"] = "Write";
1234
1256
  })(exports.AccessEnum || (exports.AccessEnum = {}));
1235
1257
 
1236
1258
  exports.SubscriptionType = void 0;
@@ -1297,11 +1319,11 @@ var PermissionApprovalStatus = {
1297
1319
  exports.ProjectStatusEnum = void 0;
1298
1320
  (function(ProjectStatusEnum) {
1299
1321
  /**
1300
- * In use
1301
- */ ProjectStatusEnum["Progressing"] = "Progressing";
1322
+ * In use
1323
+ */ ProjectStatusEnum["Progressing"] = "Progressing";
1302
1324
  /**
1303
- * Archived
1304
- */ ProjectStatusEnum["Archived"] = "Archived";
1325
+ * Archived
1326
+ */ ProjectStatusEnum["Archived"] = "Archived";
1305
1327
  })(exports.ProjectStatusEnum || (exports.ProjectStatusEnum = {}));
1306
1328
 
1307
1329
  exports.StoryTemplateType = void 0;
@@ -1318,17 +1340,52 @@ exports.QueryStatusEnum = void 0;
1318
1340
  QueryStatusEnum["FAILED"] = "failed";
1319
1341
  })(exports.QueryStatusEnum || (exports.QueryStatusEnum = {}));
1320
1342
 
1343
+ exports.AssistantCode = void 0;
1344
+ (function(AssistantCode) {
1345
+ AssistantCode["CHAT_COMMON"] = "chat_common";
1346
+ AssistantCode["XPERT_SHARED"] = "xpert_shared";
1347
+ AssistantCode["CHATBI"] = "chatbi";
1348
+ AssistantCode["CLAWXPERT"] = "clawxpert";
1349
+ })(exports.AssistantCode || (exports.AssistantCode = {}));
1350
+ exports.AssistantBindingScope = void 0;
1351
+ (function(AssistantBindingScope) {
1352
+ AssistantBindingScope["TENANT"] = "tenant";
1353
+ AssistantBindingScope["ORGANIZATION"] = "organization";
1354
+ AssistantBindingScope["USER"] = "user";
1355
+ })(exports.AssistantBindingScope || (exports.AssistantBindingScope = {}));
1356
+ exports.AssistantBindingSourceScope = void 0;
1357
+ (function(AssistantBindingSourceScope) {
1358
+ AssistantBindingSourceScope["NONE"] = "none";
1359
+ AssistantBindingSourceScope["TENANT"] = "tenant";
1360
+ AssistantBindingSourceScope["ORGANIZATION"] = "organization";
1361
+ })(exports.AssistantBindingSourceScope || (exports.AssistantBindingSourceScope = {}));
1362
+ var USER_MANAGED_ASSISTANTS = new Set([
1363
+ exports.AssistantCode.CLAWXPERT
1364
+ ]);
1365
+ function getAssistantManagement(code) {
1366
+ return USER_MANAGED_ASSISTANTS.has(code) ? "user" : "system";
1367
+ }
1368
+ function isUserManagedAssistant(code) {
1369
+ return getAssistantManagement(code) === "user";
1370
+ }
1371
+ function isSystemManagedAssistant(code) {
1372
+ return getAssistantManagement(code) === "system";
1373
+ }
1374
+
1321
1375
  exports.ProviderType = void 0;
1322
1376
  (function(ProviderType) {
1323
1377
  ProviderType["CUSTOM"] = "custom";
1324
1378
  ProviderType["SYSTEM"] = "system";
1325
1379
  })(exports.ProviderType || (exports.ProviderType = {}));
1326
- exports.CredentialFormTypeEnum = void 0;
1380
+ /**
1381
+ * @todo Use JSON Schema to implement
1382
+ */ exports.CredentialFormTypeEnum = void 0;
1327
1383
  (function(CredentialFormTypeEnum) {
1328
1384
  CredentialFormTypeEnum["TEXT_INPUT"] = "text-input";
1329
1385
  CredentialFormTypeEnum["SECRET_INPUT"] = "secret-input";
1330
1386
  CredentialFormTypeEnum["SELECT"] = "select";
1331
1387
  CredentialFormTypeEnum["RADIO"] = "radio";
1388
+ // SWITCH = "switch", // use ParameterType.BOOLEAN
1332
1389
  })(exports.CredentialFormTypeEnum || (exports.CredentialFormTypeEnum = {}));
1333
1390
  exports.FetchFrom = void 0;
1334
1391
  (function(FetchFrom) {
@@ -1364,7 +1421,9 @@ exports.ConfigurateMethod = void 0;
1364
1421
  ConfigurateMethod["PREDEFINED_MODEL"] = "predefined-model";
1365
1422
  ConfigurateMethod["CUSTOMIZABLE_MODEL"] = "customizable-model";
1366
1423
  })(exports.ConfigurateMethod || (exports.ConfigurateMethod = {}));
1367
- exports.ParameterType = void 0;
1424
+ /**
1425
+ * @todo Use JSON Schema to implement
1426
+ */ exports.ParameterType = void 0;
1368
1427
  (function(ParameterType) {
1369
1428
  ParameterType["FLOAT"] = "float";
1370
1429
  ParameterType["INT"] = "int";
@@ -1386,58 +1445,62 @@ exports.PriceType = void 0;
1386
1445
  AiBusinessRole["FinanceBP"] = "finance_bp";
1387
1446
  AiBusinessRole["SupplyChainExpert"] = "supply_chain_expert";
1388
1447
  })(exports.AiBusinessRole || (exports.AiBusinessRole = {}));
1389
- exports.AiProvider = void 0;
1448
+ /**
1449
+ * Providers for LLMs
1450
+ *
1451
+ * - https://js.langchain.com/docs/integrations/chat/
1452
+ */ exports.AiProvider = void 0;
1390
1453
  (function(AiProvider) {
1391
1454
  /**
1392
- * - https://js.langchain.com/docs/integrations/chat/openai/
1393
- */ AiProvider["OpenAI"] = "openai";
1455
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1456
+ */ AiProvider["OpenAI"] = "openai";
1394
1457
  /**
1395
- * - https://js.langchain.com/docs/integrations/chat/openai/
1396
- */ AiProvider["Azure"] = "azure";
1458
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1459
+ */ AiProvider["Azure"] = "azure";
1397
1460
  // DashScope = 'dashscope',
1398
1461
  /**
1399
- * - https://ollama.com/
1400
- * - https://js.langchain.com/docs/integrations/chat/ollama/
1401
- */ AiProvider["Ollama"] = "ollama";
1462
+ * - https://ollama.com/
1463
+ * - https://js.langchain.com/docs/integrations/chat/ollama/
1464
+ */ AiProvider["Ollama"] = "ollama";
1402
1465
  /**
1403
- * - https://www.deepseek.com/zh
1404
- * - https://js.langchain.com/docs/integrations/chat/openai/
1405
- */ AiProvider["DeepSeek"] = "deepseek";
1466
+ * - https://www.deepseek.com/zh
1467
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1468
+ */ AiProvider["DeepSeek"] = "deepseek";
1406
1469
  /**
1407
- * - https://docs.anthropic.com/en/home
1408
- * - https://js.langchain.com/docs/integrations/chat/anthropic/
1409
- */ AiProvider["Anthropic"] = "anthropic";
1470
+ * - https://docs.anthropic.com/en/home
1471
+ * - https://js.langchain.com/docs/integrations/chat/anthropic/
1472
+ */ AiProvider["Anthropic"] = "anthropic";
1410
1473
  /**
1411
- * - https://www.aliyun.com/product/bailian
1412
- * - https://js.langchain.com/docs/integrations/chat/alibaba_tongyi/
1413
- */ AiProvider["AlibabaTongyi"] = "alibaba_tongyi";
1474
+ * - https://www.aliyun.com/product/bailian
1475
+ * - https://js.langchain.com/docs/integrations/chat/alibaba_tongyi/
1476
+ */ AiProvider["AlibabaTongyi"] = "alibaba_tongyi";
1414
1477
  /**
1415
- * - https://open.bigmodel.cn/
1416
- * - https://js.langchain.com/docs/integrations/chat/openai/
1417
- */ AiProvider["Zhipu"] = "zhipu";
1478
+ * - https://open.bigmodel.cn/
1479
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1480
+ */ AiProvider["Zhipu"] = "zhipu";
1418
1481
  /**
1419
- * - https://qianfan.cloud.baidu.com/
1420
- * - https://js.langchain.com/docs/integrations/chat/baidu_qianfan/
1421
- */ AiProvider["BaiduQianfan"] = "baidu_qianfan";
1482
+ * - https://qianfan.cloud.baidu.com/
1483
+ * - https://js.langchain.com/docs/integrations/chat/baidu_qianfan/
1484
+ */ AiProvider["BaiduQianfan"] = "baidu_qianfan";
1422
1485
  /**
1423
- * - https://www.together.ai/
1424
- * - https://js.langchain.com/docs/integrations/chat/togetherai/
1425
- */ AiProvider["Together"] = "together";
1486
+ * - https://www.together.ai/
1487
+ * - https://js.langchain.com/docs/integrations/chat/togetherai/
1488
+ */ AiProvider["Together"] = "together";
1426
1489
  /**
1427
- * - https://platform.moonshot.cn/console
1428
- * - https://js.langchain.com/docs/integrations/chat/openai/
1429
- */ AiProvider["Moonshot"] = "moonshot";
1490
+ * - https://platform.moonshot.cn/console
1491
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1492
+ */ AiProvider["Moonshot"] = "moonshot";
1430
1493
  /**
1431
- * - https://groq.com/
1432
- * - https://js.langchain.com/docs/integrations/chat/openai/
1433
- */ AiProvider["Groq"] = "groq";
1494
+ * - https://groq.com/
1495
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1496
+ */ AiProvider["Groq"] = "groq";
1434
1497
  /**
1435
- * - https://mistral.ai/
1436
- *
1437
- */ AiProvider["Mistral"] = "mistral";
1498
+ * - https://mistral.ai/
1499
+ *
1500
+ */ AiProvider["Mistral"] = "mistral";
1438
1501
  /**
1439
- * - https://cohere.com/
1440
- */ AiProvider["Cohere"] = "cohere";
1502
+ * - https://cohere.com/
1503
+ */ AiProvider["Cohere"] = "cohere";
1441
1504
  })(exports.AiProvider || (exports.AiProvider = {}));
1442
1505
  exports.AiProtocol = void 0;
1443
1506
  (function(AiProtocol) {
@@ -1445,15 +1508,53 @@ exports.AiProtocol = void 0;
1445
1508
  AiProtocol["Others"] = "others";
1446
1509
  })(exports.AiProtocol || (exports.AiProtocol = {}));
1447
1510
  var OpenAIEmbeddingsProviders = [
1448
- "openai",
1449
- "azure",
1450
- "deepseek"
1511
+ exports.AiProvider.OpenAI,
1512
+ exports.AiProvider.Azure,
1513
+ exports.AiProvider.DeepSeek
1451
1514
  ];
1452
1515
  var OllamaEmbeddingsProviders = [
1453
- "ollama"
1516
+ exports.AiProvider.Ollama
1454
1517
  ];
1455
1518
 
1456
- exports.ChatGatewayEvent = void 0;
1519
+ function _define_property$6(obj, key, value) {
1520
+ if (key in obj) {
1521
+ Object.defineProperty(obj, key, {
1522
+ value: value,
1523
+ enumerable: true,
1524
+ configurable: true,
1525
+ writable: true
1526
+ });
1527
+ } else {
1528
+ obj[key] = value;
1529
+ }
1530
+ return obj;
1531
+ }
1532
+ function _object_spread$5(target) {
1533
+ for(var i = 1; i < arguments.length; i++){
1534
+ var source = arguments[i] != null ? arguments[i] : {};
1535
+ var ownKeys = Object.keys(source);
1536
+ if (typeof Object.getOwnPropertySymbols === "function") {
1537
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1538
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1539
+ }));
1540
+ }
1541
+ ownKeys.forEach(function(key) {
1542
+ _define_property$6(target, key, source[key]);
1543
+ });
1544
+ }
1545
+ return target;
1546
+ }
1547
+ var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
1548
+ var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
1549
+ function createConversationTitleSummaryEvent(event) {
1550
+ return _object_spread$5({
1551
+ type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
1552
+ }, event);
1553
+ }
1554
+
1555
+ /**
1556
+ * @deprecated use ChatMessageEventTypeEnum
1557
+ */ exports.ChatGatewayEvent = void 0;
1457
1558
  (function(ChatGatewayEvent) {
1458
1559
  ChatGatewayEvent["ACK"] = "ack";
1459
1560
  ChatGatewayEvent["ConversationCreated"] = "conversation_created";
@@ -1489,7 +1590,9 @@ var MEMORY_PROFILE_PROMPT = "Extract new user profile information from the above
1489
1590
 
1490
1591
  var USAGE_HOUR_FORMAT = "yyyy-MM-dd HH";
1491
1592
 
1492
- exports.AiProviderRole = void 0;
1593
+ /**
1594
+ * The order of priority is: `Embedding`, `Secondary`, `Primary`
1595
+ */ exports.AiProviderRole = void 0;
1493
1596
  (function(AiProviderRole) {
1494
1597
  AiProviderRole["Primary"] = "primary";
1495
1598
  AiProviderRole["Secondary"] = "secondary";
@@ -1503,6 +1606,10 @@ exports.AiFeatureEnum = void 0;
1503
1606
  AiFeatureEnum["FEATURE_COPILOT_KNOWLEDGEBASE"] = "FEATURE_COPILOT_KNOWLEDGEBASE";
1504
1607
  AiFeatureEnum["FEATURE_COPILOT_CHAT"] = "FEATURE_COPILOT_CHAT";
1505
1608
  AiFeatureEnum["FEATURE_XPERT"] = "FEATURE_XPERT";
1609
+ AiFeatureEnum["FEATURE_XPERT_CHATBI"] = "FEATURE_XPERT_CHATBI";
1610
+ AiFeatureEnum["FEATURE_XPERT_CLAWXPERT"] = "FEATURE_XPERT_CLAWXPERT";
1611
+ AiFeatureEnum["FEATURE_XPERT_CODEXPERT"] = "FEATURE_XPERT_CODEXPERT";
1612
+ AiFeatureEnum["FEATURE_XPERT_DEEP_RESEARCH"] = "FEATURE_XPERT_DEEP_RESEARCH";
1506
1613
  })(exports.AiFeatureEnum || (exports.AiFeatureEnum = {}));
1507
1614
 
1508
1615
  exports.VectorTypeEnum = void 0;
@@ -1539,14 +1646,14 @@ exports.KDocumentWebTypeEnum = void 0;
1539
1646
  })(exports.KDocumentWebTypeEnum || (exports.KDocumentWebTypeEnum = {}));
1540
1647
  var KDocumentWebTypeOptions = [
1541
1648
  {
1542
- value: "playwright",
1649
+ value: exports.KDocumentWebTypeEnum.Playwright,
1543
1650
  label: {
1544
1651
  en_US: "Playwright"
1545
1652
  },
1546
1653
  icon: '<svg width="100%" height="100%" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M136.444 221.556C123.558 225.213 115.104 231.625 109.535 238.032C114.869 233.364 122.014 229.08 131.652 226.348C141.51 223.554 149.92 223.574 156.869 224.915V219.481C150.941 218.939 144.145 219.371 136.444 221.556ZM108.946 175.876L61.0895 188.484C61.0895 188.484 61.9617 189.716 63.5767 191.36L104.153 180.668C104.153 180.668 103.578 188.077 98.5847 194.705C108.03 187.559 108.946 175.876 108.946 175.876ZM149.005 288.347C81.6582 306.486 46.0272 228.438 35.2396 187.928C30.2556 169.229 28.0799 155.067 27.5 145.928C27.4377 144.979 27.4665 144.179 27.5336 143.446C24.04 143.657 22.3674 145.473 22.7077 150.721C23.2876 159.855 25.4633 174.016 30.4473 192.721C41.2301 233.225 76.8659 311.273 144.213 293.134C158.872 289.185 169.885 281.992 178.152 272.81C170.532 279.692 160.995 285.112 149.005 288.347ZM161.661 128.11V132.903H188.077C187.535 131.206 186.989 129.677 186.447 128.11H161.661Z" fill="#2D4552"/>\n<path d="M193.981 167.584C205.861 170.958 212.144 179.287 215.465 186.658L228.711 190.42C228.711 190.42 226.904 164.623 203.57 157.995C181.741 151.793 168.308 170.124 166.674 172.496C173.024 167.972 182.297 164.268 193.981 167.584ZM299.422 186.777C277.573 180.547 264.145 198.916 262.535 201.255C268.89 196.736 278.158 193.031 289.837 196.362C301.698 199.741 307.976 208.06 311.307 215.436L324.572 219.212C324.572 219.212 322.736 193.41 299.422 186.777ZM286.262 254.795L176.072 223.99C176.072 223.99 177.265 230.038 181.842 237.869L274.617 263.805C282.255 259.386 286.262 254.795 286.262 254.795ZM209.867 321.102C122.618 297.71 133.166 186.543 147.284 133.865C153.097 112.156 159.073 96.0203 164.029 85.204C161.072 84.5953 158.623 86.1529 156.203 91.0746C150.941 101.747 144.212 119.124 137.7 143.45C123.586 196.127 113.038 307.29 200.283 330.682C241.406 341.699 273.442 324.955 297.323 298.659C274.655 319.19 245.714 330.701 209.867 321.102Z" fill="#2D4552"/>\n<path d="M161.661 262.296V239.863L99.3324 257.537C99.3324 257.537 103.938 230.777 136.444 221.556C146.302 218.762 154.713 218.781 161.661 220.123V128.11H192.869C189.471 117.61 186.184 109.526 183.423 103.909C178.856 94.612 174.174 100.775 163.545 109.665C156.059 115.919 137.139 129.261 108.668 136.933C80.1966 144.61 57.179 142.574 47.5752 140.911C33.9601 138.562 26.8387 135.572 27.5049 145.928C28.0847 155.062 30.2605 169.224 35.2445 187.928C46.0272 228.433 81.663 306.481 149.01 288.342C166.602 283.602 179.019 274.233 187.626 262.291H161.661V262.296ZM61.0848 188.484L108.946 175.876C108.946 175.876 107.551 194.288 89.6087 199.018C71.6614 203.743 61.0848 188.484 61.0848 188.484Z" fill="#E2574C"/>\n<path d="M341.786 129.174C329.345 131.355 299.498 134.072 262.612 124.185C225.716 114.304 201.236 97.0224 191.537 88.8994C177.788 77.3834 171.74 69.3802 165.788 81.4857C160.526 92.163 153.797 109.54 147.284 133.866C133.171 186.543 122.623 297.706 209.867 321.098C297.093 344.47 343.53 242.92 357.644 190.238C364.157 165.917 367.013 147.5 367.799 135.625C368.695 122.173 359.455 126.078 341.786 129.174ZM166.497 172.756C166.497 172.756 180.246 151.372 203.565 158C226.899 164.628 228.706 190.425 228.706 190.425L166.497 172.756ZM223.42 268.713C182.403 256.698 176.077 223.99 176.077 223.99L286.262 254.796C286.262 254.791 264.021 280.578 223.42 268.713ZM262.377 201.495C262.377 201.495 276.107 180.126 299.422 186.773C322.736 193.411 324.572 219.208 324.572 219.208L262.377 201.495Z" fill="#2EAD33"/>\n<path d="M139.88 246.04L99.3324 257.532C99.3324 257.532 103.737 232.44 133.607 222.496L110.647 136.33L108.663 136.933C80.1918 144.611 57.1742 142.574 47.5704 140.911C33.9554 138.563 26.834 135.572 27.5001 145.929C28.08 155.063 30.2557 169.224 35.2397 187.929C46.0225 228.433 81.6583 306.481 149.005 288.342L150.989 287.719L139.88 246.04ZM61.0848 188.485L108.946 175.876C108.946 175.876 107.551 194.288 89.6087 199.018C71.6615 203.743 61.0848 188.485 61.0848 188.485Z" fill="#D65348"/>\n<path d="M225.27 269.163L223.415 268.712C182.398 256.698 176.072 223.99 176.072 223.99L232.89 239.872L262.971 124.281L262.607 124.185C225.711 114.304 201.232 97.0224 191.532 88.8994C177.783 77.3834 171.735 69.3802 165.783 81.4857C160.526 92.163 153.797 109.54 147.284 133.866C133.171 186.543 122.623 297.706 209.867 321.097L211.655 321.5L225.27 269.163ZM166.497 172.756C166.497 172.756 180.246 151.372 203.565 158C226.899 164.628 228.706 190.425 228.706 190.425L166.497 172.756Z" fill="#1D8D22"/>\n<path d="M141.946 245.451L131.072 248.537C133.641 263.019 138.169 276.917 145.276 289.195C146.513 288.922 147.74 288.687 149 288.342C152.302 287.451 155.364 286.348 158.312 285.145C150.371 273.361 145.118 259.789 141.946 245.451ZM137.7 143.451C132.112 164.307 127.113 194.326 128.489 224.436C130.952 223.367 133.554 222.371 136.444 221.551L138.457 221.101C136.003 188.939 141.308 156.165 147.284 133.866C148.799 128.225 150.318 122.978 151.832 118.085C149.393 119.637 146.767 121.228 143.776 122.867C141.759 129.093 139.722 135.898 137.7 143.451Z" fill="#C04B41"/>\n</svg>'
1547
1654
  },
1548
1655
  {
1549
- value: "firecrawl",
1656
+ value: exports.KDocumentWebTypeEnum.FireCrawl,
1550
1657
  label: {
1551
1658
  en_US: "FireCrawl"
1552
1659
  },
@@ -1559,19 +1666,19 @@ exports.WorkflowNodeTypeEnum = void 0;
1559
1666
  WorkflowNodeTypeEnum["START"] = "start";
1560
1667
  WorkflowNodeTypeEnum["END"] = "end";
1561
1668
  /**
1562
- * Trigger
1563
- */ WorkflowNodeTypeEnum["TRIGGER"] = "trigger";
1669
+ * Trigger
1670
+ */ WorkflowNodeTypeEnum["TRIGGER"] = "trigger";
1564
1671
  /**
1565
- * State Variable Assigner
1566
- */ WorkflowNodeTypeEnum["ASSIGNER"] = "assigner";
1672
+ * State Variable Assigner
1673
+ */ WorkflowNodeTypeEnum["ASSIGNER"] = "assigner";
1567
1674
  /**
1568
- * Router
1569
- */ WorkflowNodeTypeEnum["IF_ELSE"] = "if-else";
1675
+ * Router
1676
+ */ WorkflowNodeTypeEnum["IF_ELSE"] = "if-else";
1570
1677
  WorkflowNodeTypeEnum["LIST_OPERATOR"] = "list-operator";
1571
1678
  WorkflowNodeTypeEnum["VARIABLE_AGGREGATOR"] = "variable-aggregator";
1572
1679
  /**
1573
- * @deprecated use ITERATOR instead
1574
- */ WorkflowNodeTypeEnum["ITERATING"] = "iterating";
1680
+ * @deprecated use ITERATOR instead
1681
+ */ WorkflowNodeTypeEnum["ITERATING"] = "iterating";
1575
1682
  WorkflowNodeTypeEnum["ITERATOR"] = "iterator";
1576
1683
  WorkflowNodeTypeEnum["HTTP"] = "http";
1577
1684
  WorkflowNodeTypeEnum["SUBFLOW"] = "subflow";
@@ -1579,8 +1686,8 @@ exports.WorkflowNodeTypeEnum = void 0;
1579
1686
  WorkflowNodeTypeEnum["AGENT_TOOL"] = "agent-tool";
1580
1687
  WorkflowNodeTypeEnum["NOTE"] = "note";
1581
1688
  /**
1582
- * Task node, distribute tasks to sub-agents
1583
- */ WorkflowNodeTypeEnum["TASK"] = "task";
1689
+ * Task node, distribute tasks to sub-agents
1690
+ */ WorkflowNodeTypeEnum["TASK"] = "task";
1584
1691
  // Knowledge Pipeline nodes
1585
1692
  WorkflowNodeTypeEnum["SOURCE"] = "source";
1586
1693
  WorkflowNodeTypeEnum["PROCESSOR"] = "processor";
@@ -1601,20 +1708,20 @@ exports.WorkflowNodeTypeEnum = void 0;
1601
1708
  // 📦 Database Operation Nodes
1602
1709
  // ===============================
1603
1710
  /**
1604
- * Custom SQL
1605
- */ WorkflowNodeTypeEnum["DB_SQL"] = "db-sql";
1711
+ * Custom SQL
1712
+ */ WorkflowNodeTypeEnum["DB_SQL"] = "db-sql";
1606
1713
  /**
1607
- * Insert data (INSERT)
1608
- */ WorkflowNodeTypeEnum["DB_INSERT"] = "db-insert";
1714
+ * Insert data (INSERT)
1715
+ */ WorkflowNodeTypeEnum["DB_INSERT"] = "db-insert";
1609
1716
  /**
1610
- * Update data (UPDATE)
1611
- */ WorkflowNodeTypeEnum["DB_UPDATE"] = "db-update";
1717
+ * Update data (UPDATE)
1718
+ */ WorkflowNodeTypeEnum["DB_UPDATE"] = "db-update";
1612
1719
  /**
1613
- * Delete data (DELETE)
1614
- */ WorkflowNodeTypeEnum["DB_DELETE"] = "db-delete";
1720
+ * Delete data (DELETE)
1721
+ */ WorkflowNodeTypeEnum["DB_DELETE"] = "db-delete";
1615
1722
  /**
1616
- * Query data (SELECT)
1617
- */ WorkflowNodeTypeEnum["DB_QUERY"] = "db-query";
1723
+ * Query data (SELECT)
1724
+ */ WorkflowNodeTypeEnum["DB_QUERY"] = "db-query";
1618
1725
  // ===============================
1619
1726
  // 🏆 Pro Nodes
1620
1727
  // ===============================
@@ -1704,14 +1811,14 @@ function workflowNodeIdentifier(node) {
1704
1811
  exports.XpertTypeEnum = void 0;
1705
1812
  (function(XpertTypeEnum) {
1706
1813
  /**
1707
- * Chat Agents
1708
- */ XpertTypeEnum["Agent"] = "agent";
1814
+ * Chat Agents
1815
+ */ XpertTypeEnum["Agent"] = "agent";
1709
1816
  /**
1710
- * Copilot in UI
1711
- */ XpertTypeEnum["Copilot"] = "copilot";
1817
+ * Copilot in UI
1818
+ */ XpertTypeEnum["Copilot"] = "copilot";
1712
1819
  /**
1713
- * Knowledge Workflow
1714
- */ XpertTypeEnum["Knowledge"] = "knowledge";
1820
+ * Knowledge Workflow
1821
+ */ XpertTypeEnum["Knowledge"] = "knowledge";
1715
1822
  })(exports.XpertTypeEnum || (exports.XpertTypeEnum = {}));
1716
1823
  exports.LongTermMemoryTypeEnum = void 0;
1717
1824
  (function(LongTermMemoryTypeEnum) {
@@ -1721,11 +1828,11 @@ exports.LongTermMemoryTypeEnum = void 0;
1721
1828
  exports.XpertParameterTypeEnum = void 0;
1722
1829
  (function(XpertParameterTypeEnum) {
1723
1830
  /**
1724
- * @deprecated use string
1725
- */ XpertParameterTypeEnum["TEXT"] = "text";
1831
+ * @deprecated use string
1832
+ */ XpertParameterTypeEnum["TEXT"] = "text";
1726
1833
  /**
1727
- * @deprecated use string
1728
- */ XpertParameterTypeEnum["PARAGRAPH"] = "paragraph";
1834
+ * @deprecated use string
1835
+ */ XpertParameterTypeEnum["PARAGRAPH"] = "paragraph";
1729
1836
  XpertParameterTypeEnum["STRING"] = "string";
1730
1837
  XpertParameterTypeEnum["NUMBER"] = "number";
1731
1838
  XpertParameterTypeEnum["OBJECT"] = "object";
@@ -1755,8 +1862,7 @@ function agentUniqueName(agent) {
1755
1862
  function convertToUrlPath(title) {
1756
1863
  return title === null || title === void 0 ? void 0 : title.toLowerCase() // Convert to lowercase
1757
1864
  .replace(/\s+/g, "-") // Replace spaces with -
1758
- .replace(/[^a-z0-9-]/g, "") // Remove non-alphanumeric characters
1759
- ;
1865
+ .replace(/[^a-z0-9-]/g, ""); // Remove non-alphanumeric characters
1760
1866
  }
1761
1867
  var VariableOperations = [
1762
1868
  {
@@ -1797,7 +1903,7 @@ function _array_like_to_array$5(arr, len) {
1797
1903
  function _array_with_holes$4(arr) {
1798
1904
  if (Array.isArray(arr)) return arr;
1799
1905
  }
1800
- function _define_property$4(obj, key, value) {
1906
+ function _define_property$5(obj, key, value) {
1801
1907
  if (key in obj) {
1802
1908
  Object.defineProperty(obj, key, {
1803
1909
  value: value,
@@ -1837,7 +1943,7 @@ function _iterable_to_array_limit$3(arr, i) {
1837
1943
  function _non_iterable_rest$4() {
1838
1944
  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
1945
  }
1840
- function _object_spread$3(target) {
1946
+ function _object_spread$4(target) {
1841
1947
  for(var i = 1; i < arguments.length; i++){
1842
1948
  var source = arguments[i] != null ? arguments[i] : {};
1843
1949
  var ownKeys = Object.keys(source);
@@ -1847,12 +1953,12 @@ function _object_spread$3(target) {
1847
1953
  }));
1848
1954
  }
1849
1955
  ownKeys.forEach(function(key) {
1850
- _define_property$4(target, key, source[key]);
1956
+ _define_property$5(target, key, source[key]);
1851
1957
  });
1852
1958
  }
1853
1959
  return target;
1854
1960
  }
1855
- function ownKeys$2(object, enumerableOnly) {
1961
+ function ownKeys$3(object, enumerableOnly) {
1856
1962
  var keys = Object.keys(object);
1857
1963
  if (Object.getOwnPropertySymbols) {
1858
1964
  var symbols = Object.getOwnPropertySymbols(object);
@@ -1860,12 +1966,12 @@ function ownKeys$2(object, enumerableOnly) {
1860
1966
  }
1861
1967
  return keys;
1862
1968
  }
1863
- function _object_spread_props$2(target, source) {
1969
+ function _object_spread_props$3(target, source) {
1864
1970
  source = source != null ? source : {};
1865
1971
  if (Object.getOwnPropertyDescriptors) {
1866
1972
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1867
1973
  } else {
1868
- ownKeys$2(Object(source)).forEach(function(key) {
1974
+ ownKeys$3(Object(source)).forEach(function(key) {
1869
1975
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1870
1976
  });
1871
1977
  }
@@ -1957,7 +2063,7 @@ function configurableStoreNamespace(configurable) {
1957
2063
  var _varName_split = _sliced_to_array$3(varName.split("."), 2), agentChannelName = _varName_split[0], variableName = _varName_split[1];
1958
2064
  if (variableName) {
1959
2065
  var _state_agentChannelName;
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));
2066
+ state[agentChannelName] = _object_spread_props$3(_object_spread$4({}, (_state_agentChannelName = state[agentChannelName]) !== null && _state_agentChannelName !== void 0 ? _state_agentChannelName : {}), _define_property$5({}, variableName, value));
1961
2067
  } else {
1962
2068
  state[agentChannelName] = value;
1963
2069
  }
@@ -2048,7 +2154,9 @@ function getWorkflowTriggers(graph, from) {
2048
2154
  });
2049
2155
  }
2050
2156
 
2051
- exports.KnowledgeProviderEnum = void 0;
2157
+ /**
2158
+ * Non-internal types should remain the same as IntegrationEnum.
2159
+ */ exports.KnowledgeProviderEnum = void 0;
2052
2160
  (function(KnowledgeProviderEnum) {
2053
2161
  KnowledgeProviderEnum["Internal"] = "internal";
2054
2162
  })(exports.KnowledgeProviderEnum || (exports.KnowledgeProviderEnum = {}));
@@ -2063,18 +2171,20 @@ exports.KnowledgeStructureEnum = void 0;
2063
2171
  KnowledgeStructureEnum["ParentChild"] = "parent-child";
2064
2172
  KnowledgeStructureEnum["QA"] = "qa";
2065
2173
  })(exports.KnowledgeStructureEnum || (exports.KnowledgeStructureEnum = {}));
2066
- exports.KnowledgebasePermission = void 0;
2174
+ /**
2175
+ * Knowledgebase permission levels
2176
+ */ exports.KnowledgebasePermission = void 0;
2067
2177
  (function(KnowledgebasePermission) {
2068
2178
  /**
2069
- * Only visible to you
2070
- * @default
2071
- */ KnowledgebasePermission["Private"] = "private";
2179
+ * Only visible to you
2180
+ * @default
2181
+ */ KnowledgebasePermission["Private"] = "private";
2072
2182
  /**
2073
- * Visible to all members in the organization
2074
- */ KnowledgebasePermission["Organization"] = "organization";
2183
+ * Visible to all members in the organization
2184
+ */ KnowledgebasePermission["Organization"] = "organization";
2075
2185
  /**
2076
- * Visible to all members in the tenant
2077
- */ KnowledgebasePermission["Public"] = "public";
2186
+ * Visible to all members in the tenant
2187
+ */ KnowledgebasePermission["Public"] = "public";
2078
2188
  })(exports.KnowledgebasePermission || (exports.KnowledgebasePermission = {}));
2079
2189
  /**
2080
2190
  * Channel name for knowledgebase pipeline
@@ -2089,24 +2199,26 @@ var KNOWLEDGE_DOCUMENTS_NAME = "documents";
2089
2199
  var KNOWLEDGE_FOLDER_ID_NAME = "folder_id";
2090
2200
  var KNOWLEDGE_STAGE_NAME = "stage";
2091
2201
 
2092
- exports.DocumentSourceProviderCategoryEnum = void 0;
2202
+ /**
2203
+ * Category of document source provider
2204
+ */ exports.DocumentSourceProviderCategoryEnum = void 0;
2093
2205
  (function(DocumentSourceProviderCategoryEnum) {
2094
2206
  /**
2095
- * Local files uploaded directly to the system
2096
- */ DocumentSourceProviderCategoryEnum["LocalFile"] = "local-file";
2207
+ * Local files uploaded directly to the system
2208
+ */ DocumentSourceProviderCategoryEnum["LocalFile"] = "local-file";
2097
2209
  /**
2098
- * Remote file systems, e.g. S3, FTP, etc.
2099
- */ DocumentSourceProviderCategoryEnum["FileSystem"] = "file-system";
2210
+ * Remote file systems, e.g. S3, FTP, etc.
2211
+ */ DocumentSourceProviderCategoryEnum["FileSystem"] = "file-system";
2100
2212
  /**
2101
- * Online documents, e.g. public URLs, Google Docs, etc.
2102
- */ DocumentSourceProviderCategoryEnum["OnlineDocument"] = "online-document";
2213
+ * Online documents, e.g. public URLs, Google Docs, etc.
2214
+ */ DocumentSourceProviderCategoryEnum["OnlineDocument"] = "online-document";
2103
2215
  /**
2104
- * Web crawling from public websites
2105
- */ DocumentSourceProviderCategoryEnum["WebCrawl"] = "web-crawl";
2216
+ * Web crawling from public websites
2217
+ */ DocumentSourceProviderCategoryEnum["WebCrawl"] = "web-crawl";
2106
2218
  /**
2107
- * Database connections, e.g. MySQL, PostgreSQL, etc.
2108
- * @deprecated Planning
2109
- */ DocumentSourceProviderCategoryEnum["Database"] = "database";
2219
+ * Database connections, e.g. MySQL, PostgreSQL, etc.
2220
+ * @deprecated Planning
2221
+ */ DocumentSourceProviderCategoryEnum["Database"] = "database";
2110
2222
  })(exports.DocumentSourceProviderCategoryEnum || (exports.DocumentSourceProviderCategoryEnum = {}));
2111
2223
  function genPipelineSourceKey() {
2112
2224
  return letterStartSUID("Source_");
@@ -2124,7 +2236,7 @@ function genPipelineKnowledgeBaseKey() {
2124
2236
  return letterStartSUID("KnowledgeBase_");
2125
2237
  }
2126
2238
 
2127
- function _define_property$3(obj, key, value) {
2239
+ function _define_property$4(obj, key, value) {
2128
2240
  if (key in obj) {
2129
2241
  Object.defineProperty(obj, key, {
2130
2242
  value: value,
@@ -2137,7 +2249,7 @@ function _define_property$3(obj, key, value) {
2137
2249
  }
2138
2250
  return obj;
2139
2251
  }
2140
- function _object_spread$2(target) {
2252
+ function _object_spread$3(target) {
2141
2253
  for(var i = 1; i < arguments.length; i++){
2142
2254
  var source = arguments[i] != null ? arguments[i] : {};
2143
2255
  var ownKeys = Object.keys(source);
@@ -2147,23 +2259,30 @@ function _object_spread$2(target) {
2147
2259
  }));
2148
2260
  }
2149
2261
  ownKeys.forEach(function(key) {
2150
- _define_property$3(target, key, source[key]);
2262
+ _define_property$4(target, key, source[key]);
2151
2263
  });
2152
2264
  }
2153
2265
  return target;
2154
2266
  }
2155
- exports.DocumentTypeEnum = void 0;
2267
+ /**
2268
+ * Import Type:
2269
+ * - file: local file
2270
+ * - web: web document
2271
+ * ...
2272
+ */ exports.DocumentTypeEnum = void 0;
2156
2273
  (function(DocumentTypeEnum) {
2157
2274
  /**
2158
- * Folder, parent of other documents
2159
- */ DocumentTypeEnum["FOLDER"] = "folder";
2275
+ * Folder, parent of other documents
2276
+ */ DocumentTypeEnum["FOLDER"] = "folder";
2160
2277
  /**
2161
- * Local files
2162
- * @deprecated use DocumentSourceProviderCategoryEnum local file type instead
2163
- */ DocumentTypeEnum["FILE"] = "file";
2278
+ * Local files
2279
+ * @deprecated use DocumentSourceProviderCategoryEnum local file type instead
2280
+ */ DocumentTypeEnum["FILE"] = "file";
2164
2281
  })(exports.DocumentTypeEnum || (exports.DocumentTypeEnum = {}));
2165
- var KDocumentSourceType = _object_spread$2({}, exports.DocumentSourceProviderCategoryEnum, exports.DocumentTypeEnum);
2166
- exports.KBDocumentCategoryEnum = void 0;
2282
+ var KDocumentSourceType = _object_spread$3({}, exports.DocumentSourceProviderCategoryEnum, exports.DocumentTypeEnum);
2283
+ /**
2284
+ * Document type category, determine how to process the document.
2285
+ */ exports.KBDocumentCategoryEnum = void 0;
2167
2286
  (function(KBDocumentCategoryEnum) {
2168
2287
  KBDocumentCategoryEnum["Text"] = "text";
2169
2288
  KBDocumentCategoryEnum["Image"] = "image";
@@ -2228,7 +2347,7 @@ function isAudioType(type) {
2228
2347
  ].includes(type);
2229
2348
  }
2230
2349
  function classificateDocumentCategory(entity) {
2231
- return isDocumentSheet(entity.type) ? "sheet" : isImageType(entity.type) ? "image" : isVideoType(entity.type) ? "video" : isAudioType(entity.type) ? "audio" : "text";
2350
+ return isDocumentSheet(entity.type) ? exports.KBDocumentCategoryEnum.Sheet : isImageType(entity.type) ? exports.KBDocumentCategoryEnum.Image : isVideoType(entity.type) ? exports.KBDocumentCategoryEnum.Video : isAudioType(entity.type) ? exports.KBDocumentCategoryEnum.Audio : exports.KBDocumentCategoryEnum.Text;
2232
2351
  }
2233
2352
  /**
2234
2353
  * System standard Metadata field definition constants
@@ -2273,17 +2392,19 @@ function classificateDocumentCategory(entity) {
2273
2392
  exports.AIPermissionsEnum = void 0;
2274
2393
  (function(AIPermissionsEnum) {
2275
2394
  /**
2276
- * Create or edit Knowledgebase in organization.
2277
- */ AIPermissionsEnum["KNOWLEDGEBASE_EDIT"] = "KNOWLEDGEBASE_EDIT";
2395
+ * Create or edit Knowledgebase in organization.
2396
+ */ AIPermissionsEnum["KNOWLEDGEBASE_EDIT"] = "KNOWLEDGEBASE_EDIT";
2278
2397
  AIPermissionsEnum["COPILOT_VIEW"] = "COPILOT_VIEW";
2279
2398
  AIPermissionsEnum["COPILOT_EDIT"] = "COPILOT_EDIT";
2280
2399
  /**
2281
- * Create or edit Xperts in organization.
2282
- */ AIPermissionsEnum["XPERT_EDIT"] = "XPERT_EDIT";
2400
+ * Create or edit Xperts in organization.
2401
+ */ AIPermissionsEnum["XPERT_EDIT"] = "XPERT_EDIT";
2283
2402
  AIPermissionsEnum["CHAT_VIEW"] = "CHAT_VIEW";
2284
2403
  })(exports.AIPermissionsEnum || (exports.AIPermissionsEnum = {}));
2285
2404
 
2286
- exports.XpertAgentExecutionStatusEnum = void 0;
2405
+ /**
2406
+ * Corresponds to the status of Run in [Agent Protocol](https://github.com/langchain-ai/agent-protocol).
2407
+ */ exports.XpertAgentExecutionStatusEnum = void 0;
2287
2408
  (function(XpertAgentExecutionStatusEnum) {
2288
2409
  XpertAgentExecutionStatusEnum["RUNNING"] = "running";
2289
2410
  XpertAgentExecutionStatusEnum["SUCCESS"] = "success";
@@ -2312,7 +2433,7 @@ exports.ToolParameterForm = void 0;
2312
2433
  var TOOL_NAME_REGEX = /^[a-zA-Z0-9_-]+$/;
2313
2434
  // Helper functions for tools
2314
2435
  /**
2315
- *
2436
+ *
2316
2437
  * @param tool Tool
2317
2438
  * @param disableToolDefault Is default disable tools
2318
2439
  * @returns Tool is enabled?
@@ -2329,7 +2450,7 @@ var TOOL_NAME_REGEX = /^[a-zA-Z0-9_-]+$/;
2329
2450
  }
2330
2451
  /**
2331
2452
  * Tool is enabled?
2332
- *
2453
+ *
2333
2454
  * @deprecated use isToolEnabled
2334
2455
  */ function isEnableTool(tool, toolset) {
2335
2456
  var disabled = tool.disabled;
@@ -2373,11 +2494,11 @@ exports.XpertToolsetCategoryEnum = void 0;
2373
2494
  XpertToolsetCategoryEnum["BUILTIN"] = "builtin";
2374
2495
  XpertToolsetCategoryEnum["API"] = "api";
2375
2496
  /**
2376
- * [Anthropic Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
2377
- */ XpertToolsetCategoryEnum["MCP"] = "mcp";
2497
+ * [Anthropic Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
2498
+ */ XpertToolsetCategoryEnum["MCP"] = "mcp";
2378
2499
  /**
2379
- * @deprecated
2380
- */ XpertToolsetCategoryEnum["WORKFLOW"] = "workflow";
2500
+ * @deprecated
2501
+ */ XpertToolsetCategoryEnum["WORKFLOW"] = "workflow";
2381
2502
  })(exports.XpertToolsetCategoryEnum || (exports.XpertToolsetCategoryEnum = {}));
2382
2503
  exports.CredentialsType = void 0;
2383
2504
  (function(CredentialsType) {
@@ -2393,8 +2514,8 @@ exports.CredentialsType = void 0;
2393
2514
  exports.ApiProviderSchemaType = void 0;
2394
2515
  (function(ApiProviderSchemaType) {
2395
2516
  /**
2396
- * Enum class for api provider schema type.
2397
- */ ApiProviderSchemaType["OPENAPI"] = "openapi";
2517
+ * Enum class for api provider schema type.
2518
+ */ ApiProviderSchemaType["OPENAPI"] = "openapi";
2398
2519
  ApiProviderSchemaType["SWAGGER"] = "swagger";
2399
2520
  ApiProviderSchemaType["OPENAI_PLUGIN"] = "openai_plugin";
2400
2521
  ApiProviderSchemaType["OPENAI_ACTIONS"] = "openai_actions";
@@ -2423,7 +2544,9 @@ exports.ToolTagEnum = void 0;
2423
2544
  ToolTagEnum["OTHER"] = "other";
2424
2545
  })(exports.ToolTagEnum || (exports.ToolTagEnum = {}));
2425
2546
 
2426
- exports.XpertTableStatus = void 0;
2547
+ /**
2548
+ * Table status
2549
+ */ exports.XpertTableStatus = void 0;
2427
2550
  (function(XpertTableStatus) {
2428
2551
  XpertTableStatus["DRAFT"] = "draft";
2429
2552
  XpertTableStatus["READY"] = "ready";
@@ -2449,6 +2572,7 @@ function genXpertDBSqlKey() {
2449
2572
  return letterStartSUID("DBSql_");
2450
2573
  }
2451
2574
 
2575
+ // Helpers
2452
2576
  function _array_like_to_array$4(arr, len) {
2453
2577
  if (len == null || len > arr.length) len = arr.length;
2454
2578
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -2457,12 +2581,59 @@ function _array_like_to_array$4(arr, len) {
2457
2581
  function _array_without_holes$1(arr) {
2458
2582
  if (Array.isArray(arr)) return _array_like_to_array$4(arr);
2459
2583
  }
2584
+ function _define_property$3(obj, key, value) {
2585
+ if (key in obj) {
2586
+ Object.defineProperty(obj, key, {
2587
+ value: value,
2588
+ enumerable: true,
2589
+ configurable: true,
2590
+ writable: true
2591
+ });
2592
+ } else {
2593
+ obj[key] = value;
2594
+ }
2595
+ return obj;
2596
+ }
2460
2597
  function _iterable_to_array$2(iter) {
2461
2598
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2462
2599
  }
2463
2600
  function _non_iterable_spread$1() {
2464
2601
  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
2602
  }
2603
+ function _object_spread$2(target) {
2604
+ for(var i = 1; i < arguments.length; i++){
2605
+ var source = arguments[i] != null ? arguments[i] : {};
2606
+ var ownKeys = Object.keys(source);
2607
+ if (typeof Object.getOwnPropertySymbols === "function") {
2608
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
2609
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
2610
+ }));
2611
+ }
2612
+ ownKeys.forEach(function(key) {
2613
+ _define_property$3(target, key, source[key]);
2614
+ });
2615
+ }
2616
+ return target;
2617
+ }
2618
+ function ownKeys$2(object, enumerableOnly) {
2619
+ var keys = Object.keys(object);
2620
+ if (Object.getOwnPropertySymbols) {
2621
+ var symbols = Object.getOwnPropertySymbols(object);
2622
+ keys.push.apply(keys, symbols);
2623
+ }
2624
+ return keys;
2625
+ }
2626
+ function _object_spread_props$2(target, source) {
2627
+ source = source != null ? source : {};
2628
+ if (Object.getOwnPropertyDescriptors) {
2629
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2630
+ } else {
2631
+ ownKeys$2(Object(source)).forEach(function(key) {
2632
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2633
+ });
2634
+ }
2635
+ return target;
2636
+ }
2466
2637
  function _object_without_properties$1(source, excluded) {
2467
2638
  if (source == null) return {};
2468
2639
  var target = _object_without_properties_loose$1(source, excluded);
@@ -2501,10 +2672,9 @@ function _unsupported_iterable_to_array$4(o, minLen) {
2501
2672
  if (n === "Map" || n === "Set") return Array.from(n);
2502
2673
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
2503
2674
  }
2504
- // Helpers
2505
2675
  function omitXpertRelations(xpert) {
2506
2676
  // 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$1(_ref, [
2677
+ 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.userGroups; var rest = _object_without_properties$1(_ref, [
2508
2678
  "draft",
2509
2679
  "agent",
2510
2680
  "agents",
@@ -2515,16 +2685,16 @@ function omitXpertRelations(xpert) {
2515
2685
  "environment",
2516
2686
  "integrations",
2517
2687
  "toolsets",
2518
- "managers"
2688
+ "userGroups"
2519
2689
  ]);
2520
2690
  return rest;
2521
2691
  }
2522
2692
  /**
2523
2693
  * Figure out latest xpert or draft xpert.
2524
- *
2525
- * @param xpert
2694
+ *
2695
+ * @param xpert
2526
2696
  * @param isDraft Is draft
2527
- * @returns
2697
+ * @returns
2528
2698
  */ function figureOutXpert(xpert, isDraft) {
2529
2699
  var _xpert_draft;
2530
2700
  var _ref;
@@ -2556,8 +2726,7 @@ function locateNodes(nodes, position) {
2556
2726
  var _node_size;
2557
2727
  var _node_size_width;
2558
2728
  return node.position.x + ((_node_size_width = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.width) !== null && _node_size_width !== void 0 ? _node_size_width : 240);
2559
- }) // Node width min 240
2560
- ;
2729
+ }); // Node width min 240
2561
2730
  var y0Positions = positions.map(function(pos) {
2562
2731
  return pos.y;
2563
2732
  });
@@ -2565,8 +2734,7 @@ function locateNodes(nodes, position) {
2565
2734
  var _node_size;
2566
2735
  var _node_size_height;
2567
2736
  return node.position.y + ((_node_size_height = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.height) !== null && _node_size_height !== void 0 ? _node_size_height : 70);
2568
- }) // Node height min 70
2569
- ;
2737
+ }); // Node height min 70
2570
2738
  var xRange = {
2571
2739
  min: (_Math = Math).min.apply(_Math, _to_consumable_array$1(x0Positions)),
2572
2740
  max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array$1(x1Positions))
@@ -2684,8 +2852,7 @@ function locateNodes(nodes, position) {
2684
2852
  var _node_size;
2685
2853
  var _node_size_width;
2686
2854
  return node.position.x + ((_node_size_width = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.width) !== null && _node_size_width !== void 0 ? _node_size_width : 240);
2687
- }) // Node width min 240
2688
- ;
2855
+ }); // Node width min 240
2689
2856
  var y0Positions = positions.map(function(pos) {
2690
2857
  return pos.y;
2691
2858
  });
@@ -2693,8 +2860,7 @@ function locateNodes(nodes, position) {
2693
2860
  var _node_size;
2694
2861
  var _node_size_height;
2695
2862
  return node.position.y + ((_node_size_height = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.height) !== null && _node_size_height !== void 0 ? _node_size_height : 70);
2696
- }) // Node height min 70
2697
- ;
2863
+ }); // Node height min 70
2698
2864
  var xRange = {
2699
2865
  min: (_Math = Math).min.apply(_Math, _to_consumable_array$1(x0Positions)),
2700
2866
  max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array$1(x1Positions))
@@ -2772,16 +2938,65 @@ function createAgentConnections(agent, collaborators) {
2772
2938
  });
2773
2939
  return connections;
2774
2940
  }
2941
+ function replaceAgentInDraft(draft, sourceKey, agent, options) {
2942
+ var _draft_nodes, _draft_connections;
2943
+ var targetKey = agent === null || agent === void 0 ? void 0 : agent.key;
2944
+ if (!targetKey) {
2945
+ throw new Error("Target agent key is required");
2946
+ }
2947
+ var replacedNode = false;
2948
+ var nodes = (_draft_nodes = draft.nodes) === null || _draft_nodes === void 0 ? void 0 : _draft_nodes.map(function(node) {
2949
+ if (node.type === "agent" && node.key === sourceKey) {
2950
+ replacedNode = true;
2951
+ var _node_entity;
2952
+ return _object_spread_props$2(_object_spread$2({}, node), {
2953
+ key: targetKey,
2954
+ entity: _object_spread_props$2(_object_spread$2({}, (_node_entity = node.entity) !== null && _node_entity !== void 0 ? _node_entity : {}, agent), {
2955
+ key: targetKey
2956
+ })
2957
+ });
2958
+ }
2959
+ return node;
2960
+ });
2961
+ if (!replacedNode && (options === null || options === void 0 ? void 0 : options.requireNode) !== false) {
2962
+ throw new Error("Can't find agent for key: ".concat(sourceKey));
2963
+ }
2964
+ var connections = (_draft_connections = draft.connections) === null || _draft_connections === void 0 ? void 0 : _draft_connections.map(function(connection) {
2965
+ var from = connection.from === sourceKey ? targetKey : connection.from;
2966
+ var to = connection.to === sourceKey ? targetKey : connection.to;
2967
+ if (from === connection.from && to === connection.to) {
2968
+ return connection;
2969
+ }
2970
+ return _object_spread_props$2(_object_spread$2({}, connection), {
2971
+ from: from,
2972
+ to: to,
2973
+ key: "".concat(from, "/").concat(to)
2974
+ });
2975
+ });
2976
+ return _object_spread_props$2(_object_spread$2({}, draft), {
2977
+ team: draft.team ? _object_spread_props$2(_object_spread$2({}, draft.team), {
2978
+ agent: draft.team.agent ? _object_spread_props$2(_object_spread$2({}, draft.team.agent, agent), {
2979
+ key: targetKey
2980
+ }) : _object_spread_props$2(_object_spread$2({}, agent), {
2981
+ key: targetKey
2982
+ })
2983
+ }) : draft.team,
2984
+ nodes: nodes,
2985
+ connections: connections
2986
+ });
2987
+ }
2775
2988
 
2776
2989
  exports.ApiAuthType = void 0;
2777
2990
  (function(ApiAuthType) {
2778
2991
  /**
2779
- * Enum class for api provider auth type.
2780
- */ ApiAuthType["NONE"] = "none";
2992
+ * Enum class for api provider auth type.
2993
+ */ ApiAuthType["NONE"] = "none";
2781
2994
  ApiAuthType["API_KEY"] = "api_key";
2782
2995
  ApiAuthType["BASIC"] = "basic";
2783
2996
  })(exports.ApiAuthType || (exports.ApiAuthType = {}));
2784
- exports.EmbeddingStatusEnum = void 0;
2997
+ /**
2998
+ * Embedding status of an entity, such as an bi indicator or kb document.
2999
+ */ exports.EmbeddingStatusEnum = void 0;
2785
3000
  (function(EmbeddingStatusEnum) {
2786
3001
  EmbeddingStatusEnum["PROCESSING"] = "processing";
2787
3002
  EmbeddingStatusEnum["SUCCESS"] = "success";
@@ -2842,7 +3057,14 @@ exports.MCPServerType = void 0;
2842
3057
  MCPServerType["HTTP"] = "http";
2843
3058
  })(exports.MCPServerType || (exports.MCPServerType = {}));
2844
3059
 
2845
- function _define_property$2(obj, key, value) {
3060
+ /**
3061
+ * Build a hierarchical tree structure from a flat list of DocumentInterface objects,
3062
+ * and
3063
+ *
3064
+ * @template Metadata - Type of metadata, defaults to IDocChunkMetadata
3065
+ * @param documents - A flat array of DocumentInterface objects
3066
+ * @returns the hierarchical tree (root-level DocumentInterface[])
3067
+ */ function _define_property$2(obj, key, value) {
2846
3068
  if (key in obj) {
2847
3069
  Object.defineProperty(obj, key, {
2848
3070
  value: value,
@@ -2889,14 +3111,7 @@ function _object_spread_props$1(target, source) {
2889
3111
  }
2890
3112
  return target;
2891
3113
  }
2892
- /**
2893
- * Build a hierarchical tree structure from a flat list of DocumentInterface objects,
2894
- * and
2895
- *
2896
- * @template Metadata - Type of metadata, defaults to IDocChunkMetadata
2897
- * @param documents - A flat array of DocumentInterface objects
2898
- * @returns the hierarchical tree (root-level DocumentInterface[])
2899
- */ function buildChunkTree(documents) {
3114
+ function buildChunkTree(documents) {
2900
3115
  if (!documents || documents.length === 0) return [];
2901
3116
  // Step 1. Build a lookup map for quick access by chunkId
2902
3117
  var map = new Map();
@@ -2960,9 +3175,9 @@ function _object_spread_props$1(target, source) {
2960
3175
  }
2961
3176
  /**
2962
3177
  * Find all leaf nodes (nodes without children).
2963
- *
2964
- * @param roots
2965
- * @returns
3178
+ *
3179
+ * @param roots
3180
+ * @returns
2966
3181
  */ function collectTreeLeaves(roots) {
2967
3182
  var leaves = [];
2968
3183
  var collectLeaves = function(node) {
@@ -3245,9 +3460,6 @@ function getSeparator(previousType, previousText, nextText, joinHint) {
3245
3460
  if (joinHint) {
3246
3461
  return mapJoinHint(joinHint);
3247
3462
  }
3248
- if (previousType === "component") {
3249
- return "\n\n";
3250
- }
3251
3463
  if (endsWithCodeFence(previousText)) {
3252
3464
  return "\n";
3253
3465
  }
@@ -3299,6 +3511,25 @@ function filterText(content) {
3299
3511
  }
3300
3512
  return "";
3301
3513
  }
3514
+ function mergeTextChunkForDisplay(previous, incoming) {
3515
+ return _object_spread(_object_spread_props(_object_spread({}, previous), {
3516
+ text: "".concat(previous.text).concat(incoming.text)
3517
+ }), !previous.id && incoming.id ? {
3518
+ id: incoming.id
3519
+ } : {}, !previous.agentKey && incoming.agentKey ? {
3520
+ agentKey: incoming.agentKey
3521
+ } : {}, !previous.xpertName && incoming.xpertName ? {
3522
+ xpertName: incoming.xpertName
3523
+ } : {});
3524
+ }
3525
+ function stripAutoDisplaySeparator(incoming, previousOriginal) {
3526
+ if ((previousOriginal === null || previousOriginal === void 0 ? void 0 : previousOriginal.type) === "component" && incoming.text.startsWith("\n\n")) {
3527
+ return _object_spread_props(_object_spread({}, incoming), {
3528
+ text: incoming.text.slice(1)
3529
+ });
3530
+ }
3531
+ return incoming;
3532
+ }
3302
3533
  function mergeComponentData(previous, incoming) {
3303
3534
  var _previous_data, _incoming_data;
3304
3535
  var _incoming_data1;
@@ -3374,7 +3605,7 @@ function resolveMessageAppendContext(options) {
3374
3605
  * - `previous` must be supplied by caller when same-stream join inference is needed.
3375
3606
  */ function appendMessageContent(aiMessage, incoming, context) {
3376
3607
  aiMessage.status = "answering";
3377
- var _ref = context !== null && context !== void 0 ? context : {}, previous = _ref.previous, contextWithoutPrevious = _object_without_properties(_ref, [
3608
+ var _ref = context !== null && context !== void 0 ? context : {}; _ref.previous; var contextWithoutPrevious = _object_without_properties(_ref, [
3378
3609
  "previous"
3379
3610
  ]);
3380
3611
  var resolvedContext = _object_spread({}, inferMessageAppendContext(incoming), contextWithoutPrevious);
@@ -3400,39 +3631,48 @@ function resolveMessageAppendContext(options) {
3400
3631
  }
3401
3632
  var chunks = ensureArrayContent(aiMessage.content);
3402
3633
  if (isTextContent(content)) {
3403
- var _resolvedContext_joinHint;
3404
- var joinHint = (_resolvedContext_joinHint = resolvedContext.joinHint) !== null && _resolvedContext_joinHint !== void 0 ? _resolvedContext_joinHint : shouldJoinWithoutSeparator(previous, resolvedContext) ? "none" : undefined;
3634
+ if (content.id) {
3635
+ var index = chunks.findIndex(function(item) {
3636
+ return isTextContent(item) && item.id === content.id;
3637
+ });
3638
+ if (index > -1) {
3639
+ var mergedContent = _object_spread(_object_spread_props(_object_spread({}, chunks[index]), {
3640
+ text: "".concat(chunks[index].text).concat(content.text)
3641
+ }), !chunks[index].id && content.id ? {
3642
+ id: content.id
3643
+ } : {}, !chunks[index].agentKey && content.agentKey ? {
3644
+ agentKey: content.agentKey
3645
+ } : {}, !chunks[index].xpertName && content.xpertName ? {
3646
+ xpertName: content.xpertName
3647
+ } : {});
3648
+ aiMessage.content = _to_consumable_array(chunks.slice(0, index)).concat([
3649
+ mergedContent
3650
+ ], _to_consumable_array(chunks.slice(index + 1)));
3651
+ return;
3652
+ }
3653
+ }
3405
3654
  var lastContent = chunks[chunks.length - 1];
3406
- if (isTextContent(lastContent) && (joinHint === "none" || !!content.id && !!lastContent.id && lastContent.id === content.id)) {
3407
- var mergedLastContent = _object_spread(_object_spread_props(_object_spread({}, lastContent), {
3655
+ if (isTextContent(lastContent) && !lastContent.id && !content.id) {
3656
+ var mergedLastContent = _object_spread_props(_object_spread({}, lastContent), {
3408
3657
  text: "".concat(lastContent.text).concat(content.text)
3409
- }), !lastContent.id && content.id ? {
3410
- id: content.id
3411
- } : {});
3658
+ });
3412
3659
  aiMessage.content = _to_consumable_array(chunks.slice(0, chunks.length - 1)).concat([
3413
3660
  mergedLastContent
3414
3661
  ]);
3415
3662
  return;
3416
3663
  }
3417
- var _lastContent_type;
3418
- var previousType = (_lastContent_type = lastContent === null || lastContent === void 0 ? void 0 : lastContent.type) !== null && _lastContent_type !== void 0 ? _lastContent_type : null;
3419
- var previousText = isTextContent(lastContent) ? lastContent.text : "";
3420
- var separator = getSeparator(previousType, previousText, content.text, joinHint);
3421
- var appended = _object_spread_props(_object_spread({}, content), {
3422
- text: separator + content.text
3423
- });
3424
3664
  aiMessage.content = _to_consumable_array(chunks).concat([
3425
- appended
3665
+ content
3426
3666
  ]);
3427
3667
  return;
3428
3668
  }
3429
3669
  var nextChunks = _to_consumable_array(chunks);
3430
3670
  if (isComponentContent(content) && content.id) {
3431
- var index = nextChunks.findIndex(function(item) {
3671
+ var index1 = nextChunks.findIndex(function(item) {
3432
3672
  return isComponentContent(item) && item.id === content.id;
3433
3673
  });
3434
- if (index > -1) {
3435
- nextChunks[index] = mergeComponentData(nextChunks[index], content);
3674
+ if (index1 > -1) {
3675
+ nextChunks[index1] = mergeComponentData(nextChunks[index1], content);
3436
3676
  } else {
3437
3677
  nextChunks.push(content);
3438
3678
  }
@@ -3451,6 +3691,54 @@ function appendMessagePlainText(accumulator, incoming, context) {
3451
3691
  var separator = getSeparator("text", previous, nextText, resolvedContext.joinHint);
3452
3692
  return previous + separator + nextText;
3453
3693
  }
3694
+ /**
3695
+ * Creates a display-only content view that reassembles text chunks belonging to
3696
+ * the same stream id. This preserves markdown continuity without changing the
3697
+ * underlying stored/streamed message structure.
3698
+ */ function mergeMessageContentForDisplay(content) {
3699
+ if (!content) {
3700
+ return null;
3701
+ }
3702
+ if (typeof content === "string") {
3703
+ return content.length ? [
3704
+ {
3705
+ type: "text",
3706
+ text: content
3707
+ }
3708
+ ] : null;
3709
+ }
3710
+ if (!Array.isArray(content)) {
3711
+ return [
3712
+ content
3713
+ ];
3714
+ }
3715
+ var merged = [];
3716
+ var textIndexById = new Map();
3717
+ content.forEach(function(item, itemIndex) {
3718
+ if (!isTextContent(item)) {
3719
+ merged.push(item);
3720
+ return;
3721
+ }
3722
+ if (item.id) {
3723
+ var mergedIndex = textIndexById.get(item.id);
3724
+ if (mergedIndex !== undefined && isTextContent(merged[mergedIndex])) {
3725
+ var previousOriginal = content[itemIndex - 1];
3726
+ merged[mergedIndex] = mergeTextChunkForDisplay(merged[mergedIndex], stripAutoDisplaySeparator(item, previousOriginal));
3727
+ return;
3728
+ }
3729
+ textIndexById.set(item.id, merged.length);
3730
+ merged.push(_object_spread({}, item));
3731
+ return;
3732
+ }
3733
+ var lastItem = merged[merged.length - 1];
3734
+ if (isTextContent(lastItem) && !lastItem.id && lastItem.agentKey === item.agentKey && lastItem.xpertName === item.xpertName) {
3735
+ merged[merged.length - 1] = mergeTextChunkForDisplay(lastItem, item);
3736
+ return;
3737
+ }
3738
+ merged.push(_object_spread({}, item));
3739
+ });
3740
+ return merged.length ? merged : null;
3741
+ }
3454
3742
  function stringifyMessageContent(content) {
3455
3743
  if (typeof content === "string") {
3456
3744
  return content;
@@ -3494,6 +3782,45 @@ function filterMessageText(content) {
3494
3782
  return filterText(content) || null;
3495
3783
  }
3496
3784
 
3785
+ var STATE_VARIABLE_HUMAN = "human";
3786
+ exports.ChatMessageTypeEnum = void 0;
3787
+ (function(ChatMessageTypeEnum) {
3788
+ ChatMessageTypeEnum["MESSAGE"] = "message";
3789
+ ChatMessageTypeEnum["EVENT"] = "event";
3790
+ })(exports.ChatMessageTypeEnum || (exports.ChatMessageTypeEnum = {}));
3791
+ exports.ChatMessageEventTypeEnum = void 0;
3792
+ (function(ChatMessageEventTypeEnum) {
3793
+ ChatMessageEventTypeEnum["ON_CONVERSATION_START"] = "on_conversation_start";
3794
+ ChatMessageEventTypeEnum["ON_CONVERSATION_END"] = "on_conversation_end";
3795
+ ChatMessageEventTypeEnum["ON_MESSAGE_START"] = "on_message_start";
3796
+ ChatMessageEventTypeEnum["ON_MESSAGE_END"] = "on_message_end";
3797
+ ChatMessageEventTypeEnum["ON_TOOL_START"] = "on_tool_start";
3798
+ ChatMessageEventTypeEnum["ON_TOOL_END"] = "on_tool_end";
3799
+ ChatMessageEventTypeEnum["ON_TOOL_ERROR"] = "on_tool_error";
3800
+ ChatMessageEventTypeEnum["ON_TOOL_MESSAGE"] = "on_tool_message";
3801
+ ChatMessageEventTypeEnum["ON_AGENT_START"] = "on_agent_start";
3802
+ ChatMessageEventTypeEnum["ON_AGENT_END"] = "on_agent_end";
3803
+ ChatMessageEventTypeEnum["ON_RETRIEVER_START"] = "on_retriever_start";
3804
+ ChatMessageEventTypeEnum["ON_RETRIEVER_END"] = "on_retriever_end";
3805
+ ChatMessageEventTypeEnum["ON_RETRIEVER_ERROR"] = "on_retriever_error";
3806
+ ChatMessageEventTypeEnum["ON_INTERRUPT"] = "on_interrupt";
3807
+ ChatMessageEventTypeEnum["ON_ERROR"] = "on_error";
3808
+ ChatMessageEventTypeEnum["ON_CHAT_EVENT"] = "on_chat_event";
3809
+ ChatMessageEventTypeEnum["ON_CLIENT_EFFECT"] = "on_client_effect";
3810
+ })(exports.ChatMessageEventTypeEnum || (exports.ChatMessageEventTypeEnum = {}));
3811
+ exports.ChatMessageStepCategory = void 0;
3812
+ (function(ChatMessageStepCategory) {
3813
+ ChatMessageStepCategory["List"] = "list";
3814
+ ChatMessageStepCategory["WebSearch"] = "web_search";
3815
+ ChatMessageStepCategory["Files"] = "files";
3816
+ ChatMessageStepCategory["File"] = "file";
3817
+ ChatMessageStepCategory["Program"] = "program";
3818
+ ChatMessageStepCategory["Iframe"] = "iframe";
3819
+ ChatMessageStepCategory["Memory"] = "memory";
3820
+ ChatMessageStepCategory["Tasks"] = "tasks";
3821
+ ChatMessageStepCategory["Knowledges"] = "knowledges";
3822
+ })(exports.ChatMessageStepCategory || (exports.ChatMessageStepCategory = {}));
3823
+
3497
3824
  exports.PermissionsEnum = void 0;
3498
3825
  (function(PermissionsEnum) {
3499
3826
  PermissionsEnum["PROFILE_EDIT"] = "PROFILE_EDIT";
@@ -3531,14 +3858,17 @@ exports.PermissionsEnum = void 0;
3531
3858
  var PermissionGroups = {
3532
3859
  //Permissions which can be given to any role
3533
3860
  GENERAL: [
3534
- "PROFILE_EDIT",
3535
- "ADMIN_DASHBOARD_VIEW",
3536
- "ORG_INVITE_VIEW",
3537
- "ORG_INVITE_EDIT",
3538
- "VIEW_ALL_EMAILS",
3539
- "VIEW_ALL_EMAIL_TEMPLATES",
3540
- "INTEGRATION_EDIT",
3541
- "ORG_DEMO_EDIT",
3861
+ exports.PermissionsEnum.PROFILE_EDIT,
3862
+ exports.PermissionsEnum.ADMIN_DASHBOARD_VIEW,
3863
+ exports.PermissionsEnum.ORG_INVITE_VIEW,
3864
+ exports.PermissionsEnum.ORG_INVITE_EDIT,
3865
+ // PermissionsEnum.ORG_TAGS_EDIT,
3866
+ exports.PermissionsEnum.VIEW_ALL_EMAILS,
3867
+ exports.PermissionsEnum.VIEW_ALL_EMAIL_TEMPLATES,
3868
+ // PermissionsEnum.ORG_HELP_CENTER_EDIT,
3869
+ exports.PermissionsEnum.INTEGRATION_EDIT,
3870
+ // PermissionsEnum.ORG_CONTACT_VIEW,
3871
+ exports.PermissionsEnum.ORG_DEMO_EDIT,
3542
3872
  // PermissionsEnum.VIEW_ALL_ACCOUNTING_TEMPLATES,
3543
3873
  // AI
3544
3874
  exports.AIPermissionsEnum.KNOWLEDGEBASE_EDIT,
@@ -3570,16 +3900,16 @@ var PermissionGroups = {
3570
3900
  ],
3571
3901
  //Readonly permissions, are only enabled for admin role
3572
3902
  ADMINISTRATION: [
3573
- "ORG_USERS_VIEW",
3574
- "ORG_USERS_EDIT",
3575
- "ALL_ORG_VIEW",
3576
- "ALL_ORG_EDIT",
3577
- "CHANGE_SELECTED_ORGANIZATION",
3578
- "CHANGE_ROLES_PERMISSIONS",
3579
- "SUPER_ADMIN_EDIT",
3580
- "INTEGRATION_VIEW",
3581
- "ACCESS_DELETE_ACCOUNT",
3582
- "ACCESS_DELETE_ALL_DATA"
3903
+ exports.PermissionsEnum.ORG_USERS_VIEW,
3904
+ exports.PermissionsEnum.ORG_USERS_EDIT,
3905
+ exports.PermissionsEnum.ALL_ORG_VIEW,
3906
+ exports.PermissionsEnum.ALL_ORG_EDIT,
3907
+ exports.PermissionsEnum.CHANGE_SELECTED_ORGANIZATION,
3908
+ exports.PermissionsEnum.CHANGE_ROLES_PERMISSIONS,
3909
+ exports.PermissionsEnum.SUPER_ADMIN_EDIT,
3910
+ exports.PermissionsEnum.INTEGRATION_VIEW,
3911
+ exports.PermissionsEnum.ACCESS_DELETE_ACCOUNT,
3912
+ exports.PermissionsEnum.ACCESS_DELETE_ALL_DATA
3583
3913
  ]
3584
3914
  };
3585
3915
 
@@ -3605,21 +3935,29 @@ exports.RolesEnum = void 0;
3605
3935
  (function(RolesEnum) {
3606
3936
  RolesEnum["SUPER_ADMIN"] = "SUPER_ADMIN";
3607
3937
  RolesEnum["ADMIN"] = "ADMIN";
3608
- RolesEnum["DATA_ENTRY"] = "DATA_ENTRY";
3609
- RolesEnum["EMPLOYEE"] = "EMPLOYEE";
3610
- RolesEnum["CANDIDATE"] = "CANDIDATE";
3611
- RolesEnum["MANAGER"] = "MANAGER";
3938
+ RolesEnum["AI_BUILDER"] = "AI_BUILDER";
3939
+ RolesEnum["ANALYTICS_BUILDER"] = "ANALYTICS_BUILDER";
3612
3940
  RolesEnum["VIEWER"] = "VIEWER";
3613
- // 有所免费用户
3941
+ // Trial account
3614
3942
  RolesEnum["TRIAL"] = "TRIAL";
3615
3943
  })(exports.RolesEnum || (exports.RolesEnum = {}));
3944
+ var DEFAULT_SYSTEM_ROLES = [
3945
+ exports.RolesEnum.SUPER_ADMIN,
3946
+ exports.RolesEnum.ADMIN,
3947
+ exports.RolesEnum.TRIAL,
3948
+ exports.RolesEnum.AI_BUILDER,
3949
+ exports.RolesEnum.ANALYTICS_BUILDER,
3950
+ exports.RolesEnum.VIEWER
3951
+ ];
3616
3952
 
3617
3953
  exports.UserType = void 0;
3618
3954
  (function(UserType) {
3619
3955
  UserType["USER"] = "user";
3620
3956
  UserType["COMMUNICATION"] = "communication";
3621
3957
  })(exports.UserType || (exports.UserType = {}));
3622
- exports.LanguagesEnum = void 0;
3958
+ /**
3959
+ * Browser http header `Language`
3960
+ */ exports.LanguagesEnum = void 0;
3623
3961
  (function(LanguagesEnum) {
3624
3962
  LanguagesEnum["Chinese"] = "zh-CN";
3625
3963
  LanguagesEnum["SimplifiedChinese"] = "zh-Hans";
@@ -3627,23 +3965,29 @@ exports.LanguagesEnum = void 0;
3627
3965
  LanguagesEnum["English"] = "en";
3628
3966
  })(exports.LanguagesEnum || (exports.LanguagesEnum = {}));
3629
3967
  var LanguagesMap = {
3630
- "zh-CN": "zh-Hans",
3631
- "zh-Hans": "zh-Hans",
3632
- "zh": "zh-Hans"
3968
+ "zh-CN": exports.LanguagesEnum.SimplifiedChinese,
3969
+ "zh-Hans": exports.LanguagesEnum.SimplifiedChinese,
3970
+ "zh": exports.LanguagesEnum.SimplifiedChinese
3633
3971
  };
3972
+ // export enum ComponentLayoutStyleEnum {
3973
+ // CARDS_GRID = 'CARDS_GRID',
3974
+ // TABLE = 'TABLE'
3975
+ // }
3634
3976
  exports.ProviderEnum = void 0;
3635
3977
  (function(ProviderEnum) {
3636
3978
  ProviderEnum["GOOGLE"] = "google";
3637
3979
  ProviderEnum["FACEBOOK"] = "facebook";
3638
3980
  })(exports.ProviderEnum || (exports.ProviderEnum = {}));
3639
3981
 
3640
- /* eslint-disable @typescript-eslint/no-empty-interface */ exports.SMTPSecureEnum = void 0;
3982
+ exports.SMTPSecureEnum = void 0;
3641
3983
  (function(SMTPSecureEnum) {
3642
3984
  SMTPSecureEnum["TRUE"] = "True";
3643
3985
  SMTPSecureEnum["FALSE"] = "False";
3644
3986
  })(exports.SMTPSecureEnum || (exports.SMTPSecureEnum = {}));
3645
3987
 
3646
- exports.IntegrationEnum = void 0;
3988
+ /**
3989
+ * @deprecated use Plugins instead
3990
+ */ exports.IntegrationEnum = void 0;
3647
3991
  (function(IntegrationEnum) {
3648
3992
  IntegrationEnum["UPWORK"] = "Upwork";
3649
3993
  IntegrationEnum["HUBSTAFF"] = "Hubstaff";
@@ -3671,15 +4015,15 @@ exports.IntegrationFilterEnum = void 0;
3671
4015
  })(exports.IntegrationFilterEnum || (exports.IntegrationFilterEnum = {}));
3672
4016
  var DEFAULT_INTEGRATION_PAID_FILTERS = [
3673
4017
  {
3674
- label: "All",
4018
+ label: exports.IntegrationFilterEnum.ALL,
3675
4019
  value: "all"
3676
4020
  },
3677
4021
  {
3678
- label: "Free",
4022
+ label: exports.IntegrationFilterEnum.FREE,
3679
4023
  value: "false"
3680
4024
  },
3681
4025
  {
3682
- label: "Paid",
4026
+ label: exports.IntegrationFilterEnum.PAID,
3683
4027
  value: "true"
3684
4028
  }
3685
4029
  ];
@@ -3723,6 +4067,12 @@ exports.Visibility = void 0;
3723
4067
  Visibility["Private"] = "private";
3724
4068
  })(exports.Visibility || (exports.Visibility = {}));
3725
4069
 
4070
+ exports.RequestScopeLevel = void 0;
4071
+ (function(RequestScopeLevel) {
4072
+ RequestScopeLevel["TENANT"] = "tenant";
4073
+ RequestScopeLevel["ORGANIZATION"] = "organization";
4074
+ })(exports.RequestScopeLevel || (exports.RequestScopeLevel = {}));
4075
+
3726
4076
  var IntegrationDingTalkProvider = {
3727
4077
  name: exports.IntegrationEnum.DINGTALK,
3728
4078
  label: {
@@ -4052,10 +4402,10 @@ function findStartNodes(graph, key) {
4052
4402
  }
4053
4403
  /**
4054
4404
  * Keep the content in the same graph as the key node (including the node, its connected nodes, and the 'edge' type connections between them)
4055
- *
4056
- * @param graph
4057
- * @param key
4058
- * @returns
4405
+ *
4406
+ * @param graph
4407
+ * @param key
4408
+ * @returns
4059
4409
  */ function getCurrentGraph(graph, key) {
4060
4410
  var validConnections = graph.connections.filter(function(conn) {
4061
4411
  return conn.type === "edge";
@@ -4176,13 +4526,13 @@ function _unsupported_iterable_to_array$1(o, minLen) {
4176
4526
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
4177
4527
  }
4178
4528
  /**
4179
- *
4529
+ *
4180
4530
  * Returns the variable schema for a given variable name.
4181
4531
  * The variable name can be in the format of 'groupName.variableName' or just 'variableName'.
4182
- *
4183
- * @param variables
4184
- * @param variable
4185
- * @returns
4532
+ *
4533
+ * @param variables
4534
+ * @param variable
4535
+ * @returns
4186
4536
  */ function getVariableSchema(variables, variable) {
4187
4537
  var _variable_split;
4188
4538
  var _ref = _to_array((_variable_split = variable === null || variable === void 0 ? void 0 : variable.split(".")) !== null && _variable_split !== void 0 ? _variable_split : []), groupName = _ref[0], rest = _ref.slice(1);
@@ -4245,6 +4595,22 @@ function isInterruptMessage(obj) {
4245
4595
  return obj && typeof obj === "object" && "type" in obj && "category" in obj;
4246
4596
  }
4247
4597
 
4598
+ /**
4599
+ * Optional request header used by third-party callers to explicitly set the
4600
+ * business user represented by the current request context.
4601
+ */ var API_PRINCIPAL_USER_ID_HEADER = "x-principal-user-id";
4602
+ /**
4603
+ * Stable binding kinds used to resolve long-lived technical principals.
4604
+ */ exports.ApiKeyBindingType = void 0;
4605
+ (function(ApiKeyBindingType) {
4606
+ ApiKeyBindingType["ASSISTANT"] = "assistant";
4607
+ ApiKeyBindingType["INTEGRATION"] = "integration";
4608
+ ApiKeyBindingType["CLIENT"] = "client";
4609
+ /**
4610
+ * @deprecated legacy type, do not use for new keys. Will be resolved as assistant for backward compatibility.
4611
+ */ ApiKeyBindingType["KNOWLEDGEBASE"] = "knowledgebase";
4612
+ })(exports.ApiKeyBindingType || (exports.ApiKeyBindingType = {}));
4613
+
4248
4614
  function _array_like_to_array(arr, len) {
4249
4615
  if (len == null || len > arr.length) len = arr.length;
4250
4616
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -4307,9 +4673,9 @@ exports.TaskFrequency = void 0;
4307
4673
  })(exports.TaskFrequency || (exports.TaskFrequency = {}));
4308
4674
  /**
4309
4675
  * Generate cron expression: Minutes Hour Day Month Week
4310
- *
4311
- * @param schedule
4312
- * @returns
4676
+ *
4677
+ * @param schedule
4678
+ * @returns
4313
4679
  */ function generateCronExpression(schedule) {
4314
4680
  if (!schedule.time) throw new Error("Time is required for scheduling");
4315
4681
  var _schedule_time_split = _sliced_to_array(schedule.time.split(":"), 2), hourStr = _schedule_time_split[0], minuteStr = _schedule_time_split[1];
@@ -4319,22 +4685,22 @@ exports.TaskFrequency = void 0;
4319
4685
  throw new Error("Invalid time format. Expected HH:mm with valid hour and minute.");
4320
4686
  }
4321
4687
  switch(schedule.frequency){
4322
- case "Once":
4688
+ case exports.TaskFrequency.Once:
4323
4689
  {
4324
4690
  if (!schedule.date) throw new Error("Date is required for Once schedule");
4325
4691
  var date = new Date(schedule.date);
4326
4692
  // if (isNaN(date.getTime())) throw new Error('Invalid date format for Once schedule');
4327
4693
  return "".concat(minute, " ").concat(hour, " ").concat(date.getDate(), " ").concat(date.getMonth() + 1, " *");
4328
4694
  }
4329
- case "Daily":
4695
+ case exports.TaskFrequency.Daily:
4330
4696
  return "".concat(minute, " ").concat(hour, " * * *");
4331
- case "Weekly":
4697
+ case exports.TaskFrequency.Weekly:
4332
4698
  if (schedule.dayOfWeek === undefined || schedule.dayOfWeek < 0 || schedule.dayOfWeek > 6) throw new Error("Valid dayOfWeek (0-6) is required for Weekly schedule");
4333
4699
  return "".concat(minute, " ").concat(hour, " * * ").concat(schedule.dayOfWeek);
4334
- case "Monthly":
4700
+ case exports.TaskFrequency.Monthly:
4335
4701
  if (!schedule.dayOfMonth || schedule.dayOfMonth < 1 || schedule.dayOfMonth > 31) throw new Error("Valid dayOfMonth (1-31) is required for Monthly schedule");
4336
4702
  return "".concat(minute, " ").concat(hour, " ").concat(schedule.dayOfMonth, " * *");
4337
- case "Yearly":
4703
+ case exports.TaskFrequency.Yearly:
4338
4704
  {
4339
4705
  if (!schedule.date) throw new Error("Date is required for Yearly schedule");
4340
4706
  var date1 = new Date(schedule.date);
@@ -4370,9 +4736,16 @@ var PLUGIN_CONFIGURATION_STATUS = {
4370
4736
  VALID: "valid",
4371
4737
  INVALID: "invalid"
4372
4738
  };
4739
+ var PLUGIN_LOAD_STATUS = {
4740
+ LOADED: "loaded",
4741
+ FAILED: "failed"
4742
+ };
4373
4743
 
4374
4744
  exports.AI_MODEL_TYPE_VARIABLE = AI_MODEL_TYPE_VARIABLE;
4745
+ exports.API_PRINCIPAL_USER_ID_HEADER = API_PRINCIPAL_USER_ID_HEADER;
4375
4746
  exports.Attachment_Type_Options = Attachment_Type_Options;
4747
+ exports.CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY;
4748
+ exports.CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE;
4376
4749
  exports.CONTEXT_VARIABLE_CURRENTSTATE = CONTEXT_VARIABLE_CURRENTSTATE;
4377
4750
  exports.DEFAULT_CURRENCIES = DEFAULT_CURRENCIES;
4378
4751
  exports.DEFAULT_DATE_FORMATS = DEFAULT_DATE_FORMATS;
@@ -4380,6 +4753,7 @@ exports.DEFAULT_INTEGRATION_PAID_FILTERS = DEFAULT_INTEGRATION_PAID_FILTERS;
4380
4753
  exports.DEFAULT_INVITE_EXPIRY_PERIOD = DEFAULT_INVITE_EXPIRY_PERIOD;
4381
4754
  exports.DEFAULT_PROFIT_BASED_BONUS = DEFAULT_PROFIT_BASED_BONUS;
4382
4755
  exports.DEFAULT_REVENUE_BASED_BONUS = DEFAULT_REVENUE_BASED_BONUS;
4756
+ exports.DEFAULT_SYSTEM_ROLES = DEFAULT_SYSTEM_ROLES;
4383
4757
  exports.DEFAULT_TENANT = DEFAULT_TENANT;
4384
4758
  exports.DEFAULT_TIME_FORMATS = DEFAULT_TIME_FORMATS;
4385
4759
  exports.FILE_VARIABLES = FILE_VARIABLES;
@@ -4410,6 +4784,7 @@ exports.OllamaEmbeddingsProviders = OllamaEmbeddingsProviders;
4410
4784
  exports.OpenAIEmbeddingsProviders = OpenAIEmbeddingsProviders;
4411
4785
  exports.PLUGIN_CONFIGURATION_STATUS = PLUGIN_CONFIGURATION_STATUS;
4412
4786
  exports.PLUGIN_LEVEL = PLUGIN_LEVEL;
4787
+ exports.PLUGIN_LOAD_STATUS = PLUGIN_LOAD_STATUS;
4413
4788
  exports.PLUGIN_SOURCE = PLUGIN_SOURCE;
4414
4789
  exports.PermissionApprovalStatus = PermissionApprovalStatus;
4415
4790
  exports.PermissionGroups = PermissionGroups;
@@ -4419,6 +4794,7 @@ exports.STATE_SYS_VOLUME = STATE_SYS_VOLUME;
4419
4794
  exports.STATE_SYS_WORKSPACE_PATH = STATE_SYS_WORKSPACE_PATH;
4420
4795
  exports.STATE_SYS_WORKSPACE_URL = STATE_SYS_WORKSPACE_URL;
4421
4796
  exports.STATE_VARIABLE_FILES = STATE_VARIABLE_FILES;
4797
+ exports.STATE_VARIABLE_HUMAN = STATE_VARIABLE_HUMAN;
4422
4798
  exports.STATE_VARIABLE_INPUT = STATE_VARIABLE_INPUT;
4423
4799
  exports.STATE_VARIABLE_SYS = STATE_VARIABLE_SYS;
4424
4800
  exports.STATE_VARIABLE_TITLE_CHANNEL = STATE_VARIABLE_TITLE_CHANNEL;
@@ -4441,6 +4817,7 @@ exports.collectTreeLeaves = collectTreeLeaves;
4441
4817
  exports.configurableStoreNamespace = configurableStoreNamespace;
4442
4818
  exports.convertToUrlPath = convertToUrlPath;
4443
4819
  exports.createAgentConnections = createAgentConnections;
4820
+ exports.createConversationTitleSummaryEvent = createConversationTitleSummaryEvent;
4444
4821
  exports.createMessageAppendContextTracker = createMessageAppendContextTracker;
4445
4822
  exports.createXpertGraph = createXpertGraph;
4446
4823
  exports.createXpertNodes = createXpertNodes;
@@ -4471,6 +4848,7 @@ exports.genXpertTriggerKey = genXpertTriggerKey;
4471
4848
  exports.generateCronExpression = generateCronExpression;
4472
4849
  exports.getAgentMiddlewareNodes = getAgentMiddlewareNodes;
4473
4850
  exports.getAgentVarGroup = getAgentVarGroup;
4851
+ exports.getAssistantManagement = getAssistantManagement;
4474
4852
  exports.getCurrentGraph = getCurrentGraph;
4475
4853
  exports.getEnabledTools = getEnabledTools;
4476
4854
  exports.getStoreNamespace = getStoreNamespace;
@@ -4493,14 +4871,18 @@ exports.isIteratorKey = isIteratorKey;
4493
4871
  exports.isMessageGroup = isMessageGroup;
4494
4872
  exports.isMiddlewareToolEnabled = isMiddlewareToolEnabled;
4495
4873
  exports.isRouterKey = isRouterKey;
4874
+ exports.isSystemManagedAssistant = isSystemManagedAssistant;
4496
4875
  exports.isToolEnabled = isToolEnabled;
4876
+ exports.isUserManagedAssistant = isUserManagedAssistant;
4497
4877
  exports.isVideoType = isVideoType;
4498
4878
  exports.isXpertNodeType = isXpertNodeType;
4499
4879
  exports.letterStartSUID = letterStartSUID;
4500
4880
  exports.locateNodes = locateNodes;
4501
4881
  exports.mapTranslationLanguage = mapTranslationLanguage;
4882
+ exports.mergeMessageContentForDisplay = mergeMessageContentForDisplay;
4502
4883
  exports.messageContentText = messageContentText;
4503
4884
  exports.omitXpertRelations = omitXpertRelations;
4885
+ exports.replaceAgentInDraft = replaceAgentInDraft;
4504
4886
  exports.resolveMessageAppendContext = resolveMessageAppendContext;
4505
4887
  exports.setStateVariable = setStateVariable;
4506
4888
  exports.shortTitle = shortTitle;
@@ -4509,9 +4891,3 @@ exports.transformInstallation = transformInstallation;
4509
4891
  exports.uuid = uuid;
4510
4892
  exports.workflowNodeIdentifier = workflowNodeIdentifier;
4511
4893
  exports.xpertLabel = xpertLabel;
4512
- Object.keys(chatkitTypes).forEach(function (k) {
4513
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
4514
- enumerable: true,
4515
- get: function () { return chatkitTypes[k]; }
4516
- });
4517
- });