@xpert-ai/contracts 3.9.3 → 3.9.5

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.esm.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import ShortUniqueId from 'short-unique-id';
2
- import { CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED } from '@xpert-ai/chatkit-types';
3
- export { CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED } from '@xpert-ai/chatkit-types';
4
2
 
5
3
  function _array_like_to_array$7(arr, len) {
6
4
  if (len == null || len > arr.length) len = arr.length;
@@ -1340,6 +1338,48 @@ var QueryStatusEnum;
1340
1338
  QueryStatusEnum["FAILED"] = "failed";
1341
1339
  })(QueryStatusEnum || (QueryStatusEnum = {}));
1342
1340
 
1341
+ function _define_property$9(obj, key, value) {
1342
+ if (key in obj) {
1343
+ Object.defineProperty(obj, key, {
1344
+ value: value,
1345
+ enumerable: true,
1346
+ configurable: true,
1347
+ writable: true
1348
+ });
1349
+ } else {
1350
+ obj[key] = value;
1351
+ }
1352
+ return obj;
1353
+ }
1354
+ function _object_spread$8(target) {
1355
+ for(var i = 1; i < arguments.length; i++){
1356
+ var source = arguments[i] != null ? arguments[i] : {};
1357
+ var ownKeys = Object.keys(source);
1358
+ if (typeof Object.getOwnPropertySymbols === "function") {
1359
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1360
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1361
+ }));
1362
+ }
1363
+ ownKeys.forEach(function(key) {
1364
+ _define_property$9(target, key, source[key]);
1365
+ });
1366
+ }
1367
+ return target;
1368
+ }
1369
+ var CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = "follow_up_consumed";
1370
+ var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
1371
+ var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
1372
+ function createConversationTitleSummaryEvent(event) {
1373
+ return _object_spread$8({
1374
+ type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
1375
+ }, event);
1376
+ }
1377
+ function createFollowUpConsumedEvent(event) {
1378
+ return _object_spread$8({
1379
+ type: CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED
1380
+ }, event);
1381
+ }
1382
+
1343
1383
  function _array_like_to_array$6(arr, len) {
1344
1384
  if (len == null || len > arr.length) len = arr.length;
1345
1385
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -1351,7 +1391,7 @@ function _array_with_holes$5(arr) {
1351
1391
  function _array_without_holes$2(arr) {
1352
1392
  if (Array.isArray(arr)) return _array_like_to_array$6(arr);
1353
1393
  }
1354
- function _define_property$9(obj, key, value) {
1394
+ function _define_property$8(obj, key, value) {
1355
1395
  if (key in obj) {
1356
1396
  Object.defineProperty(obj, key, {
1357
1397
  value: value,
@@ -1397,7 +1437,7 @@ function _non_iterable_rest$5() {
1397
1437
  function _non_iterable_spread$2() {
1398
1438
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1399
1439
  }
1400
- function _object_spread$8(target) {
1440
+ function _object_spread$7(target) {
1401
1441
  for(var i = 1; i < arguments.length; i++){
1402
1442
  var source = arguments[i] != null ? arguments[i] : {};
1403
1443
  var ownKeys = Object.keys(source);
@@ -1407,7 +1447,7 @@ function _object_spread$8(target) {
1407
1447
  }));
1408
1448
  }
1409
1449
  ownKeys.forEach(function(key) {
1410
- _define_property$9(target, key, source[key]);
1450
+ _define_property$8(target, key, source[key]);
1411
1451
  });
1412
1452
  }
1413
1453
  return target;
@@ -1545,7 +1585,7 @@ function normalizeAssistantBindingToolPreferences(value) {
1545
1585
  if (!Object.keys(toolsets).length && !Object.keys(middlewares).length && !Object.keys(skills).length) {
1546
1586
  return null;
1547
1587
  }
1548
- return _object_spread$8({
1588
+ return _object_spread$7({
1549
1589
  version: 1
1550
1590
  }, Object.keys(toolsets).length ? {
1551
1591
  toolsets: toolsets
@@ -1623,8 +1663,8 @@ function updateAssistantBindingToolPreferences(preferences, sourceType, nodeKey,
1623
1663
  }) : normalizeAssistantBindingPreferenceIds(_to_consumable_array$2(disabledTools).concat([
1624
1664
  normalizedToolName
1625
1665
  ]));
1626
- var toolsets = normalizedPreferences.toolsets ? _object_spread$8({}, normalizedPreferences.toolsets) : undefined;
1627
- var middlewares = normalizedPreferences.middlewares ? _object_spread$8({}, normalizedPreferences.middlewares) : undefined;
1666
+ var toolsets = normalizedPreferences.toolsets ? _object_spread$7({}, normalizedPreferences.toolsets) : undefined;
1667
+ var middlewares = normalizedPreferences.middlewares ? _object_spread$7({}, normalizedPreferences.middlewares) : undefined;
1628
1668
  if (sourceType === "toolset") {
1629
1669
  var toolsetName = "toolsetName" in metadata ? normalizeAssistantBindingPreferenceKey(metadata.toolsetName) : "";
1630
1670
  if (!toolsetName) {
@@ -1640,14 +1680,14 @@ function updateAssistantBindingToolPreferences(preferences, sourceType, nodeKey,
1640
1680
  } else {
1641
1681
  delete nextToolsets[normalizedNodeKey];
1642
1682
  }
1643
- return normalizeAssistantBindingToolPreferences(_object_spread$8({
1683
+ return normalizeAssistantBindingToolPreferences(_object_spread$7({
1644
1684
  version: 1
1645
1685
  }, Object.keys(nextToolsets).length ? {
1646
1686
  toolsets: nextToolsets
1647
1687
  } : {}, middlewares && Object.keys(middlewares).length ? {
1648
1688
  middlewares: middlewares
1649
1689
  } : {}, normalizedPreferences.skills ? {
1650
- skills: _object_spread$8({}, normalizedPreferences.skills)
1690
+ skills: _object_spread$7({}, normalizedPreferences.skills)
1651
1691
  } : {}));
1652
1692
  }
1653
1693
  var provider = "provider" in metadata ? normalizeAssistantBindingPreferenceKey(metadata.provider) : "";
@@ -1663,14 +1703,14 @@ function updateAssistantBindingToolPreferences(preferences, sourceType, nodeKey,
1663
1703
  } else {
1664
1704
  delete nextMiddlewares[normalizedNodeKey];
1665
1705
  }
1666
- return normalizeAssistantBindingToolPreferences(_object_spread$8({
1706
+ return normalizeAssistantBindingToolPreferences(_object_spread$7({
1667
1707
  version: 1
1668
1708
  }, toolsets && Object.keys(toolsets).length ? {
1669
1709
  toolsets: toolsets
1670
1710
  } : {}, Object.keys(nextMiddlewares).length ? {
1671
1711
  middlewares: nextMiddlewares
1672
1712
  } : {}, normalizedPreferences.skills ? {
1673
- skills: _object_spread$8({}, normalizedPreferences.skills)
1713
+ skills: _object_spread$7({}, normalizedPreferences.skills)
1674
1714
  } : {}));
1675
1715
  }
1676
1716
  function updateAssistantBindingSkillPreferences(preferences, workspaceId, skillId, enabled) {
@@ -1688,7 +1728,7 @@ function updateAssistantBindingSkillPreferences(preferences, workspaceId, skillI
1688
1728
  }) : normalizeAssistantBindingPreferenceIds(_to_consumable_array$2(disabledSkillIds).concat([
1689
1729
  normalizedSkillId
1690
1730
  ]));
1691
- var skills = normalizedPreferences.skills ? _object_spread$8({}, normalizedPreferences.skills) : {};
1731
+ var skills = normalizedPreferences.skills ? _object_spread$7({}, normalizedPreferences.skills) : {};
1692
1732
  if (nextDisabledSkillIds.length) {
1693
1733
  skills[normalizedWorkspaceId] = {
1694
1734
  workspaceId: normalizedWorkspaceId,
@@ -1697,12 +1737,12 @@ function updateAssistantBindingSkillPreferences(preferences, workspaceId, skillI
1697
1737
  } else {
1698
1738
  delete skills[normalizedWorkspaceId];
1699
1739
  }
1700
- return normalizeAssistantBindingToolPreferences(_object_spread$8({
1740
+ return normalizeAssistantBindingToolPreferences(_object_spread$7({
1701
1741
  version: 1
1702
1742
  }, normalizedPreferences.toolsets ? {
1703
- toolsets: _object_spread$8({}, normalizedPreferences.toolsets)
1743
+ toolsets: _object_spread$7({}, normalizedPreferences.toolsets)
1704
1744
  } : {}, normalizedPreferences.middlewares ? {
1705
- middlewares: _object_spread$8({}, normalizedPreferences.middlewares)
1745
+ middlewares: _object_spread$7({}, normalizedPreferences.middlewares)
1706
1746
  } : {}, Object.keys(skills).length ? {
1707
1747
  skills: skills
1708
1748
  } : {}));
@@ -1720,14 +1760,14 @@ function ensureAssistantBindingSkillWorkspacePreference(preferences, workspaceId
1720
1760
  var currentSkills = (_normalizedPreferences_skills = normalizedPreferences.skills) !== null && _normalizedPreferences_skills !== void 0 ? _normalizedPreferences_skills : {};
1721
1761
  var currentWorkspacePreference = currentSkills[normalizedWorkspaceId];
1722
1762
  var _currentWorkspacePreference_disabledSkillIds;
1723
- return _object_spread_props$6(_object_spread$8({
1763
+ return _object_spread_props$6(_object_spread$7({
1724
1764
  version: 1
1725
1765
  }, normalizedPreferences.toolsets ? {
1726
- toolsets: _object_spread$8({}, normalizedPreferences.toolsets)
1766
+ toolsets: _object_spread$7({}, normalizedPreferences.toolsets)
1727
1767
  } : {}, normalizedPreferences.middlewares ? {
1728
- middlewares: _object_spread$8({}, normalizedPreferences.middlewares)
1768
+ middlewares: _object_spread$7({}, normalizedPreferences.middlewares)
1729
1769
  } : {}), {
1730
- skills: _object_spread_props$6(_object_spread$8({}, currentSkills), _define_property$9({}, normalizedWorkspaceId, {
1770
+ skills: _object_spread_props$6(_object_spread$7({}, currentSkills), _define_property$8({}, normalizedWorkspaceId, {
1731
1771
  workspaceId: normalizeAssistantBindingPreferenceKey(currentWorkspacePreference === null || currentWorkspacePreference === void 0 ? void 0 : currentWorkspacePreference.workspaceId) || normalizedWorkspaceId,
1732
1772
  disabledSkillIds: (_currentWorkspacePreference_disabledSkillIds = currentWorkspacePreference === null || currentWorkspacePreference === void 0 ? void 0 : currentWorkspacePreference.disabledSkillIds) !== null && _currentWorkspacePreference_disabledSkillIds !== void 0 ? _currentWorkspacePreference_disabledSkillIds : []
1733
1773
  }))
@@ -1890,47 +1930,6 @@ var OllamaEmbeddingsProviders = [
1890
1930
  AiProvider.Ollama
1891
1931
  ];
1892
1932
 
1893
- function _define_property$8(obj, key, value) {
1894
- if (key in obj) {
1895
- Object.defineProperty(obj, key, {
1896
- value: value,
1897
- enumerable: true,
1898
- configurable: true,
1899
- writable: true
1900
- });
1901
- } else {
1902
- obj[key] = value;
1903
- }
1904
- return obj;
1905
- }
1906
- function _object_spread$7(target) {
1907
- for(var i = 1; i < arguments.length; i++){
1908
- var source = arguments[i] != null ? arguments[i] : {};
1909
- var ownKeys = Object.keys(source);
1910
- if (typeof Object.getOwnPropertySymbols === "function") {
1911
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1912
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1913
- }));
1914
- }
1915
- ownKeys.forEach(function(key) {
1916
- _define_property$8(target, key, source[key]);
1917
- });
1918
- }
1919
- return target;
1920
- }
1921
- var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
1922
- var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
1923
- function createConversationTitleSummaryEvent(event) {
1924
- return _object_spread$7({
1925
- type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
1926
- }, event);
1927
- }
1928
- function createFollowUpConsumedEvent(event) {
1929
- return _object_spread$7({
1930
- type: CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED
1931
- }, event);
1932
- }
1933
-
1934
1933
  /**
1935
1934
  * @deprecated use ChatMessageEventTypeEnum
1936
1935
  */ var ChatGatewayEvent;
@@ -3221,6 +3220,49 @@ function omitXpertRelations(xpert) {
3221
3220
  var _ref;
3222
3221
  return (_ref = isDraft ? (_xpert_draft = xpert.draft) === null || _xpert_draft === void 0 ? void 0 : _xpert_draft.team : xpert) !== null && _ref !== void 0 ? _ref : xpert;
3223
3222
  }
3223
+ function resolveRuntimeXpert(xpert, isDraft) {
3224
+ var _draft_team, _draft_team1, _draft_team2, _draft_team3, _draft_team4;
3225
+ if (!isDraft || !xpert.draft) {
3226
+ return xpert;
3227
+ }
3228
+ var draft = xpert.draft;
3229
+ var graph = resolveDraftRuntimeGraph(xpert, draft);
3230
+ var agent = resolveDraftPrimaryAgent(xpert, draft, graph);
3231
+ var _draft_team5, _draft_team_workspaceId, _draft_team_agentConfig, _draft_team_commandProfile, _draft_team_features, _draft_team_options;
3232
+ return _object_spread_props$3(_object_spread$3({}, xpert, (_draft_team5 = draft.team) !== null && _draft_team5 !== void 0 ? _draft_team5 : {}), {
3233
+ id: xpert.id,
3234
+ tenantId: xpert.tenantId,
3235
+ organizationId: xpert.organizationId,
3236
+ 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,
3237
+ draft: xpert.draft,
3238
+ graph: graph,
3239
+ agent: agent,
3240
+ 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,
3241
+ 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,
3242
+ 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,
3243
+ 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
3244
+ });
3245
+ }
3246
+ function resolveDraftRuntimeGraph(xpert, draft) {
3247
+ var _xpert_graph, _xpert_graph1;
3248
+ var _draft_nodes, _ref, _draft_connections, _ref1;
3249
+ return {
3250
+ 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 : [],
3251
+ 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 : []
3252
+ };
3253
+ }
3254
+ function resolveDraftPrimaryAgent(xpert, draft, graph) {
3255
+ var _draft_team, _xpert_agent;
3256
+ var draftAgent = (_draft_team = draft.team) === null || _draft_team === void 0 ? void 0 : _draft_team.agent;
3257
+ var _draftAgent_key;
3258
+ 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;
3259
+ var agentNode = targetKey ? graph.nodes.find(function(node) {
3260
+ var _node_entity;
3261
+ return node.type === "agent" && (node.key === targetKey || ((_node_entity = node.entity) === null || _node_entity === void 0 ? void 0 : _node_entity.key) === targetKey);
3262
+ }) : null;
3263
+ var _agentNode_entity, _ref;
3264
+ 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;
3265
+ }
3224
3266
  function xpertLabel(agent) {
3225
3267
  return agent.title || agent.name;
3226
3268
  }
@@ -3762,6 +3804,23 @@ function getChunkNodeId(document) {
3762
3804
  return leaves;
3763
3805
  }
3764
3806
 
3807
+ var KnowledgeGraphStatus;
3808
+ (function(KnowledgeGraphStatus) {
3809
+ KnowledgeGraphStatus["DISABLED"] = "disabled";
3810
+ KnowledgeGraphStatus["INDEXING"] = "indexing";
3811
+ KnowledgeGraphStatus["READY"] = "ready";
3812
+ KnowledgeGraphStatus["FAILED"] = "failed";
3813
+ KnowledgeGraphStatus["REBUILD_REQUIRED"] = "rebuild_required";
3814
+ })(KnowledgeGraphStatus || (KnowledgeGraphStatus = {}));
3815
+ var KnowledgeGraphIndexJobStatus;
3816
+ (function(KnowledgeGraphIndexJobStatus) {
3817
+ KnowledgeGraphIndexJobStatus["QUEUED"] = "queued";
3818
+ KnowledgeGraphIndexJobStatus["RUNNING"] = "running";
3819
+ KnowledgeGraphIndexJobStatus["SUCCESS"] = "success";
3820
+ KnowledgeGraphIndexJobStatus["FAILED"] = "failed";
3821
+ KnowledgeGraphIndexJobStatus["CANCELLED"] = "cancelled";
3822
+ })(KnowledgeGraphIndexJobStatus || (KnowledgeGraphIndexJobStatus = {}));
3823
+
3765
3824
  // Skill types
3766
3825
  var WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER = "workspace-public";
3767
3826
  var WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME = "Workspace Shared Skills";
@@ -4729,6 +4788,12 @@ var OrganizationProjectBudgetTypeEnum;
4729
4788
  OrganizationProjectBudgetTypeEnum["COST"] = "cost";
4730
4789
  })(OrganizationProjectBudgetTypeEnum || (OrganizationProjectBudgetTypeEnum = {}));
4731
4790
 
4791
+ var SecretTokenBindingType;
4792
+ (function(SecretTokenBindingType) {
4793
+ SecretTokenBindingType["API_KEY"] = "api_key";
4794
+ SecretTokenBindingType["PUBLIC_XPERT"] = "public_xpert";
4795
+ })(SecretTokenBindingType || (SecretTokenBindingType = {}));
4796
+
4732
4797
  var Visibility;
4733
4798
  (function(Visibility) {
4734
4799
  Visibility["Public"] = "public";
@@ -5204,14 +5269,32 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5204
5269
  * @param variable
5205
5270
  * @returns
5206
5271
  */ function getVariableSchema(variables, variable) {
5207
- var _variable_split;
5208
- 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);
5209
- var group = variables === null || variables === void 0 ? void 0 : variables.find(function(_) {
5210
- var __group, __group1;
5211
- return rest.length ? ((__group = _.group) === null || __group === void 0 ? void 0 : __group.name) === groupName : !((__group1 = _.group) === null || __group1 === void 0 ? void 0 : __group1.name);
5272
+ if (!(variables === null || variables === void 0 ? void 0 : variables.length) || !variable) {
5273
+ return {
5274
+ group: undefined,
5275
+ variable: undefined
5276
+ };
5277
+ }
5278
+ var _variable_split = _to_array(variable.split(".")), groupName = _variable_split[0], rest = _variable_split.slice(1);
5279
+ if (rest.length) {
5280
+ var grouped = findVariableInGroup(variables, groupName, rest.join("."));
5281
+ if (grouped.variable) {
5282
+ return grouped;
5283
+ }
5284
+ }
5285
+ var ungrouped = findVariableInGroup(variables, "", variable);
5286
+ if (ungrouped.variable) {
5287
+ return ungrouped;
5288
+ }
5289
+ return rest.length ? findVariableInGroup(variables, groupName, rest.join(".")) : ungrouped;
5290
+ }
5291
+ function findVariableInGroup(variables, groupName, variableName) {
5292
+ var group = variables.find(function(item) {
5293
+ var _item_group, _item_group1;
5294
+ 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);
5212
5295
  });
5213
- var selectVariable = group === null || group === void 0 ? void 0 : group.variables.find(function(_) {
5214
- return _.name === (rest.join(".") || groupName);
5296
+ var selectVariable = group === null || group === void 0 ? void 0 : group.variables.find(function(item) {
5297
+ return item.name === variableName;
5215
5298
  });
5216
5299
  return {
5217
5300
  group: group,
@@ -5412,4 +5495,4 @@ var PLUGIN_LOAD_STATUS = {
5412
5495
  FAILED: "failed"
5413
5496
  };
5414
5497
 
5415
- 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_COMPRESSION_COMPONENT_TYPE, CONTEXT_COMPRESSION_MIDDLEWARE_NAME, 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, DEFAULT_XPERT_AGENT_RECURSION_LIMIT, 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, KnowledgebaseStatusEnum, KnowledgebaseTypeEnum, LEGACY_SANDBOX_COMPRESSION_MIDDLEWARE_NAME, 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_MANAGED_SERVICE_STATUSES, SANDBOX_MANAGED_SERVICE_TRANSPORT_MODES, SANDBOX_TERMINAL_NAMESPACE, SANDBOX_WORK_FOR_TYPES, SMTPSecureEnum, STANDARD_METADATA_FIELDS, STATE_SYS_THREAD_ID, 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, SandboxManagedServiceErrorCode, SandboxTerminalClientEvent, SandboxTerminalClosedReason, SandboxTerminalErrorCode, SandboxTerminalServerEvent, 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, WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME, WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER, WeekDaysEnum, WorkflowComparisonOperator, WorkflowLogicalOperator, WorkflowNodeTypeEnum, XpertAgentExecutionStatusEnum, XpertParameterTypeEnum, XpertTableStatus, XpertToolsetCategoryEnum, XpertTypeEnum, agentLabel, agentUniqueName, allChannels, appendMessageContent, appendMessagePlainText, buildChunkTree, channelName, classificateDocumentCategory, collectTreeLeaves, configurableStoreNamespace, convertToUrlPath, createAgentConnections, createConversationTitleSummaryEvent, createFollowUpConsumedEvent, createMessageAppendContextTracker, createXpertGraph, createXpertNodes, embeddingCubeCollectionName, ensureAssistantBindingSkillWorkspacePreference, extractSemanticModelDraft, figureOutXpert, filterAssistantBindingDisabledSkillIds, filterAssistantBindingDisabledTools, filterMessageText, findStartNodes, genJSONParseKey, genJSONStringifyKey, genListOperatorKey, genPipelineChunkerKey, genPipelineKnowledgeBaseKey, genPipelineProcessorKey, genPipelineSourceKey, genPipelineUnderstandingKey, genVariableAggregatorKey, genXpertDBDeleteKey, genXpertDBInsertKey, genXpertDBQueryKey, genXpertDBSqlKey, genXpertDBUpdateKey, genXpertIteratorKey, genXpertMiddlewareKey, genXpertSkillKey, genXpertStartKey, genXpertTriggerKey, generateCronExpression, getAgentMiddlewareNodes, getAgentVarGroup, getAssistantBindingDisabledSkillIds, getAssistantBindingDisabledTools, getAssistantManagement, getCurrentGraph, getEnabledTools, getStoreNamespace, getSwarmPartners, getToolCallFromConfig, getToolCallIdFromConfig, getToolLabel, getVariableSchema, getWorkflowTriggers, getWorkspaceFromRunnable, getXpertAgentRecursionLimit, getXpertWorkspaceVisibility, inferMessageAppendContext, isAgentKey, isAssistantBindingSkillEnabled, isAssistantBindingToolEnabled, isAssistantBindingToolPreferencesEmpty, isAudioType, isContextCompressionComponentData, isDocumentSheet, isEnableTool, isImageType, isInterruptMessage, isIteratingKey, isIteratorKey, isMessageGroup, isMiddlewareToolEnabled, isRequiredMiddleware, isRouterKey, isSystemManagedAssistant, isTenantSharedXpertWorkspace, isToolEnabled, isUserManagedAssistant, isVideoType, isXpertNodeType, letterStartSUID, locateNodes, mapTranslationLanguage, mergeMessageContentForDisplay, messageContentText, normalizeAssistantBindingToolPreferences, normalizeMiddlewareNode, normalizeMiddlewareNodes, normalizeMiddlewareProvider, normalizeXpertAgentConfig, omitXpertRelations, replaceAgentInDraft, resolveMessageAppendContext, setStateVariable, shortTitle, stringifyMessageContent, transformInstallation, updateAssistantBindingSkillPreferences, updateAssistantBindingToolPreferences, uuid, workflowNodeIdentifier, xpertLabel };
5498
+ 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_FOLLOW_UP_CONSUMED, CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE, CONTEXT_COMPRESSION_COMPONENT_TYPE, CONTEXT_COMPRESSION_MIDDLEWARE_NAME, 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, DEFAULT_XPERT_AGENT_RECURSION_LIMIT, 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, KnowledgeGraphIndexJobStatus, KnowledgeGraphStatus, KnowledgeProviderEnum, KnowledgeStructureEnum, KnowledgeTask, KnowledgebaseChannel, KnowledgebasePermission, KnowledgebaseStatusEnum, KnowledgebaseTypeEnum, LEGACY_SANDBOX_COMPRESSION_MIDDLEWARE_NAME, 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_MANAGED_SERVICE_STATUSES, SANDBOX_MANAGED_SERVICE_TRANSPORT_MODES, SANDBOX_TERMINAL_NAMESPACE, SANDBOX_WORK_FOR_TYPES, SMTPSecureEnum, STANDARD_METADATA_FIELDS, STATE_SYS_THREAD_ID, 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, SandboxManagedServiceErrorCode, SandboxTerminalClientEvent, SandboxTerminalClosedReason, SandboxTerminalErrorCode, SandboxTerminalServerEvent, ScheduleTaskStatus, SecretTokenBindingType, 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, WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME, WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER, WeekDaysEnum, WorkflowComparisonOperator, WorkflowLogicalOperator, WorkflowNodeTypeEnum, XpertAgentExecutionStatusEnum, XpertParameterTypeEnum, XpertTableStatus, XpertToolsetCategoryEnum, XpertTypeEnum, agentLabel, agentUniqueName, allChannels, appendMessageContent, appendMessagePlainText, buildChunkTree, channelName, classificateDocumentCategory, collectTreeLeaves, configurableStoreNamespace, convertToUrlPath, createAgentConnections, createConversationTitleSummaryEvent, createFollowUpConsumedEvent, createMessageAppendContextTracker, createXpertGraph, createXpertNodes, embeddingCubeCollectionName, ensureAssistantBindingSkillWorkspacePreference, extractSemanticModelDraft, figureOutXpert, filterAssistantBindingDisabledSkillIds, filterAssistantBindingDisabledTools, filterMessageText, findStartNodes, genJSONParseKey, genJSONStringifyKey, genListOperatorKey, genPipelineChunkerKey, genPipelineKnowledgeBaseKey, genPipelineProcessorKey, genPipelineSourceKey, genPipelineUnderstandingKey, genVariableAggregatorKey, genXpertDBDeleteKey, genXpertDBInsertKey, genXpertDBQueryKey, genXpertDBSqlKey, genXpertDBUpdateKey, genXpertIteratorKey, genXpertMiddlewareKey, genXpertSkillKey, genXpertStartKey, genXpertTriggerKey, generateCronExpression, getAgentMiddlewareNodes, getAgentVarGroup, getAssistantBindingDisabledSkillIds, getAssistantBindingDisabledTools, getAssistantManagement, getCurrentGraph, getEnabledTools, getStoreNamespace, getSwarmPartners, getToolCallFromConfig, getToolCallIdFromConfig, getToolLabel, getVariableSchema, getWorkflowTriggers, getWorkspaceFromRunnable, getXpertAgentRecursionLimit, getXpertWorkspaceVisibility, inferMessageAppendContext, isAgentKey, isAssistantBindingSkillEnabled, isAssistantBindingToolEnabled, isAssistantBindingToolPreferencesEmpty, isAudioType, isContextCompressionComponentData, isDocumentSheet, isEnableTool, isImageType, isInterruptMessage, isIteratingKey, isIteratorKey, isMessageGroup, isMiddlewareToolEnabled, isRequiredMiddleware, isRouterKey, isSystemManagedAssistant, isTenantSharedXpertWorkspace, isToolEnabled, isUserManagedAssistant, isVideoType, isXpertNodeType, letterStartSUID, locateNodes, mapTranslationLanguage, mergeMessageContentForDisplay, messageContentText, normalizeAssistantBindingToolPreferences, normalizeMiddlewareNode, normalizeMiddlewareNodes, normalizeMiddlewareProvider, normalizeXpertAgentConfig, omitXpertRelations, replaceAgentInDraft, resolveDraftPrimaryAgent, resolveDraftRuntimeGraph, resolveMessageAppendContext, resolveRuntimeXpert, setStateVariable, shortTitle, stringifyMessageContent, transformInstallation, updateAssistantBindingSkillPreferences, updateAssistantBindingToolPreferences, uuid, workflowNodeIdentifier, xpertLabel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/contracts",
3
- "version": "3.9.3",
3
+ "version": "3.9.5",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,7 @@
19
19
  "module": "./index.esm.js",
20
20
  "main": "./index.cjs.js",
21
21
  "dependencies": {
22
- "@xpert-ai/chatkit-types": "^0.2.3"
22
+ "@xpert-ai/chatkit-types": "^0.3.6"
23
23
  },
24
24
  "types": "./index.d.ts"
25
25
  }
@@ -1,5 +1,5 @@
1
- import { TWorkflowVarGroup } from "../ai/xpert-workflow.model";
2
- import { TXpertParameter } from "../ai/xpert.model";
1
+ import { TWorkflowVarGroup } from '../ai/xpert-workflow.model';
2
+ import { TXpertParameter } from '../ai/xpert.model';
3
3
  /**
4
4
  *
5
5
  * Returns the variable schema for a given variable name.
@@ -9,7 +9,7 @@ import { TXpertParameter } from "../ai/xpert.model";
9
9
  * @param variable
10
10
  * @returns
11
11
  */
12
- export declare function getVariableSchema(variables: TWorkflowVarGroup[], variable: string): {
12
+ export declare function getVariableSchema(variables: TWorkflowVarGroup[] | null | undefined, variable: string | null | undefined): {
13
13
  group: TWorkflowVarGroup;
14
14
  variable: import("../ai/xpert.model").TStateVariable;
15
15
  };
@@ -1,4 +1,5 @@
1
- import { type TFollowUpConsumedEvent, type TChatEventMessage } from '@xpert-ai/chatkit-types';
1
+ import type { TFollowUpConsumedEvent, TChatEventMessage } from '@xpert-ai/chatkit-types';
2
+ export declare const CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED: "follow_up_consumed";
2
3
  export declare const CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE: "thread_context_usage";
3
4
  export declare const CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY: "conversation_title_summary";
4
5
  export type TConversationTitleSummaryEvent = TChatEventMessage & {
package/src/ai/index.d.ts CHANGED
@@ -34,8 +34,8 @@ export declare enum ChatMessageStepCategory {
34
34
  Knowledges = "knowledges"
35
35
  }
36
36
  export type * from '@xpert-ai/chatkit-types';
37
- export { CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED } from '@xpert-ai/chatkit-types';
38
37
  export type { TChatRequest } from './xpert-chat.model';
38
+ export { CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED } from './chat-event.model';
39
39
  export * from './assistant-binding.model';
40
40
  export * from './ai-model.model';
41
41
  export * from './ai.model';
@@ -81,7 +81,9 @@ export * from './knowledgebase-task.model';
81
81
  export * from './knowledge-pipeline';
82
82
  export * from './knowledge-retrieval-log.model';
83
83
  export * from './knowledge-doc-chunk.model';
84
+ export * from './knowledge-graph.model';
84
85
  export * from './skill.model';
86
+ export * from './prompt-workflow.model';
85
87
  export * from './middleware.model';
86
88
  export * from './context-compression.model';
87
89
  export * from './sandbox';
@@ -0,0 +1,224 @@
1
+ import type { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
2
+ import type { IKnowledgebase } from './knowledgebase.model';
3
+ import type { IKnowledgeDocument } from './knowledge-doc.model';
4
+ import type { IKnowledgeDocumentChunk } from './knowledge-doc-chunk.model';
5
+ export declare enum KnowledgeGraphStatus {
6
+ DISABLED = "disabled",
7
+ INDEXING = "indexing",
8
+ READY = "ready",
9
+ FAILED = "failed",
10
+ REBUILD_REQUIRED = "rebuild_required"
11
+ }
12
+ export declare enum KnowledgeGraphIndexJobStatus {
13
+ QUEUED = "queued",
14
+ RUNNING = "running",
15
+ SUCCESS = "success",
16
+ FAILED = "failed",
17
+ CANCELLED = "cancelled"
18
+ }
19
+ export type KnowledgeGraphIndexJobType = 'document' | 'rebuild';
20
+ export type GraphRagRetrievalMode = 'vector' | 'graph' | 'hybrid';
21
+ export type KnowledgeGraphItemOrigin = 'extracted' | 'manual' | 'curated';
22
+ export type KnowledgeGraphVisibility = 'active' | 'hidden';
23
+ export type GraphRagConfig = {
24
+ enabled?: boolean;
25
+ entityTopK?: number;
26
+ neighborHops?: number;
27
+ communityTopK?: number;
28
+ graphWeight?: number;
29
+ extractionBatchSize?: number;
30
+ extractionMaxCharacters?: number;
31
+ };
32
+ export type KnowledgeGraphEvidence = {
33
+ chunkId: string;
34
+ quote?: string | null;
35
+ confidence?: number | null;
36
+ };
37
+ export interface IKnowledgeGraphEntity extends IBasePerTenantAndOrganizationEntityModel {
38
+ knowledgebaseId?: string;
39
+ knowledgebase?: IKnowledgebase;
40
+ type: string;
41
+ name: string;
42
+ normalizedName: string;
43
+ origin?: KnowledgeGraphItemOrigin;
44
+ visibility?: KnowledgeGraphVisibility;
45
+ aliases?: string[] | null;
46
+ description?: string | null;
47
+ summary?: string | null;
48
+ confidence?: number | null;
49
+ mentionCount?: number | null;
50
+ revision?: number | null;
51
+ metadata?: {
52
+ [key: string]: unknown;
53
+ } | null;
54
+ }
55
+ export interface IKnowledgeGraphRelation extends IBasePerTenantAndOrganizationEntityModel {
56
+ knowledgebaseId?: string;
57
+ knowledgebase?: IKnowledgebase;
58
+ sourceEntityId?: string;
59
+ sourceEntity?: IKnowledgeGraphEntity;
60
+ targetEntityId?: string;
61
+ targetEntity?: IKnowledgeGraphEntity;
62
+ type: string;
63
+ normalizedType?: string | null;
64
+ origin?: KnowledgeGraphItemOrigin;
65
+ visibility?: KnowledgeGraphVisibility;
66
+ description?: string | null;
67
+ confidence?: number | null;
68
+ weight?: number | null;
69
+ evidenceCount?: number | null;
70
+ revision?: number | null;
71
+ metadata?: {
72
+ [key: string]: unknown;
73
+ } | null;
74
+ }
75
+ export interface IKnowledgeGraphMention extends IBasePerTenantAndOrganizationEntityModel {
76
+ knowledgebaseId?: string;
77
+ knowledgebase?: IKnowledgebase;
78
+ entityId?: string;
79
+ entity?: IKnowledgeGraphEntity;
80
+ relationId?: string | null;
81
+ relation?: IKnowledgeGraphRelation | null;
82
+ documentId?: string;
83
+ document?: IKnowledgeDocument;
84
+ chunkId?: string;
85
+ chunk?: IKnowledgeDocumentChunk;
86
+ quote?: string | null;
87
+ confidence?: number | null;
88
+ startOffset?: number | null;
89
+ endOffset?: number | null;
90
+ revision?: number | null;
91
+ metadata?: {
92
+ [key: string]: unknown;
93
+ } | null;
94
+ }
95
+ export interface IKnowledgeGraphCommunity extends IBasePerTenantAndOrganizationEntityModel {
96
+ knowledgebaseId?: string;
97
+ knowledgebase?: IKnowledgebase;
98
+ key: string;
99
+ title?: string | null;
100
+ summary?: string | null;
101
+ entityIds?: string[] | null;
102
+ revision?: number | null;
103
+ metadata?: {
104
+ [key: string]: unknown;
105
+ } | null;
106
+ }
107
+ export interface IKnowledgeGraphIndexJob extends IBasePerTenantAndOrganizationEntityModel {
108
+ knowledgebaseId?: string;
109
+ knowledgebase?: IKnowledgebase;
110
+ documentId?: string | null;
111
+ document?: IKnowledgeDocument | null;
112
+ type: KnowledgeGraphIndexJobType;
113
+ status: KnowledgeGraphIndexJobStatus;
114
+ revision?: number | null;
115
+ totalChunks?: number | null;
116
+ processedChunks?: number | null;
117
+ error?: string | null;
118
+ startedAt?: Date | null;
119
+ completedAt?: Date | null;
120
+ }
121
+ export type KnowledgeGraphStatusResponse = {
122
+ status: KnowledgeGraphStatus;
123
+ enabled: boolean;
124
+ revision?: number | null;
125
+ error?: string | null;
126
+ entityCount: number;
127
+ relationCount: number;
128
+ mentionCount: number;
129
+ queuedJobCount: number;
130
+ runningJobCount: number;
131
+ failedJobCount: number;
132
+ jobs?: IKnowledgeGraphIndexJob[];
133
+ };
134
+ export type KnowledgeGraphViewNode = {
135
+ id: string;
136
+ name: string;
137
+ type: string;
138
+ origin: KnowledgeGraphItemOrigin;
139
+ visibility: KnowledgeGraphVisibility;
140
+ mentionCount?: number | null;
141
+ confidence?: number | null;
142
+ symbolSize?: number;
143
+ value?: number;
144
+ };
145
+ export type KnowledgeGraphViewEdge = {
146
+ id: string;
147
+ source: string;
148
+ target: string;
149
+ type: string;
150
+ origin: KnowledgeGraphItemOrigin;
151
+ visibility: KnowledgeGraphVisibility;
152
+ weight?: number | null;
153
+ evidenceCount?: number | null;
154
+ };
155
+ export type KnowledgeGraphViewResponse = {
156
+ nodes: KnowledgeGraphViewNode[];
157
+ edges: KnowledgeGraphViewEdge[];
158
+ entityTypes: string[];
159
+ relationTypes: string[];
160
+ totalNodes: number;
161
+ totalEdges: number;
162
+ };
163
+ export type KnowledgeGraphVisualizationQuery = {
164
+ search?: string | null;
165
+ entityType?: string | null;
166
+ relationType?: string | null;
167
+ origin?: KnowledgeGraphItemOrigin | null;
168
+ visibility?: KnowledgeGraphVisibility | null;
169
+ focusEntityId?: string | null;
170
+ depth?: number | null;
171
+ take?: number | null;
172
+ };
173
+ export type KnowledgeGraphMentionListQuery = {
174
+ entityId?: string | null;
175
+ relationId?: string | null;
176
+ documentId?: string | null;
177
+ chunkId?: string | null;
178
+ take?: number | null;
179
+ };
180
+ export type KnowledgeGraphEntityChunksQuery = {
181
+ neighborHops?: number | null;
182
+ take?: number | null;
183
+ includeMentions?: boolean | null;
184
+ mentionTake?: number | null;
185
+ documentId?: string | null;
186
+ };
187
+ export type KnowledgeGraphEntityChunksResponse = {
188
+ entity: IKnowledgeGraphEntity;
189
+ chunks: IKnowledgeDocumentChunk[];
190
+ evidenceByChunkId: Record<string, IKnowledgeGraphMention[]>;
191
+ totals: {
192
+ chunks: number;
193
+ mentions: number;
194
+ entityIds: number;
195
+ relations: number;
196
+ };
197
+ limits: {
198
+ take: number;
199
+ neighborHops: number;
200
+ mentionTake: number;
201
+ includeMentions: boolean;
202
+ };
203
+ truncated?: {
204
+ chunks?: boolean;
205
+ mentions?: boolean;
206
+ };
207
+ };
208
+ export type KnowledgeGraphEntityCreateInput = {
209
+ name: string;
210
+ type: string;
211
+ aliases?: string[] | null;
212
+ description?: string | null;
213
+ visibility?: KnowledgeGraphVisibility;
214
+ };
215
+ export type KnowledgeGraphEntityUpdateInput = Partial<KnowledgeGraphEntityCreateInput>;
216
+ export type KnowledgeGraphRelationCreateInput = {
217
+ sourceEntityId: string;
218
+ targetEntityId: string;
219
+ type: string;
220
+ description?: string | null;
221
+ weight?: number | null;
222
+ visibility?: KnowledgeGraphVisibility;
223
+ };
224
+ export type KnowledgeGraphRelationUpdateInput = Partial<KnowledgeGraphRelationCreateInput>;