@xpert-ai/contracts 3.9.4 → 3.9.8

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
@@ -2,6 +2,91 @@
2
2
 
3
3
  var ShortUniqueId = require('short-unique-id');
4
4
 
5
+ function resolveI18nText(value) {
6
+ var language = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "en-US";
7
+ if (typeof value === "string") {
8
+ var trimmed = value.trim();
9
+ return trimmed || null;
10
+ }
11
+ if (!value || typeof value !== "object") {
12
+ return null;
13
+ }
14
+ var localized = value;
15
+ var normalizedLanguage = language.trim();
16
+ var underscoredLanguage = normalizedLanguage.replace(/-/g, "_");
17
+ var languagePrefix = normalizedLanguage.split(/[-_]/)[0];
18
+ var preferredKeys = normalizedLanguage.toLowerCase().startsWith("zh") ? [
19
+ normalizedLanguage,
20
+ underscoredLanguage,
21
+ "zh_Hans",
22
+ "zh-Hans",
23
+ "zh_CN",
24
+ "zh-CN",
25
+ "zh",
26
+ "en_US",
27
+ "en-US",
28
+ "en"
29
+ ] : [
30
+ normalizedLanguage,
31
+ underscoredLanguage,
32
+ "en_US",
33
+ "en-US",
34
+ "en",
35
+ languagePrefix,
36
+ "zh_Hans",
37
+ "zh-Hans",
38
+ "zh_CN",
39
+ "zh-CN",
40
+ "zh"
41
+ ];
42
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
43
+ try {
44
+ for(var _iterator = preferredKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
45
+ var key = _step.value;
46
+ var candidate = localized[key];
47
+ if (typeof candidate === "string" && candidate.trim()) {
48
+ return candidate.trim();
49
+ }
50
+ }
51
+ } catch (err) {
52
+ _didIteratorError = true;
53
+ _iteratorError = err;
54
+ } finally{
55
+ try {
56
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
57
+ _iterator.return();
58
+ }
59
+ } finally{
60
+ if (_didIteratorError) {
61
+ throw _iteratorError;
62
+ }
63
+ }
64
+ }
65
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
66
+ try {
67
+ for(var _iterator1 = Object.values(localized)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
68
+ var candidate1 = _step1.value;
69
+ if (typeof candidate1 === "string" && candidate1.trim()) {
70
+ return candidate1.trim();
71
+ }
72
+ }
73
+ } catch (err) {
74
+ _didIteratorError1 = true;
75
+ _iteratorError1 = err;
76
+ } finally{
77
+ try {
78
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
79
+ _iterator1.return();
80
+ }
81
+ } finally{
82
+ if (_didIteratorError1) {
83
+ throw _iteratorError1;
84
+ }
85
+ }
86
+ }
87
+ return null;
88
+ }
89
+
5
90
  function _array_like_to_array$7(arr, len) {
6
91
  if (len == null || len > arr.length) len = arr.length;
7
92
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -1028,7 +1113,9 @@ exports.AnalyticsFeatures = void 0;
1028
1113
  AnalyticsFeatures["FEATURE_INDICATOR"] = "FEATURE_INDICATOR";
1029
1114
  AnalyticsFeatures["FEATURE_INDICATOR_MARKET"] = "FEATURE_INDICATOR_MARKET";
1030
1115
  AnalyticsFeatures["FEATURE_INDICATOR_REGISTER"] = "FEATURE_INDICATOR_REGISTER";
1031
- AnalyticsFeatures["FEATURE_INDICATOR_APP"] = "FEATURE_INDICATOR_APP";
1116
+ /**
1117
+ * @deprecated Indicator App is no longer exposed in the system menu.
1118
+ */ AnalyticsFeatures["FEATURE_INDICATOR_APP"] = "FEATURE_INDICATOR_APP";
1032
1119
  AnalyticsFeatures["FEATURE_STORY"] = "FEATURE_STORY";
1033
1120
  AnalyticsFeatures["FEATURE_STORY_CREATION"] = "FEATURE_STORY_CREATION";
1034
1121
  AnalyticsFeatures["FEATURE_STORY_VIEWER"] = "FEATURE_STORY_VIEWER";
@@ -1143,7 +1230,9 @@ exports.AnalyticsPermissionsEnum = void 0;
1143
1230
  AnalyticsPermissionsEnum["BUSINESS_AREA_EDIT"] = "BUSINESS_AREA_EDIT";
1144
1231
  // Indicator
1145
1232
  AnalyticsPermissionsEnum["INDICATOR_VIEW"] = "INDICATOR_VIEW";
1146
- AnalyticsPermissionsEnum["INDICATOR_MARTKET_VIEW"] = "INDICATOR_MARTKET_VIEW";
1233
+ /**
1234
+ * @deprecated Indicator App is no longer exposed in the system menu.
1235
+ */ AnalyticsPermissionsEnum["INDICATOR_MARTKET_VIEW"] = "INDICATOR_MARTKET_VIEW";
1147
1236
  AnalyticsPermissionsEnum["INDICATOR_EDIT"] = "INDICATOR_EDIT";
1148
1237
  // Data Factory
1149
1238
  AnalyticsPermissionsEnum["DATA_FACTORY_VIEW"] = "DATA_FACTORY_VIEW";
@@ -1340,6 +1429,121 @@ exports.QueryStatusEnum = void 0;
1340
1429
  QueryStatusEnum["FAILED"] = "failed";
1341
1430
  })(exports.QueryStatusEnum || (exports.QueryStatusEnum = {}));
1342
1431
 
1432
+ /**
1433
+ * Business roles for AI copilot (commands or contexts)
1434
+ */ exports.AiBusinessRole = void 0;
1435
+ (function(AiBusinessRole) {
1436
+ AiBusinessRole["FinanceBP"] = "finance_bp";
1437
+ AiBusinessRole["SupplyChainExpert"] = "supply_chain_expert";
1438
+ })(exports.AiBusinessRole || (exports.AiBusinessRole = {}));
1439
+ /**
1440
+ * Providers for LLMs
1441
+ *
1442
+ * - https://js.langchain.com/docs/integrations/chat/
1443
+ */ exports.AiProvider = void 0;
1444
+ (function(AiProvider) {
1445
+ /**
1446
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1447
+ */ AiProvider["OpenAI"] = "openai";
1448
+ /**
1449
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1450
+ */ AiProvider["Azure"] = "azure";
1451
+ // DashScope = 'dashscope',
1452
+ /**
1453
+ * - https://ollama.com/
1454
+ * - https://js.langchain.com/docs/integrations/chat/ollama/
1455
+ */ AiProvider["Ollama"] = "ollama";
1456
+ /**
1457
+ * - https://www.deepseek.com/zh
1458
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1459
+ */ AiProvider["DeepSeek"] = "deepseek";
1460
+ /**
1461
+ * - https://docs.anthropic.com/en/home
1462
+ * - https://js.langchain.com/docs/integrations/chat/anthropic/
1463
+ */ AiProvider["Anthropic"] = "anthropic";
1464
+ /**
1465
+ * - https://www.aliyun.com/product/bailian
1466
+ * - https://js.langchain.com/docs/integrations/chat/alibaba_tongyi/
1467
+ */ AiProvider["AlibabaTongyi"] = "alibaba_tongyi";
1468
+ /**
1469
+ * - https://open.bigmodel.cn/
1470
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1471
+ */ AiProvider["Zhipu"] = "zhipu";
1472
+ /**
1473
+ * - https://qianfan.cloud.baidu.com/
1474
+ * - https://js.langchain.com/docs/integrations/chat/baidu_qianfan/
1475
+ */ AiProvider["BaiduQianfan"] = "baidu_qianfan";
1476
+ /**
1477
+ * - https://www.together.ai/
1478
+ * - https://js.langchain.com/docs/integrations/chat/togetherai/
1479
+ */ AiProvider["Together"] = "together";
1480
+ /**
1481
+ * - https://platform.moonshot.cn/console
1482
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1483
+ */ AiProvider["Moonshot"] = "moonshot";
1484
+ /**
1485
+ * - https://groq.com/
1486
+ * - https://js.langchain.com/docs/integrations/chat/openai/
1487
+ */ AiProvider["Groq"] = "groq";
1488
+ /**
1489
+ * - https://mistral.ai/
1490
+ *
1491
+ */ AiProvider["Mistral"] = "mistral";
1492
+ /**
1493
+ * - https://cohere.com/
1494
+ */ AiProvider["Cohere"] = "cohere";
1495
+ })(exports.AiProvider || (exports.AiProvider = {}));
1496
+ exports.AiProtocol = void 0;
1497
+ (function(AiProtocol) {
1498
+ AiProtocol["OpenAI"] = "openai";
1499
+ AiProtocol["Others"] = "others";
1500
+ })(exports.AiProtocol || (exports.AiProtocol = {}));
1501
+ var OpenAIEmbeddingsProviders = [
1502
+ exports.AiProvider.OpenAI,
1503
+ exports.AiProvider.Azure,
1504
+ exports.AiProvider.DeepSeek
1505
+ ];
1506
+ var OllamaEmbeddingsProviders = [
1507
+ exports.AiProvider.Ollama
1508
+ ];
1509
+ exports.ChatMessageTypeEnum = void 0;
1510
+ (function(ChatMessageTypeEnum) {
1511
+ ChatMessageTypeEnum["MESSAGE"] = "message";
1512
+ ChatMessageTypeEnum["EVENT"] = "event";
1513
+ })(exports.ChatMessageTypeEnum || (exports.ChatMessageTypeEnum = {}));
1514
+ exports.ChatMessageEventTypeEnum = void 0;
1515
+ (function(ChatMessageEventTypeEnum) {
1516
+ ChatMessageEventTypeEnum["ON_CONVERSATION_START"] = "on_conversation_start";
1517
+ ChatMessageEventTypeEnum["ON_CONVERSATION_END"] = "on_conversation_end";
1518
+ ChatMessageEventTypeEnum["ON_MESSAGE_START"] = "on_message_start";
1519
+ ChatMessageEventTypeEnum["ON_MESSAGE_END"] = "on_message_end";
1520
+ ChatMessageEventTypeEnum["ON_TOOL_START"] = "on_tool_start";
1521
+ ChatMessageEventTypeEnum["ON_TOOL_END"] = "on_tool_end";
1522
+ ChatMessageEventTypeEnum["ON_TOOL_ERROR"] = "on_tool_error";
1523
+ ChatMessageEventTypeEnum["ON_TOOL_MESSAGE"] = "on_tool_message";
1524
+ ChatMessageEventTypeEnum["ON_AGENT_START"] = "on_agent_start";
1525
+ ChatMessageEventTypeEnum["ON_AGENT_END"] = "on_agent_end";
1526
+ ChatMessageEventTypeEnum["ON_RETRIEVER_START"] = "on_retriever_start";
1527
+ ChatMessageEventTypeEnum["ON_RETRIEVER_END"] = "on_retriever_end";
1528
+ ChatMessageEventTypeEnum["ON_RETRIEVER_ERROR"] = "on_retriever_error";
1529
+ ChatMessageEventTypeEnum["ON_INTERRUPT"] = "on_interrupt";
1530
+ ChatMessageEventTypeEnum["ON_ERROR"] = "on_error";
1531
+ ChatMessageEventTypeEnum["ON_CHAT_EVENT"] = "on_chat_event";
1532
+ ChatMessageEventTypeEnum["ON_CLIENT_EFFECT"] = "on_client_effect";
1533
+ })(exports.ChatMessageEventTypeEnum || (exports.ChatMessageEventTypeEnum = {}));
1534
+ exports.ChatMessageStepCategory = void 0;
1535
+ (function(ChatMessageStepCategory) {
1536
+ ChatMessageStepCategory["List"] = "list";
1537
+ ChatMessageStepCategory["WebSearch"] = "web_search";
1538
+ ChatMessageStepCategory["Files"] = "files";
1539
+ ChatMessageStepCategory["File"] = "file";
1540
+ ChatMessageStepCategory["Program"] = "program";
1541
+ ChatMessageStepCategory["Iframe"] = "iframe";
1542
+ ChatMessageStepCategory["Memory"] = "memory";
1543
+ ChatMessageStepCategory["Tasks"] = "tasks";
1544
+ ChatMessageStepCategory["Knowledges"] = "knowledges";
1545
+ })(exports.ChatMessageStepCategory || (exports.ChatMessageStepCategory = {}));
1546
+
1343
1547
  function _define_property$9(obj, key, value) {
1344
1548
  if (key in obj) {
1345
1549
  Object.defineProperty(obj, key, {
@@ -1854,84 +2058,6 @@ exports.PriceType = void 0;
1854
2058
  PriceType["OUTPUT"] = "output";
1855
2059
  })(exports.PriceType || (exports.PriceType = {}));
1856
2060
 
1857
- /**
1858
- * Business roles for AI copilot (commands or contexts)
1859
- */ exports.AiBusinessRole = void 0;
1860
- (function(AiBusinessRole) {
1861
- AiBusinessRole["FinanceBP"] = "finance_bp";
1862
- AiBusinessRole["SupplyChainExpert"] = "supply_chain_expert";
1863
- })(exports.AiBusinessRole || (exports.AiBusinessRole = {}));
1864
- /**
1865
- * Providers for LLMs
1866
- *
1867
- * - https://js.langchain.com/docs/integrations/chat/
1868
- */ exports.AiProvider = void 0;
1869
- (function(AiProvider) {
1870
- /**
1871
- * - https://js.langchain.com/docs/integrations/chat/openai/
1872
- */ AiProvider["OpenAI"] = "openai";
1873
- /**
1874
- * - https://js.langchain.com/docs/integrations/chat/openai/
1875
- */ AiProvider["Azure"] = "azure";
1876
- // DashScope = 'dashscope',
1877
- /**
1878
- * - https://ollama.com/
1879
- * - https://js.langchain.com/docs/integrations/chat/ollama/
1880
- */ AiProvider["Ollama"] = "ollama";
1881
- /**
1882
- * - https://www.deepseek.com/zh
1883
- * - https://js.langchain.com/docs/integrations/chat/openai/
1884
- */ AiProvider["DeepSeek"] = "deepseek";
1885
- /**
1886
- * - https://docs.anthropic.com/en/home
1887
- * - https://js.langchain.com/docs/integrations/chat/anthropic/
1888
- */ AiProvider["Anthropic"] = "anthropic";
1889
- /**
1890
- * - https://www.aliyun.com/product/bailian
1891
- * - https://js.langchain.com/docs/integrations/chat/alibaba_tongyi/
1892
- */ AiProvider["AlibabaTongyi"] = "alibaba_tongyi";
1893
- /**
1894
- * - https://open.bigmodel.cn/
1895
- * - https://js.langchain.com/docs/integrations/chat/openai/
1896
- */ AiProvider["Zhipu"] = "zhipu";
1897
- /**
1898
- * - https://qianfan.cloud.baidu.com/
1899
- * - https://js.langchain.com/docs/integrations/chat/baidu_qianfan/
1900
- */ AiProvider["BaiduQianfan"] = "baidu_qianfan";
1901
- /**
1902
- * - https://www.together.ai/
1903
- * - https://js.langchain.com/docs/integrations/chat/togetherai/
1904
- */ AiProvider["Together"] = "together";
1905
- /**
1906
- * - https://platform.moonshot.cn/console
1907
- * - https://js.langchain.com/docs/integrations/chat/openai/
1908
- */ AiProvider["Moonshot"] = "moonshot";
1909
- /**
1910
- * - https://groq.com/
1911
- * - https://js.langchain.com/docs/integrations/chat/openai/
1912
- */ AiProvider["Groq"] = "groq";
1913
- /**
1914
- * - https://mistral.ai/
1915
- *
1916
- */ AiProvider["Mistral"] = "mistral";
1917
- /**
1918
- * - https://cohere.com/
1919
- */ AiProvider["Cohere"] = "cohere";
1920
- })(exports.AiProvider || (exports.AiProvider = {}));
1921
- exports.AiProtocol = void 0;
1922
- (function(AiProtocol) {
1923
- AiProtocol["OpenAI"] = "openai";
1924
- AiProtocol["Others"] = "others";
1925
- })(exports.AiProtocol || (exports.AiProtocol = {}));
1926
- var OpenAIEmbeddingsProviders = [
1927
- exports.AiProvider.OpenAI,
1928
- exports.AiProvider.Azure,
1929
- exports.AiProvider.DeepSeek
1930
- ];
1931
- var OllamaEmbeddingsProviders = [
1932
- exports.AiProvider.Ollama
1933
- ];
1934
-
1935
2061
  /**
1936
2062
  * @deprecated use ChatMessageEventTypeEnum
1937
2063
  */ exports.ChatGatewayEvent = void 0;
@@ -1990,6 +2116,7 @@ exports.AiFeatureEnum = void 0;
1990
2116
  AiFeatureEnum["FEATURE_XPERT_CLAWXPERT"] = "FEATURE_XPERT_CLAWXPERT";
1991
2117
  AiFeatureEnum["FEATURE_XPERT_CODEXPERT"] = "FEATURE_XPERT_CODEXPERT";
1992
2118
  AiFeatureEnum["FEATURE_XPERT_DEEP_RESEARCH"] = "FEATURE_XPERT_DEEP_RESEARCH";
2119
+ AiFeatureEnum["FEATURE_XPERT_DATA_ONTOLOGY"] = "FEATURE_XPERT_DATA_ONTOLOGY";
1993
2120
  })(exports.AiFeatureEnum || (exports.AiFeatureEnum = {}));
1994
2121
 
1995
2122
  exports.VectorTypeEnum = void 0;
@@ -2441,6 +2568,11 @@ var STATE_SYS_VOLUME = "volume";
2441
2568
  /**
2442
2569
  * URL for workspace files in sandbox environment
2443
2570
  */ var STATE_SYS_WORKSPACE_URL = "workspace_url";
2571
+ var STATE_SYS_WORKSPACE_ROOT = "workspace_root";
2572
+ var STATE_SYS_SHARED_WORKSPACE_PATH = "shared_workspace_path";
2573
+ var STATE_SYS_AGENT_WORKSPACE_PATH = "agent_workspace_path";
2574
+ var STATE_SYS_SESSION_WORKSPACE_PATH = "session_workspace_path";
2575
+ var STATE_SYS_MEMORY_WORKSPACE_PATH = "memory_workspace_path";
2444
2576
  /**
2445
2577
  * Current runtime thread id
2446
2578
  */ var STATE_SYS_THREAD_ID = "thread_id";
@@ -3222,6 +3354,49 @@ function omitXpertRelations(xpert) {
3222
3354
  var _ref;
3223
3355
  return (_ref = isDraft ? (_xpert_draft = xpert.draft) === null || _xpert_draft === void 0 ? void 0 : _xpert_draft.team : xpert) !== null && _ref !== void 0 ? _ref : xpert;
3224
3356
  }
3357
+ function resolveRuntimeXpert(xpert, isDraft) {
3358
+ var _draft_team, _draft_team1, _draft_team2, _draft_team3, _draft_team4;
3359
+ if (!isDraft || !xpert.draft) {
3360
+ return xpert;
3361
+ }
3362
+ var draft = xpert.draft;
3363
+ var graph = resolveDraftRuntimeGraph(xpert, draft);
3364
+ var agent = resolveDraftPrimaryAgent(xpert, draft, graph);
3365
+ var _draft_team5, _draft_team_workspaceId, _draft_team_agentConfig, _draft_team_commandProfile, _draft_team_features, _draft_team_options;
3366
+ return _object_spread_props$3(_object_spread$3({}, xpert, (_draft_team5 = draft.team) !== null && _draft_team5 !== void 0 ? _draft_team5 : {}), {
3367
+ id: xpert.id,
3368
+ tenantId: xpert.tenantId,
3369
+ organizationId: xpert.organizationId,
3370
+ workspaceId: (_draft_team_workspaceId = (_draft_team = draft.team) === null || _draft_team === void 0 ? void 0 : _draft_team.workspaceId) !== null && _draft_team_workspaceId !== void 0 ? _draft_team_workspaceId : xpert.workspaceId,
3371
+ draft: xpert.draft,
3372
+ graph: graph,
3373
+ agent: agent,
3374
+ agentConfig: (_draft_team_agentConfig = (_draft_team1 = draft.team) === null || _draft_team1 === void 0 ? void 0 : _draft_team1.agentConfig) !== null && _draft_team_agentConfig !== void 0 ? _draft_team_agentConfig : xpert.agentConfig,
3375
+ commandProfile: (_draft_team_commandProfile = (_draft_team2 = draft.team) === null || _draft_team2 === void 0 ? void 0 : _draft_team2.commandProfile) !== null && _draft_team_commandProfile !== void 0 ? _draft_team_commandProfile : xpert.commandProfile,
3376
+ features: (_draft_team_features = (_draft_team3 = draft.team) === null || _draft_team3 === void 0 ? void 0 : _draft_team3.features) !== null && _draft_team_features !== void 0 ? _draft_team_features : xpert.features,
3377
+ options: (_draft_team_options = (_draft_team4 = draft.team) === null || _draft_team4 === void 0 ? void 0 : _draft_team4.options) !== null && _draft_team_options !== void 0 ? _draft_team_options : xpert.options
3378
+ });
3379
+ }
3380
+ function resolveDraftRuntimeGraph(xpert, draft) {
3381
+ var _xpert_graph, _xpert_graph1;
3382
+ var _draft_nodes, _ref, _draft_connections, _ref1;
3383
+ return {
3384
+ nodes: (_ref = (_draft_nodes = draft.nodes) !== null && _draft_nodes !== void 0 ? _draft_nodes : (_xpert_graph = xpert.graph) === null || _xpert_graph === void 0 ? void 0 : _xpert_graph.nodes) !== null && _ref !== void 0 ? _ref : [],
3385
+ connections: (_ref1 = (_draft_connections = draft.connections) !== null && _draft_connections !== void 0 ? _draft_connections : (_xpert_graph1 = xpert.graph) === null || _xpert_graph1 === void 0 ? void 0 : _xpert_graph1.connections) !== null && _ref1 !== void 0 ? _ref1 : []
3386
+ };
3387
+ }
3388
+ function resolveDraftPrimaryAgent(xpert, draft, graph) {
3389
+ var _draft_team, _xpert_agent;
3390
+ var draftAgent = (_draft_team = draft.team) === null || _draft_team === void 0 ? void 0 : _draft_team.agent;
3391
+ var _draftAgent_key;
3392
+ var targetKey = (_draftAgent_key = draftAgent === null || draftAgent === void 0 ? void 0 : draftAgent.key) !== null && _draftAgent_key !== void 0 ? _draftAgent_key : (_xpert_agent = xpert.agent) === null || _xpert_agent === void 0 ? void 0 : _xpert_agent.key;
3393
+ var agentNode = targetKey ? graph.nodes.find(function(node) {
3394
+ var _node_entity;
3395
+ return node.type === "agent" && (node.key === targetKey || ((_node_entity = node.entity) === null || _node_entity === void 0 ? void 0 : _node_entity.key) === targetKey);
3396
+ }) : null;
3397
+ var _agentNode_entity, _ref;
3398
+ return (_ref = (_agentNode_entity = agentNode === null || agentNode === void 0 ? void 0 : agentNode.entity) !== null && _agentNode_entity !== void 0 ? _agentNode_entity : draftAgent) !== null && _ref !== void 0 ? _ref : xpert.agent;
3399
+ }
3225
3400
  function xpertLabel(agent) {
3226
3401
  return agent.title || agent.name;
3227
3402
  }
@@ -3763,6 +3938,23 @@ function getChunkNodeId(document) {
3763
3938
  return leaves;
3764
3939
  }
3765
3940
 
3941
+ exports.KnowledgeGraphStatus = void 0;
3942
+ (function(KnowledgeGraphStatus) {
3943
+ KnowledgeGraphStatus["DISABLED"] = "disabled";
3944
+ KnowledgeGraphStatus["INDEXING"] = "indexing";
3945
+ KnowledgeGraphStatus["READY"] = "ready";
3946
+ KnowledgeGraphStatus["FAILED"] = "failed";
3947
+ KnowledgeGraphStatus["REBUILD_REQUIRED"] = "rebuild_required";
3948
+ })(exports.KnowledgeGraphStatus || (exports.KnowledgeGraphStatus = {}));
3949
+ exports.KnowledgeGraphIndexJobStatus = void 0;
3950
+ (function(KnowledgeGraphIndexJobStatus) {
3951
+ KnowledgeGraphIndexJobStatus["QUEUED"] = "queued";
3952
+ KnowledgeGraphIndexJobStatus["RUNNING"] = "running";
3953
+ KnowledgeGraphIndexJobStatus["SUCCESS"] = "success";
3954
+ KnowledgeGraphIndexJobStatus["FAILED"] = "failed";
3955
+ KnowledgeGraphIndexJobStatus["CANCELLED"] = "cancelled";
3956
+ })(exports.KnowledgeGraphIndexJobStatus || (exports.KnowledgeGraphIndexJobStatus = {}));
3957
+
3766
3958
  // Skill types
3767
3959
  var WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER = "workspace-public";
3768
3960
  var WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME = "Workspace Shared Skills";
@@ -4454,43 +4646,6 @@ function filterMessageText(content) {
4454
4646
  }
4455
4647
 
4456
4648
  var STATE_VARIABLE_HUMAN = "human";
4457
- exports.ChatMessageTypeEnum = void 0;
4458
- (function(ChatMessageTypeEnum) {
4459
- ChatMessageTypeEnum["MESSAGE"] = "message";
4460
- ChatMessageTypeEnum["EVENT"] = "event";
4461
- })(exports.ChatMessageTypeEnum || (exports.ChatMessageTypeEnum = {}));
4462
- exports.ChatMessageEventTypeEnum = void 0;
4463
- (function(ChatMessageEventTypeEnum) {
4464
- ChatMessageEventTypeEnum["ON_CONVERSATION_START"] = "on_conversation_start";
4465
- ChatMessageEventTypeEnum["ON_CONVERSATION_END"] = "on_conversation_end";
4466
- ChatMessageEventTypeEnum["ON_MESSAGE_START"] = "on_message_start";
4467
- ChatMessageEventTypeEnum["ON_MESSAGE_END"] = "on_message_end";
4468
- ChatMessageEventTypeEnum["ON_TOOL_START"] = "on_tool_start";
4469
- ChatMessageEventTypeEnum["ON_TOOL_END"] = "on_tool_end";
4470
- ChatMessageEventTypeEnum["ON_TOOL_ERROR"] = "on_tool_error";
4471
- ChatMessageEventTypeEnum["ON_TOOL_MESSAGE"] = "on_tool_message";
4472
- ChatMessageEventTypeEnum["ON_AGENT_START"] = "on_agent_start";
4473
- ChatMessageEventTypeEnum["ON_AGENT_END"] = "on_agent_end";
4474
- ChatMessageEventTypeEnum["ON_RETRIEVER_START"] = "on_retriever_start";
4475
- ChatMessageEventTypeEnum["ON_RETRIEVER_END"] = "on_retriever_end";
4476
- ChatMessageEventTypeEnum["ON_RETRIEVER_ERROR"] = "on_retriever_error";
4477
- ChatMessageEventTypeEnum["ON_INTERRUPT"] = "on_interrupt";
4478
- ChatMessageEventTypeEnum["ON_ERROR"] = "on_error";
4479
- ChatMessageEventTypeEnum["ON_CHAT_EVENT"] = "on_chat_event";
4480
- ChatMessageEventTypeEnum["ON_CLIENT_EFFECT"] = "on_client_effect";
4481
- })(exports.ChatMessageEventTypeEnum || (exports.ChatMessageEventTypeEnum = {}));
4482
- exports.ChatMessageStepCategory = void 0;
4483
- (function(ChatMessageStepCategory) {
4484
- ChatMessageStepCategory["List"] = "list";
4485
- ChatMessageStepCategory["WebSearch"] = "web_search";
4486
- ChatMessageStepCategory["Files"] = "files";
4487
- ChatMessageStepCategory["File"] = "file";
4488
- ChatMessageStepCategory["Program"] = "program";
4489
- ChatMessageStepCategory["Iframe"] = "iframe";
4490
- ChatMessageStepCategory["Memory"] = "memory";
4491
- ChatMessageStepCategory["Tasks"] = "tasks";
4492
- ChatMessageStepCategory["Knowledges"] = "knowledges";
4493
- })(exports.ChatMessageStepCategory || (exports.ChatMessageStepCategory = {}));
4494
4649
 
4495
4650
  exports.PermissionsEnum = void 0;
4496
4651
  (function(PermissionsEnum) {
@@ -5211,14 +5366,32 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5211
5366
  * @param variable
5212
5367
  * @returns
5213
5368
  */ function getVariableSchema(variables, variable) {
5214
- var _variable_split;
5215
- 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);
5216
- var group = variables === null || variables === void 0 ? void 0 : variables.find(function(_) {
5217
- var __group, __group1;
5218
- return rest.length ? ((__group = _.group) === null || __group === void 0 ? void 0 : __group.name) === groupName : !((__group1 = _.group) === null || __group1 === void 0 ? void 0 : __group1.name);
5369
+ if (!(variables === null || variables === void 0 ? void 0 : variables.length) || !variable) {
5370
+ return {
5371
+ group: undefined,
5372
+ variable: undefined
5373
+ };
5374
+ }
5375
+ var _variable_split = _to_array(variable.split(".")), groupName = _variable_split[0], rest = _variable_split.slice(1);
5376
+ if (rest.length) {
5377
+ var grouped = findVariableInGroup(variables, groupName, rest.join("."));
5378
+ if (grouped.variable) {
5379
+ return grouped;
5380
+ }
5381
+ }
5382
+ var ungrouped = findVariableInGroup(variables, "", variable);
5383
+ if (ungrouped.variable) {
5384
+ return ungrouped;
5385
+ }
5386
+ return rest.length ? findVariableInGroup(variables, groupName, rest.join(".")) : ungrouped;
5387
+ }
5388
+ function findVariableInGroup(variables, groupName, variableName) {
5389
+ var group = variables.find(function(item) {
5390
+ var _item_group, _item_group1;
5391
+ return groupName ? ((_item_group = item.group) === null || _item_group === void 0 ? void 0 : _item_group.name) === groupName : !((_item_group1 = item.group) === null || _item_group1 === void 0 ? void 0 : _item_group1.name);
5219
5392
  });
5220
- var selectVariable = group === null || group === void 0 ? void 0 : group.variables.find(function(_) {
5221
- return _.name === (rest.join(".") || groupName);
5393
+ var selectVariable = group === null || group === void 0 ? void 0 : group.variables.find(function(item) {
5394
+ return item.name === variableName;
5222
5395
  });
5223
5396
  return {
5224
5397
  group: group,
@@ -5476,9 +5649,14 @@ exports.SANDBOX_MANAGED_SERVICE_TRANSPORT_MODES = SANDBOX_MANAGED_SERVICE_TRANSP
5476
5649
  exports.SANDBOX_TERMINAL_NAMESPACE = SANDBOX_TERMINAL_NAMESPACE;
5477
5650
  exports.SANDBOX_WORK_FOR_TYPES = SANDBOX_WORK_FOR_TYPES;
5478
5651
  exports.STANDARD_METADATA_FIELDS = STANDARD_METADATA_FIELDS;
5652
+ exports.STATE_SYS_AGENT_WORKSPACE_PATH = STATE_SYS_AGENT_WORKSPACE_PATH;
5653
+ exports.STATE_SYS_MEMORY_WORKSPACE_PATH = STATE_SYS_MEMORY_WORKSPACE_PATH;
5654
+ exports.STATE_SYS_SESSION_WORKSPACE_PATH = STATE_SYS_SESSION_WORKSPACE_PATH;
5655
+ exports.STATE_SYS_SHARED_WORKSPACE_PATH = STATE_SYS_SHARED_WORKSPACE_PATH;
5479
5656
  exports.STATE_SYS_THREAD_ID = STATE_SYS_THREAD_ID;
5480
5657
  exports.STATE_SYS_VOLUME = STATE_SYS_VOLUME;
5481
5658
  exports.STATE_SYS_WORKSPACE_PATH = STATE_SYS_WORKSPACE_PATH;
5659
+ exports.STATE_SYS_WORKSPACE_ROOT = STATE_SYS_WORKSPACE_ROOT;
5482
5660
  exports.STATE_SYS_WORKSPACE_URL = STATE_SYS_WORKSPACE_URL;
5483
5661
  exports.STATE_VARIABLE_FILES = STATE_VARIABLE_FILES;
5484
5662
  exports.STATE_VARIABLE_HUMAN = STATE_VARIABLE_HUMAN;
@@ -5591,7 +5769,11 @@ exports.normalizeMiddlewareProvider = normalizeMiddlewareProvider;
5591
5769
  exports.normalizeXpertAgentConfig = normalizeXpertAgentConfig;
5592
5770
  exports.omitXpertRelations = omitXpertRelations;
5593
5771
  exports.replaceAgentInDraft = replaceAgentInDraft;
5772
+ exports.resolveDraftPrimaryAgent = resolveDraftPrimaryAgent;
5773
+ exports.resolveDraftRuntimeGraph = resolveDraftRuntimeGraph;
5774
+ exports.resolveI18nText = resolveI18nText;
5594
5775
  exports.resolveMessageAppendContext = resolveMessageAppendContext;
5776
+ exports.resolveRuntimeXpert = resolveRuntimeXpert;
5595
5777
  exports.setStateVariable = setStateVariable;
5596
5778
  exports.shortTitle = shortTitle;
5597
5779
  exports.stringifyMessageContent = stringifyMessageContent;