@metad/contracts 3.8.3 → 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.
Files changed (38) hide show
  1. package/index.cjs.js +709 -310
  2. package/index.esm.js +695 -305
  3. package/package.json +6 -6
  4. package/src/agent/graph.d.ts +44 -29
  5. package/src/agent/token.d.ts +0 -17
  6. package/src/ai/assistant-binding.model.d.ts +74 -0
  7. package/src/ai/chat-event.model.d.ts +8 -0
  8. package/src/ai/chat-message.model.d.ts +1 -1
  9. package/src/ai/chat.model.d.ts +7 -1
  10. package/src/ai/feature.model.d.ts +5 -1
  11. package/src/ai/index.d.ts +40 -1
  12. package/src/ai/message-content.utils.d.ts +7 -1
  13. package/src/ai/sandbox.d.ts +3 -1
  14. package/src/ai/skill.model.d.ts +37 -18
  15. package/src/ai/xpert-agent-execution.model.d.ts +9 -0
  16. package/src/ai/xpert-agent.model.d.ts +3 -31
  17. package/src/ai/xpert-chat.model.d.ts +66 -0
  18. package/src/ai/xpert-project.model.d.ts +3 -0
  19. package/src/ai/xpert-workspace.model.d.ts +6 -1
  20. package/src/ai/xpert.model.d.ts +14 -4
  21. package/src/ai/xpert.utils.d.ts +8 -5
  22. package/src/api-key.model.d.ts +59 -1
  23. package/src/index.d.ts +3 -0
  24. package/src/integration.model.d.ts +7 -0
  25. package/src/invite.model.d.ts +2 -0
  26. package/src/plugin.d.ts +66 -1
  27. package/src/role.model.d.ts +3 -4
  28. package/src/scope.model.d.ts +9 -0
  29. package/src/types.d.ts +5 -2
  30. package/src/user-group.model.d.ts +7 -0
  31. package/src/view-extension/index.d.ts +1 -0
  32. package/src/view-extension/model.d.ts +183 -0
  33. package/index.esm.d.ts +0 -1
  34. package/src/help-center-article.model.d.ts +0 -0
  35. package/src/help-center.model.d.ts +0 -0
  36. package/src/integration/dify.d.ts +0 -0
  37. package/src/integration/fastgpt.d.ts +0 -0
  38. /package/{index.cjs.d.ts → index.d.ts} +0 -0
package/index.esm.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import ShortUniqueId from 'short-unique-id';
2
- export * from '@xpert-ai/chatkit-types';
3
2
 
4
3
  function _array_like_to_array$6(arr, len) {
5
4
  if (len == null || len > arr.length) len = arr.length;
@@ -36,6 +35,7 @@ var uuid = function() {
36
35
  }
37
36
  return (_uuidGenerator = uuidGenerator).randomUUID.apply(_uuidGenerator, _to_consumable_array$2(args));
38
37
  };
38
+ // Parameters
39
39
  var ParameterTypeEnum;
40
40
  (function(ParameterTypeEnum) {
41
41
  ParameterTypeEnum["STRING"] = "string";
@@ -916,26 +916,31 @@ var OrganizationDemoNetworkEnum;
916
916
  /**
917
917
  * Here is the intermediate type definition converted from the actual schema type to the xmla file format.
918
918
  * But the type definition here can also be referenced by the actual schema definition.
919
+ */ /**
920
+ * Mondrian 仅支持三种 Dimension 类型,
921
+ * 更丰富的语义可以通过 Semantics 来定义
919
922
  */ var DimensionType;
920
923
  (function(DimensionType) {
921
924
  DimensionType["StandardDimension"] = "StandardDimension";
922
925
  DimensionType["TimeDimension"] = "TimeDimension";
923
926
  DimensionType["MeasuresDimension"] = "MeasuresDimension";
924
927
  })(DimensionType || (DimensionType = {}));
925
- var Access;
928
+ /**
929
+ * enumerates the allowable access rights.
930
+ */ var Access;
926
931
  (function(Access) {
927
932
  /**
928
- * No access to an object and its children.
929
- */ Access["none"] = "none";
933
+ * No access to an object and its children.
934
+ */ Access["none"] = "none";
930
935
  /**
931
- * A grant that covers none of the children unless explicitly granted.
932
- */ Access["custom"] = "custom";
936
+ * A grant that covers none of the children unless explicitly granted.
937
+ */ Access["custom"] = "custom";
933
938
  /**
934
- * Access to all shared dimensions (applies to schema grant).
935
- */ Access["all_dimensions"] = "all_dimensions";
939
+ * Access to all shared dimensions (applies to schema grant).
940
+ */ Access["all_dimensions"] = "all_dimensions";
936
941
  /**
937
- * All access to an object and its children.
938
- */ Access["all"] = "all";
942
+ * All access to an object and its children.
943
+ */ Access["all"] = "all";
939
944
  })(Access || (Access = {}));
940
945
  var RollupPolicy;
941
946
  (function(RollupPolicy) {
@@ -945,10 +950,10 @@ var RollupPolicy;
945
950
  })(RollupPolicy || (RollupPolicy = {}));
946
951
 
947
952
  var schema = /*#__PURE__*/Object.freeze({
948
- __proto__: null,
949
- get Access () { return Access; },
950
- get DimensionType () { return DimensionType; },
951
- get RollupPolicy () { return RollupPolicy; }
953
+ __proto__: null,
954
+ get Access () { return Access; },
955
+ get DimensionType () { return DimensionType; },
956
+ get RollupPolicy () { return RollupPolicy; }
952
957
  });
953
958
 
954
959
  var ChatDashboardMessageType;
@@ -1071,22 +1076,28 @@ var IndicatorOptionFields = [
1071
1076
  "aggregator",
1072
1077
  "calendar"
1073
1078
  ];
1074
- var IndicatorType;
1079
+ /**
1080
+ * Indicator Type:
1081
+ * * Basic indicators
1082
+ * * Derivative Indicators
1083
+ */ var IndicatorType;
1075
1084
  (function(IndicatorType) {
1076
1085
  IndicatorType["BASIC"] = "BASIC";
1077
1086
  IndicatorType["DERIVE"] = "DERIVE";
1078
1087
  })(IndicatorType || (IndicatorType = {}));
1079
- var IndicatorStatusEnum;
1088
+ /**
1089
+ * Status of the indicator
1090
+ */ var IndicatorStatusEnum;
1080
1091
  (function(IndicatorStatusEnum) {
1081
1092
  /**
1082
- * draft
1083
- */ IndicatorStatusEnum["DRAFT"] = "DRAFT";
1093
+ * draft
1094
+ */ IndicatorStatusEnum["DRAFT"] = "DRAFT";
1084
1095
  /**
1085
- * Published
1086
- */ IndicatorStatusEnum["RELEASED"] = "RELEASED";
1096
+ * Published
1097
+ */ IndicatorStatusEnum["RELEASED"] = "RELEASED";
1087
1098
  /**
1088
- * Offline Archive
1089
- */ IndicatorStatusEnum["ARCHIVED"] = "ARCHIVED";
1099
+ * Offline Archive
1100
+ */ IndicatorStatusEnum["ARCHIVED"] = "ARCHIVED";
1090
1101
  })(IndicatorStatusEnum || (IndicatorStatusEnum = {}));
1091
1102
 
1092
1103
  var TimeGranularity;
@@ -1096,6 +1107,7 @@ var TimeGranularity;
1096
1107
  TimeGranularity["Month"] = "Month";
1097
1108
  TimeGranularity["Week"] = "Week";
1098
1109
  TimeGranularity["Day"] = "Day";
1110
+ // @todo more
1099
1111
  })(TimeGranularity || (TimeGranularity = {}));
1100
1112
  var IndicatorTagEnum;
1101
1113
  (function(IndicatorTagEnum) {
@@ -1140,31 +1152,39 @@ var AnalyticsPermissionsEnum;
1140
1152
  AnalyticsPermissionsEnum["PERMISSION_APPROVAL_EDIT"] = "PERMISSION_APPROVAL_EDIT";
1141
1153
  })(AnalyticsPermissionsEnum || (AnalyticsPermissionsEnum = {}));
1142
1154
 
1143
- var AgentType;
1155
+ /**
1156
+ * Data agent types
1157
+ */ var AgentType;
1144
1158
  (function(AgentType) {
1145
1159
  AgentType["Local"] = "local";
1146
1160
  AgentType["Browser"] = "browser";
1147
1161
  AgentType["Server"] = "server";
1148
1162
  AgentType["Wasm"] = "wasm";
1149
1163
  })(AgentType || (AgentType = {}));
1150
- var ModelTypeEnum;
1164
+ /**
1165
+ * Types of semantic model
1166
+ */ var ModelTypeEnum;
1151
1167
  (function(ModelTypeEnum) {
1152
1168
  ModelTypeEnum["XMLA"] = "XMLA";
1153
1169
  ModelTypeEnum["SQL"] = "SQL";
1154
1170
  })(ModelTypeEnum || (ModelTypeEnum = {}));
1155
- var RoleTypeEnum;
1171
+ /**
1172
+ * Role types
1173
+ */ var RoleTypeEnum;
1156
1174
  (function(RoleTypeEnum) {
1157
1175
  RoleTypeEnum["single"] = "single";
1158
1176
  RoleTypeEnum["union"] = "union";
1159
1177
  })(RoleTypeEnum || (RoleTypeEnum = {}));
1160
- var SemanticModelStatusEnum;
1178
+ /**
1179
+ * Status of semantic model
1180
+ */ var SemanticModelStatusEnum;
1161
1181
  (function(SemanticModelStatusEnum) {
1162
1182
  /**
1163
- * Using
1164
- */ SemanticModelStatusEnum["Progressing"] = "progressing";
1183
+ * Using
1184
+ */ SemanticModelStatusEnum["Progressing"] = "progressing";
1165
1185
  /**
1166
- * Archived
1167
- */ SemanticModelStatusEnum["Archived"] = "archived";
1186
+ * Archived
1187
+ */ SemanticModelStatusEnum["Archived"] = "archived";
1168
1188
  })(SemanticModelStatusEnum || (SemanticModelStatusEnum = {}));
1169
1189
  function extractSemanticModelDraft(model) {
1170
1190
  var _model_options, _model_options1;
@@ -1197,38 +1217,40 @@ function embeddingCubeCollectionName(modelKey, cube, isDraft) {
1197
1217
  var StoryStatusEnum;
1198
1218
  (function(StoryStatusEnum) {
1199
1219
  /**
1200
- * 草稿
1201
- */ StoryStatusEnum["DRAFT"] = "DRAFT";
1220
+ * 草稿
1221
+ */ StoryStatusEnum["DRAFT"] = "DRAFT";
1202
1222
  /**
1203
- * 重新编辑
1204
- */ StoryStatusEnum["CHANGING"] = "CHANGING";
1223
+ * 重新编辑
1224
+ */ StoryStatusEnum["CHANGING"] = "CHANGING";
1205
1225
  /**
1206
- * 审阅中
1207
- */ StoryStatusEnum["REVIEW"] = "REVIEW";
1226
+ * 审阅中
1227
+ */ StoryStatusEnum["REVIEW"] = "REVIEW";
1208
1228
  /**
1209
- * 通过
1210
- */ StoryStatusEnum["APPROVED"] = "APPROVED";
1229
+ * 通过
1230
+ */ StoryStatusEnum["APPROVED"] = "APPROVED";
1211
1231
  /**
1212
- * 退回
1213
- */ StoryStatusEnum["REJECTED"] = "REJECTED";
1232
+ * 退回
1233
+ */ StoryStatusEnum["REJECTED"] = "REJECTED";
1214
1234
  /**
1215
- * 已发布
1216
- */ StoryStatusEnum["RELEASED"] = "RELEASED";
1235
+ * 已发布
1236
+ */ StoryStatusEnum["RELEASED"] = "RELEASED";
1217
1237
  /**
1218
- * 下线存档
1219
- */ StoryStatusEnum["ARCHIVED"] = "ARCHIVED";
1238
+ * 下线存档
1239
+ */ StoryStatusEnum["ARCHIVED"] = "ARCHIVED";
1220
1240
  })(StoryStatusEnum || (StoryStatusEnum = {}));
1221
- var AccessEnum;
1241
+ /**
1242
+ * 用户对某个实体的访问权限
1243
+ */ var AccessEnum;
1222
1244
  (function(AccessEnum) {
1223
1245
  /**
1224
- * 可看到
1225
- */ AccessEnum["View"] = "View";
1246
+ * 可看到
1247
+ */ AccessEnum["View"] = "View";
1226
1248
  /**
1227
- * 可读取详情
1228
- */ AccessEnum["Read"] = "Read";
1249
+ * 可读取详情
1250
+ */ AccessEnum["Read"] = "Read";
1229
1251
  /**
1230
- * 可编辑
1231
- */ AccessEnum["Write"] = "Write";
1252
+ * 可编辑
1253
+ */ AccessEnum["Write"] = "Write";
1232
1254
  })(AccessEnum || (AccessEnum = {}));
1233
1255
 
1234
1256
  var SubscriptionType;
@@ -1295,11 +1317,11 @@ var PermissionApprovalStatus = {
1295
1317
  var ProjectStatusEnum;
1296
1318
  (function(ProjectStatusEnum) {
1297
1319
  /**
1298
- * In use
1299
- */ ProjectStatusEnum["Progressing"] = "Progressing";
1320
+ * In use
1321
+ */ ProjectStatusEnum["Progressing"] = "Progressing";
1300
1322
  /**
1301
- * Archived
1302
- */ ProjectStatusEnum["Archived"] = "Archived";
1323
+ * Archived
1324
+ */ ProjectStatusEnum["Archived"] = "Archived";
1303
1325
  })(ProjectStatusEnum || (ProjectStatusEnum = {}));
1304
1326
 
1305
1327
  var StoryTemplateType;
@@ -1316,17 +1338,52 @@ var QueryStatusEnum;
1316
1338
  QueryStatusEnum["FAILED"] = "failed";
1317
1339
  })(QueryStatusEnum || (QueryStatusEnum = {}));
1318
1340
 
1341
+ var AssistantCode;
1342
+ (function(AssistantCode) {
1343
+ AssistantCode["CHAT_COMMON"] = "chat_common";
1344
+ AssistantCode["XPERT_SHARED"] = "xpert_shared";
1345
+ AssistantCode["CHATBI"] = "chatbi";
1346
+ AssistantCode["CLAWXPERT"] = "clawxpert";
1347
+ })(AssistantCode || (AssistantCode = {}));
1348
+ var AssistantBindingScope;
1349
+ (function(AssistantBindingScope) {
1350
+ AssistantBindingScope["TENANT"] = "tenant";
1351
+ AssistantBindingScope["ORGANIZATION"] = "organization";
1352
+ AssistantBindingScope["USER"] = "user";
1353
+ })(AssistantBindingScope || (AssistantBindingScope = {}));
1354
+ var AssistantBindingSourceScope;
1355
+ (function(AssistantBindingSourceScope) {
1356
+ AssistantBindingSourceScope["NONE"] = "none";
1357
+ AssistantBindingSourceScope["TENANT"] = "tenant";
1358
+ AssistantBindingSourceScope["ORGANIZATION"] = "organization";
1359
+ })(AssistantBindingSourceScope || (AssistantBindingSourceScope = {}));
1360
+ var USER_MANAGED_ASSISTANTS = new Set([
1361
+ AssistantCode.CLAWXPERT
1362
+ ]);
1363
+ function getAssistantManagement(code) {
1364
+ return USER_MANAGED_ASSISTANTS.has(code) ? "user" : "system";
1365
+ }
1366
+ function isUserManagedAssistant(code) {
1367
+ return getAssistantManagement(code) === "user";
1368
+ }
1369
+ function isSystemManagedAssistant(code) {
1370
+ return getAssistantManagement(code) === "system";
1371
+ }
1372
+
1319
1373
  var ProviderType;
1320
1374
  (function(ProviderType) {
1321
1375
  ProviderType["CUSTOM"] = "custom";
1322
1376
  ProviderType["SYSTEM"] = "system";
1323
1377
  })(ProviderType || (ProviderType = {}));
1324
- var CredentialFormTypeEnum;
1378
+ /**
1379
+ * @todo Use JSON Schema to implement
1380
+ */ var CredentialFormTypeEnum;
1325
1381
  (function(CredentialFormTypeEnum) {
1326
1382
  CredentialFormTypeEnum["TEXT_INPUT"] = "text-input";
1327
1383
  CredentialFormTypeEnum["SECRET_INPUT"] = "secret-input";
1328
1384
  CredentialFormTypeEnum["SELECT"] = "select";
1329
1385
  CredentialFormTypeEnum["RADIO"] = "radio";
1386
+ // SWITCH = "switch", // use ParameterType.BOOLEAN
1330
1387
  })(CredentialFormTypeEnum || (CredentialFormTypeEnum = {}));
1331
1388
  var FetchFrom;
1332
1389
  (function(FetchFrom) {
@@ -1362,7 +1419,9 @@ var ConfigurateMethod;
1362
1419
  ConfigurateMethod["PREDEFINED_MODEL"] = "predefined-model";
1363
1420
  ConfigurateMethod["CUSTOMIZABLE_MODEL"] = "customizable-model";
1364
1421
  })(ConfigurateMethod || (ConfigurateMethod = {}));
1365
- var ParameterType;
1422
+ /**
1423
+ * @todo Use JSON Schema to implement
1424
+ */ var ParameterType;
1366
1425
  (function(ParameterType) {
1367
1426
  ParameterType["FLOAT"] = "float";
1368
1427
  ParameterType["INT"] = "int";
@@ -1384,58 +1443,62 @@ var PriceType;
1384
1443
  AiBusinessRole["FinanceBP"] = "finance_bp";
1385
1444
  AiBusinessRole["SupplyChainExpert"] = "supply_chain_expert";
1386
1445
  })(AiBusinessRole || (AiBusinessRole = {}));
1387
- var AiProvider;
1446
+ /**
1447
+ * Providers for LLMs
1448
+ *
1449
+ * - https://js.langchain.com/docs/integrations/chat/
1450
+ */ var AiProvider;
1388
1451
  (function(AiProvider) {
1389
1452
  /**
1390
- * - https://js.langchain.com/docs/integrations/chat/openai/
1391
- */ AiProvider["OpenAI"] = "openai";
1453
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1454
+ */ AiProvider["OpenAI"] = "openai";
1392
1455
  /**
1393
- * - https://js.langchain.com/docs/integrations/chat/openai/
1394
- */ AiProvider["Azure"] = "azure";
1456
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1457
+ */ AiProvider["Azure"] = "azure";
1395
1458
  // DashScope = 'dashscope',
1396
1459
  /**
1397
- * - https://ollama.com/
1398
- * - https://js.langchain.com/docs/integrations/chat/ollama/
1399
- */ AiProvider["Ollama"] = "ollama";
1460
+ * - https://ollama.com/
1461
+ * - https://js.langchain.com/docs/integrations/chat/ollama/
1462
+ */ AiProvider["Ollama"] = "ollama";
1400
1463
  /**
1401
- * - https://www.deepseek.com/zh
1402
- * - https://js.langchain.com/docs/integrations/chat/openai/
1403
- */ AiProvider["DeepSeek"] = "deepseek";
1464
+ * - https://www.deepseek.com/zh
1465
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1466
+ */ AiProvider["DeepSeek"] = "deepseek";
1404
1467
  /**
1405
- * - https://docs.anthropic.com/en/home
1406
- * - https://js.langchain.com/docs/integrations/chat/anthropic/
1407
- */ AiProvider["Anthropic"] = "anthropic";
1468
+ * - https://docs.anthropic.com/en/home
1469
+ * - https://js.langchain.com/docs/integrations/chat/anthropic/
1470
+ */ AiProvider["Anthropic"] = "anthropic";
1408
1471
  /**
1409
- * - https://www.aliyun.com/product/bailian
1410
- * - https://js.langchain.com/docs/integrations/chat/alibaba_tongyi/
1411
- */ AiProvider["AlibabaTongyi"] = "alibaba_tongyi";
1472
+ * - https://www.aliyun.com/product/bailian
1473
+ * - https://js.langchain.com/docs/integrations/chat/alibaba_tongyi/
1474
+ */ AiProvider["AlibabaTongyi"] = "alibaba_tongyi";
1412
1475
  /**
1413
- * - https://open.bigmodel.cn/
1414
- * - https://js.langchain.com/docs/integrations/chat/openai/
1415
- */ AiProvider["Zhipu"] = "zhipu";
1476
+ * - https://open.bigmodel.cn/
1477
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1478
+ */ AiProvider["Zhipu"] = "zhipu";
1416
1479
  /**
1417
- * - https://qianfan.cloud.baidu.com/
1418
- * - https://js.langchain.com/docs/integrations/chat/baidu_qianfan/
1419
- */ AiProvider["BaiduQianfan"] = "baidu_qianfan";
1480
+ * - https://qianfan.cloud.baidu.com/
1481
+ * - https://js.langchain.com/docs/integrations/chat/baidu_qianfan/
1482
+ */ AiProvider["BaiduQianfan"] = "baidu_qianfan";
1420
1483
  /**
1421
- * - https://www.together.ai/
1422
- * - https://js.langchain.com/docs/integrations/chat/togetherai/
1423
- */ AiProvider["Together"] = "together";
1484
+ * - https://www.together.ai/
1485
+ * - https://js.langchain.com/docs/integrations/chat/togetherai/
1486
+ */ AiProvider["Together"] = "together";
1424
1487
  /**
1425
- * - https://platform.moonshot.cn/console
1426
- * - https://js.langchain.com/docs/integrations/chat/openai/
1427
- */ AiProvider["Moonshot"] = "moonshot";
1488
+ * - https://platform.moonshot.cn/console
1489
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1490
+ */ AiProvider["Moonshot"] = "moonshot";
1428
1491
  /**
1429
- * - https://groq.com/
1430
- * - https://js.langchain.com/docs/integrations/chat/openai/
1431
- */ AiProvider["Groq"] = "groq";
1492
+ * - https://groq.com/
1493
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1494
+ */ AiProvider["Groq"] = "groq";
1432
1495
  /**
1433
- * - https://mistral.ai/
1434
- *
1435
- */ AiProvider["Mistral"] = "mistral";
1496
+ * - https://mistral.ai/
1497
+ *
1498
+ */ AiProvider["Mistral"] = "mistral";
1436
1499
  /**
1437
- * - https://cohere.com/
1438
- */ AiProvider["Cohere"] = "cohere";
1500
+ * - https://cohere.com/
1501
+ */ AiProvider["Cohere"] = "cohere";
1439
1502
  })(AiProvider || (AiProvider = {}));
1440
1503
  var AiProtocol;
1441
1504
  (function(AiProtocol) {
@@ -1443,15 +1506,53 @@ var AiProtocol;
1443
1506
  AiProtocol["Others"] = "others";
1444
1507
  })(AiProtocol || (AiProtocol = {}));
1445
1508
  var OpenAIEmbeddingsProviders = [
1446
- "openai",
1447
- "azure",
1448
- "deepseek"
1509
+ AiProvider.OpenAI,
1510
+ AiProvider.Azure,
1511
+ AiProvider.DeepSeek
1449
1512
  ];
1450
1513
  var OllamaEmbeddingsProviders = [
1451
- "ollama"
1514
+ AiProvider.Ollama
1452
1515
  ];
1453
1516
 
1454
- var ChatGatewayEvent;
1517
+ function _define_property$6(obj, key, value) {
1518
+ if (key in obj) {
1519
+ Object.defineProperty(obj, key, {
1520
+ value: value,
1521
+ enumerable: true,
1522
+ configurable: true,
1523
+ writable: true
1524
+ });
1525
+ } else {
1526
+ obj[key] = value;
1527
+ }
1528
+ return obj;
1529
+ }
1530
+ function _object_spread$5(target) {
1531
+ for(var i = 1; i < arguments.length; i++){
1532
+ var source = arguments[i] != null ? arguments[i] : {};
1533
+ var ownKeys = Object.keys(source);
1534
+ if (typeof Object.getOwnPropertySymbols === "function") {
1535
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1536
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1537
+ }));
1538
+ }
1539
+ ownKeys.forEach(function(key) {
1540
+ _define_property$6(target, key, source[key]);
1541
+ });
1542
+ }
1543
+ return target;
1544
+ }
1545
+ var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
1546
+ var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
1547
+ function createConversationTitleSummaryEvent(event) {
1548
+ return _object_spread$5({
1549
+ type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
1550
+ }, event);
1551
+ }
1552
+
1553
+ /**
1554
+ * @deprecated use ChatMessageEventTypeEnum
1555
+ */ var ChatGatewayEvent;
1455
1556
  (function(ChatGatewayEvent) {
1456
1557
  ChatGatewayEvent["ACK"] = "ack";
1457
1558
  ChatGatewayEvent["ConversationCreated"] = "conversation_created";
@@ -1487,7 +1588,9 @@ var MEMORY_PROFILE_PROMPT = "Extract new user profile information from the above
1487
1588
 
1488
1589
  var USAGE_HOUR_FORMAT = "yyyy-MM-dd HH";
1489
1590
 
1490
- var AiProviderRole;
1591
+ /**
1592
+ * The order of priority is: `Embedding`, `Secondary`, `Primary`
1593
+ */ var AiProviderRole;
1491
1594
  (function(AiProviderRole) {
1492
1595
  AiProviderRole["Primary"] = "primary";
1493
1596
  AiProviderRole["Secondary"] = "secondary";
@@ -1501,6 +1604,10 @@ var AiFeatureEnum;
1501
1604
  AiFeatureEnum["FEATURE_COPILOT_KNOWLEDGEBASE"] = "FEATURE_COPILOT_KNOWLEDGEBASE";
1502
1605
  AiFeatureEnum["FEATURE_COPILOT_CHAT"] = "FEATURE_COPILOT_CHAT";
1503
1606
  AiFeatureEnum["FEATURE_XPERT"] = "FEATURE_XPERT";
1607
+ AiFeatureEnum["FEATURE_XPERT_CHATBI"] = "FEATURE_XPERT_CHATBI";
1608
+ AiFeatureEnum["FEATURE_XPERT_CLAWXPERT"] = "FEATURE_XPERT_CLAWXPERT";
1609
+ AiFeatureEnum["FEATURE_XPERT_CODEXPERT"] = "FEATURE_XPERT_CODEXPERT";
1610
+ AiFeatureEnum["FEATURE_XPERT_DEEP_RESEARCH"] = "FEATURE_XPERT_DEEP_RESEARCH";
1504
1611
  })(AiFeatureEnum || (AiFeatureEnum = {}));
1505
1612
 
1506
1613
  var VectorTypeEnum;
@@ -1537,14 +1644,14 @@ var KDocumentWebTypeEnum;
1537
1644
  })(KDocumentWebTypeEnum || (KDocumentWebTypeEnum = {}));
1538
1645
  var KDocumentWebTypeOptions = [
1539
1646
  {
1540
- value: "playwright",
1647
+ value: KDocumentWebTypeEnum.Playwright,
1541
1648
  label: {
1542
1649
  en_US: "Playwright"
1543
1650
  },
1544
1651
  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>'
1545
1652
  },
1546
1653
  {
1547
- value: "firecrawl",
1654
+ value: KDocumentWebTypeEnum.FireCrawl,
1548
1655
  label: {
1549
1656
  en_US: "FireCrawl"
1550
1657
  },
@@ -1557,19 +1664,19 @@ var WorkflowNodeTypeEnum;
1557
1664
  WorkflowNodeTypeEnum["START"] = "start";
1558
1665
  WorkflowNodeTypeEnum["END"] = "end";
1559
1666
  /**
1560
- * Trigger
1561
- */ WorkflowNodeTypeEnum["TRIGGER"] = "trigger";
1667
+ * Trigger
1668
+ */ WorkflowNodeTypeEnum["TRIGGER"] = "trigger";
1562
1669
  /**
1563
- * State Variable Assigner
1564
- */ WorkflowNodeTypeEnum["ASSIGNER"] = "assigner";
1670
+ * State Variable Assigner
1671
+ */ WorkflowNodeTypeEnum["ASSIGNER"] = "assigner";
1565
1672
  /**
1566
- * Router
1567
- */ WorkflowNodeTypeEnum["IF_ELSE"] = "if-else";
1673
+ * Router
1674
+ */ WorkflowNodeTypeEnum["IF_ELSE"] = "if-else";
1568
1675
  WorkflowNodeTypeEnum["LIST_OPERATOR"] = "list-operator";
1569
1676
  WorkflowNodeTypeEnum["VARIABLE_AGGREGATOR"] = "variable-aggregator";
1570
1677
  /**
1571
- * @deprecated use ITERATOR instead
1572
- */ WorkflowNodeTypeEnum["ITERATING"] = "iterating";
1678
+ * @deprecated use ITERATOR instead
1679
+ */ WorkflowNodeTypeEnum["ITERATING"] = "iterating";
1573
1680
  WorkflowNodeTypeEnum["ITERATOR"] = "iterator";
1574
1681
  WorkflowNodeTypeEnum["HTTP"] = "http";
1575
1682
  WorkflowNodeTypeEnum["SUBFLOW"] = "subflow";
@@ -1577,8 +1684,8 @@ var WorkflowNodeTypeEnum;
1577
1684
  WorkflowNodeTypeEnum["AGENT_TOOL"] = "agent-tool";
1578
1685
  WorkflowNodeTypeEnum["NOTE"] = "note";
1579
1686
  /**
1580
- * Task node, distribute tasks to sub-agents
1581
- */ WorkflowNodeTypeEnum["TASK"] = "task";
1687
+ * Task node, distribute tasks to sub-agents
1688
+ */ WorkflowNodeTypeEnum["TASK"] = "task";
1582
1689
  // Knowledge Pipeline nodes
1583
1690
  WorkflowNodeTypeEnum["SOURCE"] = "source";
1584
1691
  WorkflowNodeTypeEnum["PROCESSOR"] = "processor";
@@ -1599,20 +1706,20 @@ var WorkflowNodeTypeEnum;
1599
1706
  // 📦 Database Operation Nodes
1600
1707
  // ===============================
1601
1708
  /**
1602
- * Custom SQL
1603
- */ WorkflowNodeTypeEnum["DB_SQL"] = "db-sql";
1709
+ * Custom SQL
1710
+ */ WorkflowNodeTypeEnum["DB_SQL"] = "db-sql";
1604
1711
  /**
1605
- * Insert data (INSERT)
1606
- */ WorkflowNodeTypeEnum["DB_INSERT"] = "db-insert";
1712
+ * Insert data (INSERT)
1713
+ */ WorkflowNodeTypeEnum["DB_INSERT"] = "db-insert";
1607
1714
  /**
1608
- * Update data (UPDATE)
1609
- */ WorkflowNodeTypeEnum["DB_UPDATE"] = "db-update";
1715
+ * Update data (UPDATE)
1716
+ */ WorkflowNodeTypeEnum["DB_UPDATE"] = "db-update";
1610
1717
  /**
1611
- * Delete data (DELETE)
1612
- */ WorkflowNodeTypeEnum["DB_DELETE"] = "db-delete";
1718
+ * Delete data (DELETE)
1719
+ */ WorkflowNodeTypeEnum["DB_DELETE"] = "db-delete";
1613
1720
  /**
1614
- * Query data (SELECT)
1615
- */ WorkflowNodeTypeEnum["DB_QUERY"] = "db-query";
1721
+ * Query data (SELECT)
1722
+ */ WorkflowNodeTypeEnum["DB_QUERY"] = "db-query";
1616
1723
  // ===============================
1617
1724
  // 🏆 Pro Nodes
1618
1725
  // ===============================
@@ -1702,14 +1809,14 @@ function workflowNodeIdentifier(node) {
1702
1809
  var XpertTypeEnum;
1703
1810
  (function(XpertTypeEnum) {
1704
1811
  /**
1705
- * Chat Agents
1706
- */ XpertTypeEnum["Agent"] = "agent";
1812
+ * Chat Agents
1813
+ */ XpertTypeEnum["Agent"] = "agent";
1707
1814
  /**
1708
- * Copilot in UI
1709
- */ XpertTypeEnum["Copilot"] = "copilot";
1815
+ * Copilot in UI
1816
+ */ XpertTypeEnum["Copilot"] = "copilot";
1710
1817
  /**
1711
- * Knowledge Workflow
1712
- */ XpertTypeEnum["Knowledge"] = "knowledge";
1818
+ * Knowledge Workflow
1819
+ */ XpertTypeEnum["Knowledge"] = "knowledge";
1713
1820
  })(XpertTypeEnum || (XpertTypeEnum = {}));
1714
1821
  var LongTermMemoryTypeEnum;
1715
1822
  (function(LongTermMemoryTypeEnum) {
@@ -1719,11 +1826,11 @@ var LongTermMemoryTypeEnum;
1719
1826
  var XpertParameterTypeEnum;
1720
1827
  (function(XpertParameterTypeEnum) {
1721
1828
  /**
1722
- * @deprecated use string
1723
- */ XpertParameterTypeEnum["TEXT"] = "text";
1829
+ * @deprecated use string
1830
+ */ XpertParameterTypeEnum["TEXT"] = "text";
1724
1831
  /**
1725
- * @deprecated use string
1726
- */ XpertParameterTypeEnum["PARAGRAPH"] = "paragraph";
1832
+ * @deprecated use string
1833
+ */ XpertParameterTypeEnum["PARAGRAPH"] = "paragraph";
1727
1834
  XpertParameterTypeEnum["STRING"] = "string";
1728
1835
  XpertParameterTypeEnum["NUMBER"] = "number";
1729
1836
  XpertParameterTypeEnum["OBJECT"] = "object";
@@ -1794,7 +1901,7 @@ function _array_like_to_array$5(arr, len) {
1794
1901
  function _array_with_holes$4(arr) {
1795
1902
  if (Array.isArray(arr)) return arr;
1796
1903
  }
1797
- function _define_property$4(obj, key, value) {
1904
+ function _define_property$5(obj, key, value) {
1798
1905
  if (key in obj) {
1799
1906
  Object.defineProperty(obj, key, {
1800
1907
  value: value,
@@ -1834,7 +1941,7 @@ function _iterable_to_array_limit$3(arr, i) {
1834
1941
  function _non_iterable_rest$4() {
1835
1942
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1836
1943
  }
1837
- function _object_spread$3(target) {
1944
+ function _object_spread$4(target) {
1838
1945
  for(var i = 1; i < arguments.length; i++){
1839
1946
  var source = arguments[i] != null ? arguments[i] : {};
1840
1947
  var ownKeys = Object.keys(source);
@@ -1844,12 +1951,12 @@ function _object_spread$3(target) {
1844
1951
  }));
1845
1952
  }
1846
1953
  ownKeys.forEach(function(key) {
1847
- _define_property$4(target, key, source[key]);
1954
+ _define_property$5(target, key, source[key]);
1848
1955
  });
1849
1956
  }
1850
1957
  return target;
1851
1958
  }
1852
- function ownKeys$2(object, enumerableOnly) {
1959
+ function ownKeys$3(object, enumerableOnly) {
1853
1960
  var keys = Object.keys(object);
1854
1961
  if (Object.getOwnPropertySymbols) {
1855
1962
  var symbols = Object.getOwnPropertySymbols(object);
@@ -1857,12 +1964,12 @@ function ownKeys$2(object, enumerableOnly) {
1857
1964
  }
1858
1965
  return keys;
1859
1966
  }
1860
- function _object_spread_props$2(target, source) {
1967
+ function _object_spread_props$3(target, source) {
1861
1968
  source = source != null ? source : {};
1862
1969
  if (Object.getOwnPropertyDescriptors) {
1863
1970
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1864
1971
  } else {
1865
- ownKeys$2(Object(source)).forEach(function(key) {
1972
+ ownKeys$3(Object(source)).forEach(function(key) {
1866
1973
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1867
1974
  });
1868
1975
  }
@@ -1904,9 +2011,9 @@ function messageContentText(content) {
1904
2011
  }
1905
2012
  /**
1906
2013
  * Get workspace folder for sandbox from runnable configurable
1907
- *
1908
- * @param configurable
1909
- * @returns
2014
+ *
2015
+ * @param configurable
2016
+ * @returns
1910
2017
  */ function getWorkspaceFromRunnable(configurable) {
1911
2018
  return (configurable === null || configurable === void 0 ? void 0 : configurable.projectId) ? {
1912
2019
  type: "project",
@@ -1928,9 +2035,9 @@ function getToolCallIdFromConfig(config) {
1928
2035
  * Compute long-term memory namespace:
1929
2036
  * 1. When a user talks to a digital expert individually, use `ExpertId` + `UserId` to store memory
1930
2037
  * 2. When talking to a digital expert in a project, all users and digital experts share `ProjectId` to store memory
1931
- *
1932
- * @param config
1933
- * @returns
2038
+ *
2039
+ * @param config
2040
+ * @returns
1934
2041
  */ function getStoreNamespace(config) {
1935
2042
  var configurable = config.configurable;
1936
2043
  return configurableStoreNamespace(configurable);
@@ -1945,16 +2052,16 @@ function configurableStoreNamespace(configurable) {
1945
2052
  }
1946
2053
  /**
1947
2054
  * Set value into variable of state.
1948
- *
1949
- * @param state
1950
- * @param varName
1951
- * @param value
1952
- * @returns
2055
+ *
2056
+ * @param state
2057
+ * @param varName
2058
+ * @param value
2059
+ * @returns
1953
2060
  */ function setStateVariable(state, varName, value) {
1954
2061
  var _varName_split = _sliced_to_array$3(varName.split("."), 2), agentChannelName = _varName_split[0], variableName = _varName_split[1];
1955
2062
  if (variableName) {
1956
2063
  var _state_agentChannelName;
1957
- 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));
2064
+ 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));
1958
2065
  } else {
1959
2066
  state[agentChannelName] = value;
1960
2067
  }
@@ -1962,10 +2069,10 @@ function configurableStoreNamespace(configurable) {
1962
2069
  }
1963
2070
  /**
1964
2071
  * Get agent variable group from graph.
1965
- *
1966
- * @param key
1967
- * @param graph
1968
- * @returns
2072
+ *
2073
+ * @param key
2074
+ * @param graph
2075
+ * @returns
1969
2076
  */ function getAgentVarGroup(key, graph) {
1970
2077
  var _agent_options;
1971
2078
  var node = graph.nodes.find(function(_) {
@@ -2021,9 +2128,9 @@ function configurableStoreNamespace(configurable) {
2021
2128
  // Swarm
2022
2129
  /**
2023
2130
  * Get swarm partners of agent in team
2024
- *
2025
- * @param graph
2026
- * @param agentKey
2131
+ *
2132
+ * @param graph
2133
+ * @param agentKey
2027
2134
  */ function getSwarmPartners(graph, agentKey, partners, leaderKey) {
2028
2135
  var connections = graph.connections.filter(function(conn) {
2029
2136
  return conn.type === "agent" && conn.to === agentKey && (leaderKey ? conn.from !== leaderKey : true) && graph.connections.some(function(_) {
@@ -2045,7 +2152,9 @@ function getWorkflowTriggers(graph, from) {
2045
2152
  });
2046
2153
  }
2047
2154
 
2048
- var KnowledgeProviderEnum;
2155
+ /**
2156
+ * Non-internal types should remain the same as IntegrationEnum.
2157
+ */ var KnowledgeProviderEnum;
2049
2158
  (function(KnowledgeProviderEnum) {
2050
2159
  KnowledgeProviderEnum["Internal"] = "internal";
2051
2160
  })(KnowledgeProviderEnum || (KnowledgeProviderEnum = {}));
@@ -2060,18 +2169,20 @@ var KnowledgeStructureEnum;
2060
2169
  KnowledgeStructureEnum["ParentChild"] = "parent-child";
2061
2170
  KnowledgeStructureEnum["QA"] = "qa";
2062
2171
  })(KnowledgeStructureEnum || (KnowledgeStructureEnum = {}));
2063
- var KnowledgebasePermission;
2172
+ /**
2173
+ * Knowledgebase permission levels
2174
+ */ var KnowledgebasePermission;
2064
2175
  (function(KnowledgebasePermission) {
2065
2176
  /**
2066
- * Only visible to you
2067
- * @default
2068
- */ KnowledgebasePermission["Private"] = "private";
2177
+ * Only visible to you
2178
+ * @default
2179
+ */ KnowledgebasePermission["Private"] = "private";
2069
2180
  /**
2070
- * Visible to all members in the organization
2071
- */ KnowledgebasePermission["Organization"] = "organization";
2181
+ * Visible to all members in the organization
2182
+ */ KnowledgebasePermission["Organization"] = "organization";
2072
2183
  /**
2073
- * Visible to all members in the tenant
2074
- */ KnowledgebasePermission["Public"] = "public";
2184
+ * Visible to all members in the tenant
2185
+ */ KnowledgebasePermission["Public"] = "public";
2075
2186
  })(KnowledgebasePermission || (KnowledgebasePermission = {}));
2076
2187
  /**
2077
2188
  * Channel name for knowledgebase pipeline
@@ -2086,24 +2197,26 @@ var KNOWLEDGE_DOCUMENTS_NAME = "documents";
2086
2197
  var KNOWLEDGE_FOLDER_ID_NAME = "folder_id";
2087
2198
  var KNOWLEDGE_STAGE_NAME = "stage";
2088
2199
 
2089
- var DocumentSourceProviderCategoryEnum;
2200
+ /**
2201
+ * Category of document source provider
2202
+ */ var DocumentSourceProviderCategoryEnum;
2090
2203
  (function(DocumentSourceProviderCategoryEnum) {
2091
2204
  /**
2092
- * Local files uploaded directly to the system
2093
- */ DocumentSourceProviderCategoryEnum["LocalFile"] = "local-file";
2205
+ * Local files uploaded directly to the system
2206
+ */ DocumentSourceProviderCategoryEnum["LocalFile"] = "local-file";
2094
2207
  /**
2095
- * Remote file systems, e.g. S3, FTP, etc.
2096
- */ DocumentSourceProviderCategoryEnum["FileSystem"] = "file-system";
2208
+ * Remote file systems, e.g. S3, FTP, etc.
2209
+ */ DocumentSourceProviderCategoryEnum["FileSystem"] = "file-system";
2097
2210
  /**
2098
- * Online documents, e.g. public URLs, Google Docs, etc.
2099
- */ DocumentSourceProviderCategoryEnum["OnlineDocument"] = "online-document";
2211
+ * Online documents, e.g. public URLs, Google Docs, etc.
2212
+ */ DocumentSourceProviderCategoryEnum["OnlineDocument"] = "online-document";
2100
2213
  /**
2101
- * Web crawling from public websites
2102
- */ DocumentSourceProviderCategoryEnum["WebCrawl"] = "web-crawl";
2214
+ * Web crawling from public websites
2215
+ */ DocumentSourceProviderCategoryEnum["WebCrawl"] = "web-crawl";
2103
2216
  /**
2104
- * Database connections, e.g. MySQL, PostgreSQL, etc.
2105
- * @deprecated Planning
2106
- */ DocumentSourceProviderCategoryEnum["Database"] = "database";
2217
+ * Database connections, e.g. MySQL, PostgreSQL, etc.
2218
+ * @deprecated Planning
2219
+ */ DocumentSourceProviderCategoryEnum["Database"] = "database";
2107
2220
  })(DocumentSourceProviderCategoryEnum || (DocumentSourceProviderCategoryEnum = {}));
2108
2221
  function genPipelineSourceKey() {
2109
2222
  return letterStartSUID("Source_");
@@ -2121,7 +2234,7 @@ function genPipelineKnowledgeBaseKey() {
2121
2234
  return letterStartSUID("KnowledgeBase_");
2122
2235
  }
2123
2236
 
2124
- function _define_property$3(obj, key, value) {
2237
+ function _define_property$4(obj, key, value) {
2125
2238
  if (key in obj) {
2126
2239
  Object.defineProperty(obj, key, {
2127
2240
  value: value,
@@ -2134,7 +2247,7 @@ function _define_property$3(obj, key, value) {
2134
2247
  }
2135
2248
  return obj;
2136
2249
  }
2137
- function _object_spread$2(target) {
2250
+ function _object_spread$3(target) {
2138
2251
  for(var i = 1; i < arguments.length; i++){
2139
2252
  var source = arguments[i] != null ? arguments[i] : {};
2140
2253
  var ownKeys = Object.keys(source);
@@ -2144,23 +2257,30 @@ function _object_spread$2(target) {
2144
2257
  }));
2145
2258
  }
2146
2259
  ownKeys.forEach(function(key) {
2147
- _define_property$3(target, key, source[key]);
2260
+ _define_property$4(target, key, source[key]);
2148
2261
  });
2149
2262
  }
2150
2263
  return target;
2151
2264
  }
2152
- var DocumentTypeEnum;
2265
+ /**
2266
+ * Import Type:
2267
+ * - file: local file
2268
+ * - web: web document
2269
+ * ...
2270
+ */ var DocumentTypeEnum;
2153
2271
  (function(DocumentTypeEnum) {
2154
2272
  /**
2155
- * Folder, parent of other documents
2156
- */ DocumentTypeEnum["FOLDER"] = "folder";
2273
+ * Folder, parent of other documents
2274
+ */ DocumentTypeEnum["FOLDER"] = "folder";
2157
2275
  /**
2158
- * Local files
2159
- * @deprecated use DocumentSourceProviderCategoryEnum local file type instead
2160
- */ DocumentTypeEnum["FILE"] = "file";
2276
+ * Local files
2277
+ * @deprecated use DocumentSourceProviderCategoryEnum local file type instead
2278
+ */ DocumentTypeEnum["FILE"] = "file";
2161
2279
  })(DocumentTypeEnum || (DocumentTypeEnum = {}));
2162
- var KDocumentSourceType = _object_spread$2({}, DocumentSourceProviderCategoryEnum, DocumentTypeEnum);
2163
- var KBDocumentCategoryEnum;
2280
+ var KDocumentSourceType = _object_spread$3({}, DocumentSourceProviderCategoryEnum, DocumentTypeEnum);
2281
+ /**
2282
+ * Document type category, determine how to process the document.
2283
+ */ var KBDocumentCategoryEnum;
2164
2284
  (function(KBDocumentCategoryEnum) {
2165
2285
  KBDocumentCategoryEnum["Text"] = "text";
2166
2286
  KBDocumentCategoryEnum["Image"] = "image";
@@ -2225,7 +2345,7 @@ function isAudioType(type) {
2225
2345
  ].includes(type);
2226
2346
  }
2227
2347
  function classificateDocumentCategory(entity) {
2228
- return isDocumentSheet(entity.type) ? "sheet" : isImageType(entity.type) ? "image" : isVideoType(entity.type) ? "video" : isAudioType(entity.type) ? "audio" : "text";
2348
+ return isDocumentSheet(entity.type) ? KBDocumentCategoryEnum.Sheet : isImageType(entity.type) ? KBDocumentCategoryEnum.Image : isVideoType(entity.type) ? KBDocumentCategoryEnum.Video : isAudioType(entity.type) ? KBDocumentCategoryEnum.Audio : KBDocumentCategoryEnum.Text;
2229
2349
  }
2230
2350
  /**
2231
2351
  * System standard Metadata field definition constants
@@ -2270,17 +2390,19 @@ function classificateDocumentCategory(entity) {
2270
2390
  var AIPermissionsEnum;
2271
2391
  (function(AIPermissionsEnum) {
2272
2392
  /**
2273
- * Create or edit Knowledgebase in organization.
2274
- */ AIPermissionsEnum["KNOWLEDGEBASE_EDIT"] = "KNOWLEDGEBASE_EDIT";
2393
+ * Create or edit Knowledgebase in organization.
2394
+ */ AIPermissionsEnum["KNOWLEDGEBASE_EDIT"] = "KNOWLEDGEBASE_EDIT";
2275
2395
  AIPermissionsEnum["COPILOT_VIEW"] = "COPILOT_VIEW";
2276
2396
  AIPermissionsEnum["COPILOT_EDIT"] = "COPILOT_EDIT";
2277
2397
  /**
2278
- * Create or edit Xperts in organization.
2279
- */ AIPermissionsEnum["XPERT_EDIT"] = "XPERT_EDIT";
2398
+ * Create or edit Xperts in organization.
2399
+ */ AIPermissionsEnum["XPERT_EDIT"] = "XPERT_EDIT";
2280
2400
  AIPermissionsEnum["CHAT_VIEW"] = "CHAT_VIEW";
2281
2401
  })(AIPermissionsEnum || (AIPermissionsEnum = {}));
2282
2402
 
2283
- var XpertAgentExecutionStatusEnum;
2403
+ /**
2404
+ * Corresponds to the status of Run in [Agent Protocol](https://github.com/langchain-ai/agent-protocol).
2405
+ */ var XpertAgentExecutionStatusEnum;
2284
2406
  (function(XpertAgentExecutionStatusEnum) {
2285
2407
  XpertAgentExecutionStatusEnum["RUNNING"] = "running";
2286
2408
  XpertAgentExecutionStatusEnum["SUCCESS"] = "success";
@@ -2309,7 +2431,7 @@ var ToolParameterForm;
2309
2431
  var TOOL_NAME_REGEX = /^[a-zA-Z0-9_-]+$/;
2310
2432
  // Helper functions for tools
2311
2433
  /**
2312
- *
2434
+ *
2313
2435
  * @param tool Tool
2314
2436
  * @param disableToolDefault Is default disable tools
2315
2437
  * @returns Tool is enabled?
@@ -2326,7 +2448,7 @@ var TOOL_NAME_REGEX = /^[a-zA-Z0-9_-]+$/;
2326
2448
  }
2327
2449
  /**
2328
2450
  * Tool is enabled?
2329
- *
2451
+ *
2330
2452
  * @deprecated use isToolEnabled
2331
2453
  */ function isEnableTool(tool, toolset) {
2332
2454
  var disabled = tool.disabled;
@@ -2370,11 +2492,11 @@ var XpertToolsetCategoryEnum;
2370
2492
  XpertToolsetCategoryEnum["BUILTIN"] = "builtin";
2371
2493
  XpertToolsetCategoryEnum["API"] = "api";
2372
2494
  /**
2373
- * [Anthropic Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
2374
- */ XpertToolsetCategoryEnum["MCP"] = "mcp";
2495
+ * [Anthropic Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
2496
+ */ XpertToolsetCategoryEnum["MCP"] = "mcp";
2375
2497
  /**
2376
- * @deprecated
2377
- */ XpertToolsetCategoryEnum["WORKFLOW"] = "workflow";
2498
+ * @deprecated
2499
+ */ XpertToolsetCategoryEnum["WORKFLOW"] = "workflow";
2378
2500
  })(XpertToolsetCategoryEnum || (XpertToolsetCategoryEnum = {}));
2379
2501
  var CredentialsType;
2380
2502
  (function(CredentialsType) {
@@ -2390,8 +2512,8 @@ var CredentialsType;
2390
2512
  var ApiProviderSchemaType;
2391
2513
  (function(ApiProviderSchemaType) {
2392
2514
  /**
2393
- * Enum class for api provider schema type.
2394
- */ ApiProviderSchemaType["OPENAPI"] = "openapi";
2515
+ * Enum class for api provider schema type.
2516
+ */ ApiProviderSchemaType["OPENAPI"] = "openapi";
2395
2517
  ApiProviderSchemaType["SWAGGER"] = "swagger";
2396
2518
  ApiProviderSchemaType["OPENAI_PLUGIN"] = "openai_plugin";
2397
2519
  ApiProviderSchemaType["OPENAI_ACTIONS"] = "openai_actions";
@@ -2420,7 +2542,9 @@ var ToolTagEnum;
2420
2542
  ToolTagEnum["OTHER"] = "other";
2421
2543
  })(ToolTagEnum || (ToolTagEnum = {}));
2422
2544
 
2423
- var XpertTableStatus;
2545
+ /**
2546
+ * Table status
2547
+ */ var XpertTableStatus;
2424
2548
  (function(XpertTableStatus) {
2425
2549
  XpertTableStatus["DRAFT"] = "draft";
2426
2550
  XpertTableStatus["READY"] = "ready";
@@ -2446,6 +2570,7 @@ function genXpertDBSqlKey() {
2446
2570
  return letterStartSUID("DBSql_");
2447
2571
  }
2448
2572
 
2573
+ // Helpers
2449
2574
  function _array_like_to_array$4(arr, len) {
2450
2575
  if (len == null || len > arr.length) len = arr.length;
2451
2576
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -2454,12 +2579,59 @@ function _array_like_to_array$4(arr, len) {
2454
2579
  function _array_without_holes$1(arr) {
2455
2580
  if (Array.isArray(arr)) return _array_like_to_array$4(arr);
2456
2581
  }
2582
+ function _define_property$3(obj, key, value) {
2583
+ if (key in obj) {
2584
+ Object.defineProperty(obj, key, {
2585
+ value: value,
2586
+ enumerable: true,
2587
+ configurable: true,
2588
+ writable: true
2589
+ });
2590
+ } else {
2591
+ obj[key] = value;
2592
+ }
2593
+ return obj;
2594
+ }
2457
2595
  function _iterable_to_array$2(iter) {
2458
2596
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2459
2597
  }
2460
2598
  function _non_iterable_spread$1() {
2461
2599
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2462
2600
  }
2601
+ function _object_spread$2(target) {
2602
+ for(var i = 1; i < arguments.length; i++){
2603
+ var source = arguments[i] != null ? arguments[i] : {};
2604
+ var ownKeys = Object.keys(source);
2605
+ if (typeof Object.getOwnPropertySymbols === "function") {
2606
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
2607
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
2608
+ }));
2609
+ }
2610
+ ownKeys.forEach(function(key) {
2611
+ _define_property$3(target, key, source[key]);
2612
+ });
2613
+ }
2614
+ return target;
2615
+ }
2616
+ function ownKeys$2(object, enumerableOnly) {
2617
+ var keys = Object.keys(object);
2618
+ if (Object.getOwnPropertySymbols) {
2619
+ var symbols = Object.getOwnPropertySymbols(object);
2620
+ keys.push.apply(keys, symbols);
2621
+ }
2622
+ return keys;
2623
+ }
2624
+ function _object_spread_props$2(target, source) {
2625
+ source = source != null ? source : {};
2626
+ if (Object.getOwnPropertyDescriptors) {
2627
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2628
+ } else {
2629
+ ownKeys$2(Object(source)).forEach(function(key) {
2630
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2631
+ });
2632
+ }
2633
+ return target;
2634
+ }
2463
2635
  function _object_without_properties$1(source, excluded) {
2464
2636
  if (source == null) return {};
2465
2637
  var target = _object_without_properties_loose$1(source, excluded);
@@ -2498,10 +2670,9 @@ function _unsupported_iterable_to_array$4(o, minLen) {
2498
2670
  if (n === "Map" || n === "Set") return Array.from(n);
2499
2671
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
2500
2672
  }
2501
- // Helpers
2502
2673
  function omitXpertRelations(xpert) {
2503
2674
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2504
- 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, [
2675
+ 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, [
2505
2676
  "draft",
2506
2677
  "agent",
2507
2678
  "agents",
@@ -2512,16 +2683,16 @@ function omitXpertRelations(xpert) {
2512
2683
  "environment",
2513
2684
  "integrations",
2514
2685
  "toolsets",
2515
- "managers"
2686
+ "userGroups"
2516
2687
  ]);
2517
2688
  return rest;
2518
2689
  }
2519
2690
  /**
2520
2691
  * Figure out latest xpert or draft xpert.
2521
- *
2522
- * @param xpert
2692
+ *
2693
+ * @param xpert
2523
2694
  * @param isDraft Is draft
2524
- * @returns
2695
+ * @returns
2525
2696
  */ function figureOutXpert(xpert, isDraft) {
2526
2697
  var _xpert_draft;
2527
2698
  var _ref;
@@ -2553,8 +2724,7 @@ function locateNodes(nodes, position) {
2553
2724
  var _node_size;
2554
2725
  var _node_size_width;
2555
2726
  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);
2556
- }) // Node width min 240
2557
- ;
2727
+ }); // Node width min 240
2558
2728
  var y0Positions = positions.map(function(pos) {
2559
2729
  return pos.y;
2560
2730
  });
@@ -2562,8 +2732,7 @@ function locateNodes(nodes, position) {
2562
2732
  var _node_size;
2563
2733
  var _node_size_height;
2564
2734
  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);
2565
- }) // Node height min 70
2566
- ;
2735
+ }); // Node height min 70
2567
2736
  var xRange = {
2568
2737
  min: (_Math = Math).min.apply(_Math, _to_consumable_array$1(x0Positions)),
2569
2738
  max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array$1(x1Positions))
@@ -2681,8 +2850,7 @@ function locateNodes(nodes, position) {
2681
2850
  var _node_size;
2682
2851
  var _node_size_width;
2683
2852
  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);
2684
- }) // Node width min 240
2685
- ;
2853
+ }); // Node width min 240
2686
2854
  var y0Positions = positions.map(function(pos) {
2687
2855
  return pos.y;
2688
2856
  });
@@ -2690,8 +2858,7 @@ function locateNodes(nodes, position) {
2690
2858
  var _node_size;
2691
2859
  var _node_size_height;
2692
2860
  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);
2693
- }) // Node height min 70
2694
- ;
2861
+ }); // Node height min 70
2695
2862
  var xRange = {
2696
2863
  min: (_Math = Math).min.apply(_Math, _to_consumable_array$1(x0Positions)),
2697
2864
  max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array$1(x1Positions))
@@ -2769,16 +2936,65 @@ function createAgentConnections(agent, collaborators) {
2769
2936
  });
2770
2937
  return connections;
2771
2938
  }
2939
+ function replaceAgentInDraft(draft, sourceKey, agent, options) {
2940
+ var _draft_nodes, _draft_connections;
2941
+ var targetKey = agent === null || agent === void 0 ? void 0 : agent.key;
2942
+ if (!targetKey) {
2943
+ throw new Error("Target agent key is required");
2944
+ }
2945
+ var replacedNode = false;
2946
+ var nodes = (_draft_nodes = draft.nodes) === null || _draft_nodes === void 0 ? void 0 : _draft_nodes.map(function(node) {
2947
+ if (node.type === "agent" && node.key === sourceKey) {
2948
+ replacedNode = true;
2949
+ var _node_entity;
2950
+ return _object_spread_props$2(_object_spread$2({}, node), {
2951
+ key: targetKey,
2952
+ entity: _object_spread_props$2(_object_spread$2({}, (_node_entity = node.entity) !== null && _node_entity !== void 0 ? _node_entity : {}, agent), {
2953
+ key: targetKey
2954
+ })
2955
+ });
2956
+ }
2957
+ return node;
2958
+ });
2959
+ if (!replacedNode && (options === null || options === void 0 ? void 0 : options.requireNode) !== false) {
2960
+ throw new Error("Can't find agent for key: ".concat(sourceKey));
2961
+ }
2962
+ var connections = (_draft_connections = draft.connections) === null || _draft_connections === void 0 ? void 0 : _draft_connections.map(function(connection) {
2963
+ var from = connection.from === sourceKey ? targetKey : connection.from;
2964
+ var to = connection.to === sourceKey ? targetKey : connection.to;
2965
+ if (from === connection.from && to === connection.to) {
2966
+ return connection;
2967
+ }
2968
+ return _object_spread_props$2(_object_spread$2({}, connection), {
2969
+ from: from,
2970
+ to: to,
2971
+ key: "".concat(from, "/").concat(to)
2972
+ });
2973
+ });
2974
+ return _object_spread_props$2(_object_spread$2({}, draft), {
2975
+ team: draft.team ? _object_spread_props$2(_object_spread$2({}, draft.team), {
2976
+ agent: draft.team.agent ? _object_spread_props$2(_object_spread$2({}, draft.team.agent, agent), {
2977
+ key: targetKey
2978
+ }) : _object_spread_props$2(_object_spread$2({}, agent), {
2979
+ key: targetKey
2980
+ })
2981
+ }) : draft.team,
2982
+ nodes: nodes,
2983
+ connections: connections
2984
+ });
2985
+ }
2772
2986
 
2773
2987
  var ApiAuthType;
2774
2988
  (function(ApiAuthType) {
2775
2989
  /**
2776
- * Enum class for api provider auth type.
2777
- */ ApiAuthType["NONE"] = "none";
2990
+ * Enum class for api provider auth type.
2991
+ */ ApiAuthType["NONE"] = "none";
2778
2992
  ApiAuthType["API_KEY"] = "api_key";
2779
2993
  ApiAuthType["BASIC"] = "basic";
2780
2994
  })(ApiAuthType || (ApiAuthType = {}));
2781
- var EmbeddingStatusEnum;
2995
+ /**
2996
+ * Embedding status of an entity, such as an bi indicator or kb document.
2997
+ */ var EmbeddingStatusEnum;
2782
2998
  (function(EmbeddingStatusEnum) {
2783
2999
  EmbeddingStatusEnum["PROCESSING"] = "processing";
2784
3000
  EmbeddingStatusEnum["SUCCESS"] = "success";
@@ -2839,7 +3055,14 @@ var MCPServerType;
2839
3055
  MCPServerType["HTTP"] = "http";
2840
3056
  })(MCPServerType || (MCPServerType = {}));
2841
3057
 
2842
- function _define_property$2(obj, key, value) {
3058
+ /**
3059
+ * Build a hierarchical tree structure from a flat list of DocumentInterface objects,
3060
+ * and
3061
+ *
3062
+ * @template Metadata - Type of metadata, defaults to IDocChunkMetadata
3063
+ * @param documents - A flat array of DocumentInterface objects
3064
+ * @returns the hierarchical tree (root-level DocumentInterface[])
3065
+ */ function _define_property$2(obj, key, value) {
2843
3066
  if (key in obj) {
2844
3067
  Object.defineProperty(obj, key, {
2845
3068
  value: value,
@@ -2886,14 +3109,7 @@ function _object_spread_props$1(target, source) {
2886
3109
  }
2887
3110
  return target;
2888
3111
  }
2889
- /**
2890
- * Build a hierarchical tree structure from a flat list of DocumentInterface objects,
2891
- * and
2892
- *
2893
- * @template Metadata - Type of metadata, defaults to IDocChunkMetadata
2894
- * @param documents - A flat array of DocumentInterface objects
2895
- * @returns the hierarchical tree (root-level DocumentInterface[])
2896
- */ function buildChunkTree(documents) {
3112
+ function buildChunkTree(documents) {
2897
3113
  if (!documents || documents.length === 0) return [];
2898
3114
  // Step 1. Build a lookup map for quick access by chunkId
2899
3115
  var map = new Map();
@@ -2957,9 +3173,9 @@ function _object_spread_props$1(target, source) {
2957
3173
  }
2958
3174
  /**
2959
3175
  * Find all leaf nodes (nodes without children).
2960
- *
2961
- * @param roots
2962
- * @returns
3176
+ *
3177
+ * @param roots
3178
+ * @returns
2963
3179
  */ function collectTreeLeaves(roots) {
2964
3180
  var leaves = [];
2965
3181
  var collectLeaves = function(node) {
@@ -3047,6 +3263,12 @@ function getAgentMiddlewareNodes(graph, agentKey) {
3047
3263
  return middlewares;
3048
3264
  }
3049
3265
 
3266
+ var SANDBOX_WORK_FOR_TYPES = [
3267
+ "user",
3268
+ "project",
3269
+ "environment"
3270
+ ];
3271
+
3050
3272
  function _array_like_to_array$3(arr, len) {
3051
3273
  if (len == null || len > arr.length) len = arr.length;
3052
3274
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -3236,9 +3458,6 @@ function getSeparator(previousType, previousText, nextText, joinHint) {
3236
3458
  if (joinHint) {
3237
3459
  return mapJoinHint(joinHint);
3238
3460
  }
3239
- if (previousType === "component") {
3240
- return "\n\n";
3241
- }
3242
3461
  if (endsWithCodeFence(previousText)) {
3243
3462
  return "\n";
3244
3463
  }
@@ -3290,6 +3509,25 @@ function filterText(content) {
3290
3509
  }
3291
3510
  return "";
3292
3511
  }
3512
+ function mergeTextChunkForDisplay(previous, incoming) {
3513
+ return _object_spread(_object_spread_props(_object_spread({}, previous), {
3514
+ text: "".concat(previous.text).concat(incoming.text)
3515
+ }), !previous.id && incoming.id ? {
3516
+ id: incoming.id
3517
+ } : {}, !previous.agentKey && incoming.agentKey ? {
3518
+ agentKey: incoming.agentKey
3519
+ } : {}, !previous.xpertName && incoming.xpertName ? {
3520
+ xpertName: incoming.xpertName
3521
+ } : {});
3522
+ }
3523
+ function stripAutoDisplaySeparator(incoming, previousOriginal) {
3524
+ if ((previousOriginal === null || previousOriginal === void 0 ? void 0 : previousOriginal.type) === "component" && incoming.text.startsWith("\n\n")) {
3525
+ return _object_spread_props(_object_spread({}, incoming), {
3526
+ text: incoming.text.slice(1)
3527
+ });
3528
+ }
3529
+ return incoming;
3530
+ }
3293
3531
  function mergeComponentData(previous, incoming) {
3294
3532
  var _previous_data, _incoming_data;
3295
3533
  var _incoming_data1;
@@ -3365,7 +3603,7 @@ function resolveMessageAppendContext(options) {
3365
3603
  * - `previous` must be supplied by caller when same-stream join inference is needed.
3366
3604
  */ function appendMessageContent(aiMessage, incoming, context) {
3367
3605
  aiMessage.status = "answering";
3368
- var _ref = context !== null && context !== void 0 ? context : {}, previous = _ref.previous, contextWithoutPrevious = _object_without_properties(_ref, [
3606
+ var _ref = context !== null && context !== void 0 ? context : {}; _ref.previous; var contextWithoutPrevious = _object_without_properties(_ref, [
3369
3607
  "previous"
3370
3608
  ]);
3371
3609
  var resolvedContext = _object_spread({}, inferMessageAppendContext(incoming), contextWithoutPrevious);
@@ -3391,39 +3629,48 @@ function resolveMessageAppendContext(options) {
3391
3629
  }
3392
3630
  var chunks = ensureArrayContent(aiMessage.content);
3393
3631
  if (isTextContent(content)) {
3394
- var _resolvedContext_joinHint;
3395
- var joinHint = (_resolvedContext_joinHint = resolvedContext.joinHint) !== null && _resolvedContext_joinHint !== void 0 ? _resolvedContext_joinHint : shouldJoinWithoutSeparator(previous, resolvedContext) ? "none" : undefined;
3632
+ if (content.id) {
3633
+ var index = chunks.findIndex(function(item) {
3634
+ return isTextContent(item) && item.id === content.id;
3635
+ });
3636
+ if (index > -1) {
3637
+ var mergedContent = _object_spread(_object_spread_props(_object_spread({}, chunks[index]), {
3638
+ text: "".concat(chunks[index].text).concat(content.text)
3639
+ }), !chunks[index].id && content.id ? {
3640
+ id: content.id
3641
+ } : {}, !chunks[index].agentKey && content.agentKey ? {
3642
+ agentKey: content.agentKey
3643
+ } : {}, !chunks[index].xpertName && content.xpertName ? {
3644
+ xpertName: content.xpertName
3645
+ } : {});
3646
+ aiMessage.content = _to_consumable_array(chunks.slice(0, index)).concat([
3647
+ mergedContent
3648
+ ], _to_consumable_array(chunks.slice(index + 1)));
3649
+ return;
3650
+ }
3651
+ }
3396
3652
  var lastContent = chunks[chunks.length - 1];
3397
- if (isTextContent(lastContent) && (joinHint === "none" || !!content.id && !!lastContent.id && lastContent.id === content.id)) {
3398
- var mergedLastContent = _object_spread(_object_spread_props(_object_spread({}, lastContent), {
3653
+ if (isTextContent(lastContent) && !lastContent.id && !content.id) {
3654
+ var mergedLastContent = _object_spread_props(_object_spread({}, lastContent), {
3399
3655
  text: "".concat(lastContent.text).concat(content.text)
3400
- }), !lastContent.id && content.id ? {
3401
- id: content.id
3402
- } : {});
3656
+ });
3403
3657
  aiMessage.content = _to_consumable_array(chunks.slice(0, chunks.length - 1)).concat([
3404
3658
  mergedLastContent
3405
3659
  ]);
3406
3660
  return;
3407
3661
  }
3408
- var _lastContent_type;
3409
- var previousType = (_lastContent_type = lastContent === null || lastContent === void 0 ? void 0 : lastContent.type) !== null && _lastContent_type !== void 0 ? _lastContent_type : null;
3410
- var previousText = isTextContent(lastContent) ? lastContent.text : "";
3411
- var separator = getSeparator(previousType, previousText, content.text, joinHint);
3412
- var appended = _object_spread_props(_object_spread({}, content), {
3413
- text: separator + content.text
3414
- });
3415
3662
  aiMessage.content = _to_consumable_array(chunks).concat([
3416
- appended
3663
+ content
3417
3664
  ]);
3418
3665
  return;
3419
3666
  }
3420
3667
  var nextChunks = _to_consumable_array(chunks);
3421
3668
  if (isComponentContent(content) && content.id) {
3422
- var index = nextChunks.findIndex(function(item) {
3669
+ var index1 = nextChunks.findIndex(function(item) {
3423
3670
  return isComponentContent(item) && item.id === content.id;
3424
3671
  });
3425
- if (index > -1) {
3426
- nextChunks[index] = mergeComponentData(nextChunks[index], content);
3672
+ if (index1 > -1) {
3673
+ nextChunks[index1] = mergeComponentData(nextChunks[index1], content);
3427
3674
  } else {
3428
3675
  nextChunks.push(content);
3429
3676
  }
@@ -3442,6 +3689,54 @@ function appendMessagePlainText(accumulator, incoming, context) {
3442
3689
  var separator = getSeparator("text", previous, nextText, resolvedContext.joinHint);
3443
3690
  return previous + separator + nextText;
3444
3691
  }
3692
+ /**
3693
+ * Creates a display-only content view that reassembles text chunks belonging to
3694
+ * the same stream id. This preserves markdown continuity without changing the
3695
+ * underlying stored/streamed message structure.
3696
+ */ function mergeMessageContentForDisplay(content) {
3697
+ if (!content) {
3698
+ return null;
3699
+ }
3700
+ if (typeof content === "string") {
3701
+ return content.length ? [
3702
+ {
3703
+ type: "text",
3704
+ text: content
3705
+ }
3706
+ ] : null;
3707
+ }
3708
+ if (!Array.isArray(content)) {
3709
+ return [
3710
+ content
3711
+ ];
3712
+ }
3713
+ var merged = [];
3714
+ var textIndexById = new Map();
3715
+ content.forEach(function(item, itemIndex) {
3716
+ if (!isTextContent(item)) {
3717
+ merged.push(item);
3718
+ return;
3719
+ }
3720
+ if (item.id) {
3721
+ var mergedIndex = textIndexById.get(item.id);
3722
+ if (mergedIndex !== undefined && isTextContent(merged[mergedIndex])) {
3723
+ var previousOriginal = content[itemIndex - 1];
3724
+ merged[mergedIndex] = mergeTextChunkForDisplay(merged[mergedIndex], stripAutoDisplaySeparator(item, previousOriginal));
3725
+ return;
3726
+ }
3727
+ textIndexById.set(item.id, merged.length);
3728
+ merged.push(_object_spread({}, item));
3729
+ return;
3730
+ }
3731
+ var lastItem = merged[merged.length - 1];
3732
+ if (isTextContent(lastItem) && !lastItem.id && lastItem.agentKey === item.agentKey && lastItem.xpertName === item.xpertName) {
3733
+ merged[merged.length - 1] = mergeTextChunkForDisplay(lastItem, item);
3734
+ return;
3735
+ }
3736
+ merged.push(_object_spread({}, item));
3737
+ });
3738
+ return merged.length ? merged : null;
3739
+ }
3445
3740
  function stringifyMessageContent(content) {
3446
3741
  if (typeof content === "string") {
3447
3742
  return content;
@@ -3485,6 +3780,45 @@ function filterMessageText(content) {
3485
3780
  return filterText(content) || null;
3486
3781
  }
3487
3782
 
3783
+ var STATE_VARIABLE_HUMAN = "human";
3784
+ var ChatMessageTypeEnum;
3785
+ (function(ChatMessageTypeEnum) {
3786
+ ChatMessageTypeEnum["MESSAGE"] = "message";
3787
+ ChatMessageTypeEnum["EVENT"] = "event";
3788
+ })(ChatMessageTypeEnum || (ChatMessageTypeEnum = {}));
3789
+ var ChatMessageEventTypeEnum;
3790
+ (function(ChatMessageEventTypeEnum) {
3791
+ ChatMessageEventTypeEnum["ON_CONVERSATION_START"] = "on_conversation_start";
3792
+ ChatMessageEventTypeEnum["ON_CONVERSATION_END"] = "on_conversation_end";
3793
+ ChatMessageEventTypeEnum["ON_MESSAGE_START"] = "on_message_start";
3794
+ ChatMessageEventTypeEnum["ON_MESSAGE_END"] = "on_message_end";
3795
+ ChatMessageEventTypeEnum["ON_TOOL_START"] = "on_tool_start";
3796
+ ChatMessageEventTypeEnum["ON_TOOL_END"] = "on_tool_end";
3797
+ ChatMessageEventTypeEnum["ON_TOOL_ERROR"] = "on_tool_error";
3798
+ ChatMessageEventTypeEnum["ON_TOOL_MESSAGE"] = "on_tool_message";
3799
+ ChatMessageEventTypeEnum["ON_AGENT_START"] = "on_agent_start";
3800
+ ChatMessageEventTypeEnum["ON_AGENT_END"] = "on_agent_end";
3801
+ ChatMessageEventTypeEnum["ON_RETRIEVER_START"] = "on_retriever_start";
3802
+ ChatMessageEventTypeEnum["ON_RETRIEVER_END"] = "on_retriever_end";
3803
+ ChatMessageEventTypeEnum["ON_RETRIEVER_ERROR"] = "on_retriever_error";
3804
+ ChatMessageEventTypeEnum["ON_INTERRUPT"] = "on_interrupt";
3805
+ ChatMessageEventTypeEnum["ON_ERROR"] = "on_error";
3806
+ ChatMessageEventTypeEnum["ON_CHAT_EVENT"] = "on_chat_event";
3807
+ ChatMessageEventTypeEnum["ON_CLIENT_EFFECT"] = "on_client_effect";
3808
+ })(ChatMessageEventTypeEnum || (ChatMessageEventTypeEnum = {}));
3809
+ var ChatMessageStepCategory;
3810
+ (function(ChatMessageStepCategory) {
3811
+ ChatMessageStepCategory["List"] = "list";
3812
+ ChatMessageStepCategory["WebSearch"] = "web_search";
3813
+ ChatMessageStepCategory["Files"] = "files";
3814
+ ChatMessageStepCategory["File"] = "file";
3815
+ ChatMessageStepCategory["Program"] = "program";
3816
+ ChatMessageStepCategory["Iframe"] = "iframe";
3817
+ ChatMessageStepCategory["Memory"] = "memory";
3818
+ ChatMessageStepCategory["Tasks"] = "tasks";
3819
+ ChatMessageStepCategory["Knowledges"] = "knowledges";
3820
+ })(ChatMessageStepCategory || (ChatMessageStepCategory = {}));
3821
+
3488
3822
  var PermissionsEnum;
3489
3823
  (function(PermissionsEnum) {
3490
3824
  PermissionsEnum["PROFILE_EDIT"] = "PROFILE_EDIT";
@@ -3522,14 +3856,17 @@ var PermissionsEnum;
3522
3856
  var PermissionGroups = {
3523
3857
  //Permissions which can be given to any role
3524
3858
  GENERAL: [
3525
- "PROFILE_EDIT",
3526
- "ADMIN_DASHBOARD_VIEW",
3527
- "ORG_INVITE_VIEW",
3528
- "ORG_INVITE_EDIT",
3529
- "VIEW_ALL_EMAILS",
3530
- "VIEW_ALL_EMAIL_TEMPLATES",
3531
- "INTEGRATION_EDIT",
3532
- "ORG_DEMO_EDIT",
3859
+ PermissionsEnum.PROFILE_EDIT,
3860
+ PermissionsEnum.ADMIN_DASHBOARD_VIEW,
3861
+ PermissionsEnum.ORG_INVITE_VIEW,
3862
+ PermissionsEnum.ORG_INVITE_EDIT,
3863
+ // PermissionsEnum.ORG_TAGS_EDIT,
3864
+ PermissionsEnum.VIEW_ALL_EMAILS,
3865
+ PermissionsEnum.VIEW_ALL_EMAIL_TEMPLATES,
3866
+ // PermissionsEnum.ORG_HELP_CENTER_EDIT,
3867
+ PermissionsEnum.INTEGRATION_EDIT,
3868
+ // PermissionsEnum.ORG_CONTACT_VIEW,
3869
+ PermissionsEnum.ORG_DEMO_EDIT,
3533
3870
  // PermissionsEnum.VIEW_ALL_ACCOUNTING_TEMPLATES,
3534
3871
  // AI
3535
3872
  AIPermissionsEnum.KNOWLEDGEBASE_EDIT,
@@ -3561,16 +3898,16 @@ var PermissionGroups = {
3561
3898
  ],
3562
3899
  //Readonly permissions, are only enabled for admin role
3563
3900
  ADMINISTRATION: [
3564
- "ORG_USERS_VIEW",
3565
- "ORG_USERS_EDIT",
3566
- "ALL_ORG_VIEW",
3567
- "ALL_ORG_EDIT",
3568
- "CHANGE_SELECTED_ORGANIZATION",
3569
- "CHANGE_ROLES_PERMISSIONS",
3570
- "SUPER_ADMIN_EDIT",
3571
- "INTEGRATION_VIEW",
3572
- "ACCESS_DELETE_ACCOUNT",
3573
- "ACCESS_DELETE_ALL_DATA"
3901
+ PermissionsEnum.ORG_USERS_VIEW,
3902
+ PermissionsEnum.ORG_USERS_EDIT,
3903
+ PermissionsEnum.ALL_ORG_VIEW,
3904
+ PermissionsEnum.ALL_ORG_EDIT,
3905
+ PermissionsEnum.CHANGE_SELECTED_ORGANIZATION,
3906
+ PermissionsEnum.CHANGE_ROLES_PERMISSIONS,
3907
+ PermissionsEnum.SUPER_ADMIN_EDIT,
3908
+ PermissionsEnum.INTEGRATION_VIEW,
3909
+ PermissionsEnum.ACCESS_DELETE_ACCOUNT,
3910
+ PermissionsEnum.ACCESS_DELETE_ALL_DATA
3574
3911
  ]
3575
3912
  };
3576
3913
 
@@ -3596,21 +3933,29 @@ var RolesEnum;
3596
3933
  (function(RolesEnum) {
3597
3934
  RolesEnum["SUPER_ADMIN"] = "SUPER_ADMIN";
3598
3935
  RolesEnum["ADMIN"] = "ADMIN";
3599
- RolesEnum["DATA_ENTRY"] = "DATA_ENTRY";
3600
- RolesEnum["EMPLOYEE"] = "EMPLOYEE";
3601
- RolesEnum["CANDIDATE"] = "CANDIDATE";
3602
- RolesEnum["MANAGER"] = "MANAGER";
3936
+ RolesEnum["AI_BUILDER"] = "AI_BUILDER";
3937
+ RolesEnum["ANALYTICS_BUILDER"] = "ANALYTICS_BUILDER";
3603
3938
  RolesEnum["VIEWER"] = "VIEWER";
3604
- // 有所免费用户
3939
+ // Trial account
3605
3940
  RolesEnum["TRIAL"] = "TRIAL";
3606
3941
  })(RolesEnum || (RolesEnum = {}));
3942
+ var DEFAULT_SYSTEM_ROLES = [
3943
+ RolesEnum.SUPER_ADMIN,
3944
+ RolesEnum.ADMIN,
3945
+ RolesEnum.TRIAL,
3946
+ RolesEnum.AI_BUILDER,
3947
+ RolesEnum.ANALYTICS_BUILDER,
3948
+ RolesEnum.VIEWER
3949
+ ];
3607
3950
 
3608
3951
  var UserType;
3609
3952
  (function(UserType) {
3610
3953
  UserType["USER"] = "user";
3611
3954
  UserType["COMMUNICATION"] = "communication";
3612
3955
  })(UserType || (UserType = {}));
3613
- var LanguagesEnum;
3956
+ /**
3957
+ * Browser http header `Language`
3958
+ */ var LanguagesEnum;
3614
3959
  (function(LanguagesEnum) {
3615
3960
  LanguagesEnum["Chinese"] = "zh-CN";
3616
3961
  LanguagesEnum["SimplifiedChinese"] = "zh-Hans";
@@ -3618,23 +3963,29 @@ var LanguagesEnum;
3618
3963
  LanguagesEnum["English"] = "en";
3619
3964
  })(LanguagesEnum || (LanguagesEnum = {}));
3620
3965
  var LanguagesMap = {
3621
- "zh-CN": "zh-Hans",
3622
- "zh-Hans": "zh-Hans",
3623
- "zh": "zh-Hans"
3966
+ "zh-CN": LanguagesEnum.SimplifiedChinese,
3967
+ "zh-Hans": LanguagesEnum.SimplifiedChinese,
3968
+ "zh": LanguagesEnum.SimplifiedChinese
3624
3969
  };
3970
+ // export enum ComponentLayoutStyleEnum {
3971
+ // CARDS_GRID = 'CARDS_GRID',
3972
+ // TABLE = 'TABLE'
3973
+ // }
3625
3974
  var ProviderEnum;
3626
3975
  (function(ProviderEnum) {
3627
3976
  ProviderEnum["GOOGLE"] = "google";
3628
3977
  ProviderEnum["FACEBOOK"] = "facebook";
3629
3978
  })(ProviderEnum || (ProviderEnum = {}));
3630
3979
 
3631
- /* eslint-disable @typescript-eslint/no-empty-interface */ var SMTPSecureEnum;
3980
+ var SMTPSecureEnum;
3632
3981
  (function(SMTPSecureEnum) {
3633
3982
  SMTPSecureEnum["TRUE"] = "True";
3634
3983
  SMTPSecureEnum["FALSE"] = "False";
3635
3984
  })(SMTPSecureEnum || (SMTPSecureEnum = {}));
3636
3985
 
3637
- var IntegrationEnum;
3986
+ /**
3987
+ * @deprecated use Plugins instead
3988
+ */ var IntegrationEnum;
3638
3989
  (function(IntegrationEnum) {
3639
3990
  IntegrationEnum["UPWORK"] = "Upwork";
3640
3991
  IntegrationEnum["HUBSTAFF"] = "Hubstaff";
@@ -3662,15 +4013,15 @@ var IntegrationFilterEnum;
3662
4013
  })(IntegrationFilterEnum || (IntegrationFilterEnum = {}));
3663
4014
  var DEFAULT_INTEGRATION_PAID_FILTERS = [
3664
4015
  {
3665
- label: "All",
4016
+ label: IntegrationFilterEnum.ALL,
3666
4017
  value: "all"
3667
4018
  },
3668
4019
  {
3669
- label: "Free",
4020
+ label: IntegrationFilterEnum.FREE,
3670
4021
  value: "false"
3671
4022
  },
3672
4023
  {
3673
- label: "Paid",
4024
+ label: IntegrationFilterEnum.PAID,
3674
4025
  value: "true"
3675
4026
  }
3676
4027
  ];
@@ -3714,6 +4065,12 @@ var Visibility;
3714
4065
  Visibility["Private"] = "private";
3715
4066
  })(Visibility || (Visibility = {}));
3716
4067
 
4068
+ var RequestScopeLevel;
4069
+ (function(RequestScopeLevel) {
4070
+ RequestScopeLevel["TENANT"] = "tenant";
4071
+ RequestScopeLevel["ORGANIZATION"] = "organization";
4072
+ })(RequestScopeLevel || (RequestScopeLevel = {}));
4073
+
3717
4074
  var IntegrationDingTalkProvider = {
3718
4075
  name: IntegrationEnum.DINGTALK,
3719
4076
  label: {
@@ -4043,10 +4400,10 @@ function findStartNodes(graph, key) {
4043
4400
  }
4044
4401
  /**
4045
4402
  * Keep the content in the same graph as the key node (including the node, its connected nodes, and the 'edge' type connections between them)
4046
- *
4047
- * @param graph
4048
- * @param key
4049
- * @returns
4403
+ *
4404
+ * @param graph
4405
+ * @param key
4406
+ * @returns
4050
4407
  */ function getCurrentGraph(graph, key) {
4051
4408
  var validConnections = graph.connections.filter(function(conn) {
4052
4409
  return conn.type === "edge";
@@ -4167,13 +4524,13 @@ function _unsupported_iterable_to_array$1(o, minLen) {
4167
4524
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
4168
4525
  }
4169
4526
  /**
4170
- *
4527
+ *
4171
4528
  * Returns the variable schema for a given variable name.
4172
4529
  * The variable name can be in the format of 'groupName.variableName' or just 'variableName'.
4173
- *
4174
- * @param variables
4175
- * @param variable
4176
- * @returns
4530
+ *
4531
+ * @param variables
4532
+ * @param variable
4533
+ * @returns
4177
4534
  */ function getVariableSchema(variables, variable) {
4178
4535
  var _variable_split;
4179
4536
  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);
@@ -4236,6 +4593,22 @@ function isInterruptMessage(obj) {
4236
4593
  return obj && typeof obj === "object" && "type" in obj && "category" in obj;
4237
4594
  }
4238
4595
 
4596
+ /**
4597
+ * Optional request header used by third-party callers to explicitly set the
4598
+ * business user represented by the current request context.
4599
+ */ var API_PRINCIPAL_USER_ID_HEADER = "x-principal-user-id";
4600
+ /**
4601
+ * Stable binding kinds used to resolve long-lived technical principals.
4602
+ */ var ApiKeyBindingType;
4603
+ (function(ApiKeyBindingType) {
4604
+ ApiKeyBindingType["ASSISTANT"] = "assistant";
4605
+ ApiKeyBindingType["INTEGRATION"] = "integration";
4606
+ ApiKeyBindingType["CLIENT"] = "client";
4607
+ /**
4608
+ * @deprecated legacy type, do not use for new keys. Will be resolved as assistant for backward compatibility.
4609
+ */ ApiKeyBindingType["KNOWLEDGEBASE"] = "knowledgebase";
4610
+ })(ApiKeyBindingType || (ApiKeyBindingType = {}));
4611
+
4239
4612
  function _array_like_to_array(arr, len) {
4240
4613
  if (len == null || len > arr.length) len = arr.length;
4241
4614
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -4298,9 +4671,9 @@ var TaskFrequency;
4298
4671
  })(TaskFrequency || (TaskFrequency = {}));
4299
4672
  /**
4300
4673
  * Generate cron expression: Minutes Hour Day Month Week
4301
- *
4302
- * @param schedule
4303
- * @returns
4674
+ *
4675
+ * @param schedule
4676
+ * @returns
4304
4677
  */ function generateCronExpression(schedule) {
4305
4678
  if (!schedule.time) throw new Error("Time is required for scheduling");
4306
4679
  var _schedule_time_split = _sliced_to_array(schedule.time.split(":"), 2), hourStr = _schedule_time_split[0], minuteStr = _schedule_time_split[1];
@@ -4310,22 +4683,22 @@ var TaskFrequency;
4310
4683
  throw new Error("Invalid time format. Expected HH:mm with valid hour and minute.");
4311
4684
  }
4312
4685
  switch(schedule.frequency){
4313
- case "Once":
4686
+ case TaskFrequency.Once:
4314
4687
  {
4315
4688
  if (!schedule.date) throw new Error("Date is required for Once schedule");
4316
4689
  var date = new Date(schedule.date);
4317
4690
  // if (isNaN(date.getTime())) throw new Error('Invalid date format for Once schedule');
4318
4691
  return "".concat(minute, " ").concat(hour, " ").concat(date.getDate(), " ").concat(date.getMonth() + 1, " *");
4319
4692
  }
4320
- case "Daily":
4693
+ case TaskFrequency.Daily:
4321
4694
  return "".concat(minute, " ").concat(hour, " * * *");
4322
- case "Weekly":
4695
+ case TaskFrequency.Weekly:
4323
4696
  if (schedule.dayOfWeek === undefined || schedule.dayOfWeek < 0 || schedule.dayOfWeek > 6) throw new Error("Valid dayOfWeek (0-6) is required for Weekly schedule");
4324
4697
  return "".concat(minute, " ").concat(hour, " * * ").concat(schedule.dayOfWeek);
4325
- case "Monthly":
4698
+ case TaskFrequency.Monthly:
4326
4699
  if (!schedule.dayOfMonth || schedule.dayOfMonth < 1 || schedule.dayOfMonth > 31) throw new Error("Valid dayOfMonth (1-31) is required for Monthly schedule");
4327
4700
  return "".concat(minute, " ").concat(hour, " ").concat(schedule.dayOfMonth, " * *");
4328
- case "Yearly":
4701
+ case TaskFrequency.Yearly:
4329
4702
  {
4330
4703
  if (!schedule.date) throw new Error("Date is required for Yearly schedule");
4331
4704
  var date1 = new Date(schedule.date);
@@ -4348,5 +4721,22 @@ var PLUGIN_LEVEL = {
4348
4721
  SYSTEM: "system",
4349
4722
  ORGANIZATION: "organization"
4350
4723
  };
4724
+ var PLUGIN_SOURCE = {
4725
+ MARKETPLACE: "marketplace",
4726
+ LOCAL: "local",
4727
+ GIT: "git",
4728
+ URL: "url",
4729
+ NPM: "npm",
4730
+ CODE: "code",
4731
+ ENV: "env"
4732
+ };
4733
+ var PLUGIN_CONFIGURATION_STATUS = {
4734
+ VALID: "valid",
4735
+ INVALID: "invalid"
4736
+ };
4737
+ var PLUGIN_LOAD_STATUS = {
4738
+ LOADED: "loaded",
4739
+ FAILED: "failed"
4740
+ };
4351
4741
 
4352
- 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 };
4742
+ export { AIPermissionsEnum, AI_MODEL_TYPE_VARIABLE, API_PRINCIPAL_USER_ID_HEADER, AccessEnum, AgentEventType, AgentType, AiBusinessRole, AiFeatureEnum, AiModelTypeEnum, AiProtocol, AiProvider, AiProviderRole, AlignmentOptions, AnalyticsFeatures, AnalyticsPermissionsEnum, ApiAuthType, ApiKeyBindingType, ApiProviderSchemaType, ApprovalPolicyTypesEnum, ApprovalPolicyTypesStringEnum, AssistantBindingScope, AssistantBindingSourceScope, AssistantCode, Attachment_Type_Options, AuthenticationEnum, BIInterruptMessageType, BonusTypeEnum, BusinessAreaRole, BusinessType, CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY, CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE, CONTEXT_VARIABLE_CURRENTSTATE, ChatDashboardMessageType, ChatGatewayEvent, ChatMessageEventTypeEnum, ChatMessageFeedbackRatingEnum, ChatMessageStepCategory, ChatMessageTypeEnum, 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_SYSTEM_ROLES, 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_CONFIGURATION_STATUS, PLUGIN_LEVEL, PLUGIN_LOAD_STATUS, PLUGIN_SOURCE, ParameterType, ParameterTypeEnum, PayPeriodEnum, PermissionApprovalStatus, PermissionApprovalStatusTypesEnum, PermissionGroups, PermissionsEnum, PriceType, ProjectBillingEnum, ProjectOwnerEnum, ProjectStatusEnum, ProviderEnum, ProviderType, QueryStatusEnum, RegionsEnum, RequestMethodEnum, RequestScopeLevel, RoleTypeEnum, RolesEnum, SANDBOX_WORK_FOR_TYPES, SMTPSecureEnum, STANDARD_METADATA_FIELDS, STATE_SYS_VOLUME, STATE_SYS_WORKSPACE_PATH, STATE_SYS_WORKSPACE_URL, STATE_VARIABLE_FILES, STATE_VARIABLE_HUMAN, 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, createConversationTitleSummaryEvent, 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, getAssistantManagement, getCurrentGraph, getEnabledTools, getStoreNamespace, getSwarmPartners, getToolCallFromConfig, getToolCallIdFromConfig, getToolLabel, getVariableSchema, getWorkflowTriggers, getWorkspaceFromRunnable, inferMessageAppendContext, isAgentKey, isAudioType, isDocumentSheet, isEnableTool, isImageType, isInterruptMessage, isIteratingKey, isIteratorKey, isMessageGroup, isMiddlewareToolEnabled, isRouterKey, isSystemManagedAssistant, isToolEnabled, isUserManagedAssistant, isVideoType, isXpertNodeType, letterStartSUID, locateNodes, mapTranslationLanguage, mergeMessageContentForDisplay, messageContentText, omitXpertRelations, replaceAgentInDraft, resolveMessageAppendContext, setStateVariable, shortTitle, stringifyMessageContent, transformInstallation, uuid, workflowNodeIdentifier, xpertLabel };