@xpert-ai/contracts 3.9.4 → 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.cjs.js +88 -7
- package/index.esm.js +86 -8
- package/package.json +2 -2
- package/src/agent/variables.d.ts +3 -3
- package/src/ai/index.d.ts +1 -0
- package/src/ai/knowledge-graph.model.d.ts +224 -0
- package/src/ai/knowledge-pipeline.d.ts +4 -0
- package/src/ai/knowledgebase.model.d.ts +10 -0
- package/src/ai/middleware.model.d.ts +6 -4
- package/src/ai/xpert.model.d.ts +8 -3
- package/src/ai/xpert.utils.d.ts +5 -2
package/index.cjs.js
CHANGED
|
@@ -3222,6 +3222,49 @@ function omitXpertRelations(xpert) {
|
|
|
3222
3222
|
var _ref;
|
|
3223
3223
|
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
3224
|
}
|
|
3225
|
+
function resolveRuntimeXpert(xpert, isDraft) {
|
|
3226
|
+
var _draft_team, _draft_team1, _draft_team2, _draft_team3, _draft_team4;
|
|
3227
|
+
if (!isDraft || !xpert.draft) {
|
|
3228
|
+
return xpert;
|
|
3229
|
+
}
|
|
3230
|
+
var draft = xpert.draft;
|
|
3231
|
+
var graph = resolveDraftRuntimeGraph(xpert, draft);
|
|
3232
|
+
var agent = resolveDraftPrimaryAgent(xpert, draft, graph);
|
|
3233
|
+
var _draft_team5, _draft_team_workspaceId, _draft_team_agentConfig, _draft_team_commandProfile, _draft_team_features, _draft_team_options;
|
|
3234
|
+
return _object_spread_props$3(_object_spread$3({}, xpert, (_draft_team5 = draft.team) !== null && _draft_team5 !== void 0 ? _draft_team5 : {}), {
|
|
3235
|
+
id: xpert.id,
|
|
3236
|
+
tenantId: xpert.tenantId,
|
|
3237
|
+
organizationId: xpert.organizationId,
|
|
3238
|
+
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,
|
|
3239
|
+
draft: xpert.draft,
|
|
3240
|
+
graph: graph,
|
|
3241
|
+
agent: agent,
|
|
3242
|
+
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,
|
|
3243
|
+
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,
|
|
3244
|
+
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,
|
|
3245
|
+
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
|
|
3246
|
+
});
|
|
3247
|
+
}
|
|
3248
|
+
function resolveDraftRuntimeGraph(xpert, draft) {
|
|
3249
|
+
var _xpert_graph, _xpert_graph1;
|
|
3250
|
+
var _draft_nodes, _ref, _draft_connections, _ref1;
|
|
3251
|
+
return {
|
|
3252
|
+
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 : [],
|
|
3253
|
+
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 : []
|
|
3254
|
+
};
|
|
3255
|
+
}
|
|
3256
|
+
function resolveDraftPrimaryAgent(xpert, draft, graph) {
|
|
3257
|
+
var _draft_team, _xpert_agent;
|
|
3258
|
+
var draftAgent = (_draft_team = draft.team) === null || _draft_team === void 0 ? void 0 : _draft_team.agent;
|
|
3259
|
+
var _draftAgent_key;
|
|
3260
|
+
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;
|
|
3261
|
+
var agentNode = targetKey ? graph.nodes.find(function(node) {
|
|
3262
|
+
var _node_entity;
|
|
3263
|
+
return node.type === "agent" && (node.key === targetKey || ((_node_entity = node.entity) === null || _node_entity === void 0 ? void 0 : _node_entity.key) === targetKey);
|
|
3264
|
+
}) : null;
|
|
3265
|
+
var _agentNode_entity, _ref;
|
|
3266
|
+
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;
|
|
3267
|
+
}
|
|
3225
3268
|
function xpertLabel(agent) {
|
|
3226
3269
|
return agent.title || agent.name;
|
|
3227
3270
|
}
|
|
@@ -3763,6 +3806,23 @@ function getChunkNodeId(document) {
|
|
|
3763
3806
|
return leaves;
|
|
3764
3807
|
}
|
|
3765
3808
|
|
|
3809
|
+
exports.KnowledgeGraphStatus = void 0;
|
|
3810
|
+
(function(KnowledgeGraphStatus) {
|
|
3811
|
+
KnowledgeGraphStatus["DISABLED"] = "disabled";
|
|
3812
|
+
KnowledgeGraphStatus["INDEXING"] = "indexing";
|
|
3813
|
+
KnowledgeGraphStatus["READY"] = "ready";
|
|
3814
|
+
KnowledgeGraphStatus["FAILED"] = "failed";
|
|
3815
|
+
KnowledgeGraphStatus["REBUILD_REQUIRED"] = "rebuild_required";
|
|
3816
|
+
})(exports.KnowledgeGraphStatus || (exports.KnowledgeGraphStatus = {}));
|
|
3817
|
+
exports.KnowledgeGraphIndexJobStatus = void 0;
|
|
3818
|
+
(function(KnowledgeGraphIndexJobStatus) {
|
|
3819
|
+
KnowledgeGraphIndexJobStatus["QUEUED"] = "queued";
|
|
3820
|
+
KnowledgeGraphIndexJobStatus["RUNNING"] = "running";
|
|
3821
|
+
KnowledgeGraphIndexJobStatus["SUCCESS"] = "success";
|
|
3822
|
+
KnowledgeGraphIndexJobStatus["FAILED"] = "failed";
|
|
3823
|
+
KnowledgeGraphIndexJobStatus["CANCELLED"] = "cancelled";
|
|
3824
|
+
})(exports.KnowledgeGraphIndexJobStatus || (exports.KnowledgeGraphIndexJobStatus = {}));
|
|
3825
|
+
|
|
3766
3826
|
// Skill types
|
|
3767
3827
|
var WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER = "workspace-public";
|
|
3768
3828
|
var WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME = "Workspace Shared Skills";
|
|
@@ -5211,14 +5271,32 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
5211
5271
|
* @param variable
|
|
5212
5272
|
* @returns
|
|
5213
5273
|
*/ function getVariableSchema(variables, variable) {
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5274
|
+
if (!(variables === null || variables === void 0 ? void 0 : variables.length) || !variable) {
|
|
5275
|
+
return {
|
|
5276
|
+
group: undefined,
|
|
5277
|
+
variable: undefined
|
|
5278
|
+
};
|
|
5279
|
+
}
|
|
5280
|
+
var _variable_split = _to_array(variable.split(".")), groupName = _variable_split[0], rest = _variable_split.slice(1);
|
|
5281
|
+
if (rest.length) {
|
|
5282
|
+
var grouped = findVariableInGroup(variables, groupName, rest.join("."));
|
|
5283
|
+
if (grouped.variable) {
|
|
5284
|
+
return grouped;
|
|
5285
|
+
}
|
|
5286
|
+
}
|
|
5287
|
+
var ungrouped = findVariableInGroup(variables, "", variable);
|
|
5288
|
+
if (ungrouped.variable) {
|
|
5289
|
+
return ungrouped;
|
|
5290
|
+
}
|
|
5291
|
+
return rest.length ? findVariableInGroup(variables, groupName, rest.join(".")) : ungrouped;
|
|
5292
|
+
}
|
|
5293
|
+
function findVariableInGroup(variables, groupName, variableName) {
|
|
5294
|
+
var group = variables.find(function(item) {
|
|
5295
|
+
var _item_group, _item_group1;
|
|
5296
|
+
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
5297
|
});
|
|
5220
|
-
var selectVariable = group === null || group === void 0 ? void 0 : group.variables.find(function(
|
|
5221
|
-
return
|
|
5298
|
+
var selectVariable = group === null || group === void 0 ? void 0 : group.variables.find(function(item) {
|
|
5299
|
+
return item.name === variableName;
|
|
5222
5300
|
});
|
|
5223
5301
|
return {
|
|
5224
5302
|
group: group,
|
|
@@ -5591,7 +5669,10 @@ exports.normalizeMiddlewareProvider = normalizeMiddlewareProvider;
|
|
|
5591
5669
|
exports.normalizeXpertAgentConfig = normalizeXpertAgentConfig;
|
|
5592
5670
|
exports.omitXpertRelations = omitXpertRelations;
|
|
5593
5671
|
exports.replaceAgentInDraft = replaceAgentInDraft;
|
|
5672
|
+
exports.resolveDraftPrimaryAgent = resolveDraftPrimaryAgent;
|
|
5673
|
+
exports.resolveDraftRuntimeGraph = resolveDraftRuntimeGraph;
|
|
5594
5674
|
exports.resolveMessageAppendContext = resolveMessageAppendContext;
|
|
5675
|
+
exports.resolveRuntimeXpert = resolveRuntimeXpert;
|
|
5595
5676
|
exports.setStateVariable = setStateVariable;
|
|
5596
5677
|
exports.shortTitle = shortTitle;
|
|
5597
5678
|
exports.stringifyMessageContent = stringifyMessageContent;
|
package/index.esm.js
CHANGED
|
@@ -3220,6 +3220,49 @@ function omitXpertRelations(xpert) {
|
|
|
3220
3220
|
var _ref;
|
|
3221
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;
|
|
3222
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
|
+
}
|
|
3223
3266
|
function xpertLabel(agent) {
|
|
3224
3267
|
return agent.title || agent.name;
|
|
3225
3268
|
}
|
|
@@ -3761,6 +3804,23 @@ function getChunkNodeId(document) {
|
|
|
3761
3804
|
return leaves;
|
|
3762
3805
|
}
|
|
3763
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
|
+
|
|
3764
3824
|
// Skill types
|
|
3765
3825
|
var WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER = "workspace-public";
|
|
3766
3826
|
var WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME = "Workspace Shared Skills";
|
|
@@ -5209,14 +5269,32 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
5209
5269
|
* @param variable
|
|
5210
5270
|
* @returns
|
|
5211
5271
|
*/ function getVariableSchema(variables, variable) {
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
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);
|
|
5217
5295
|
});
|
|
5218
|
-
var selectVariable = group === null || group === void 0 ? void 0 : group.variables.find(function(
|
|
5219
|
-
return
|
|
5296
|
+
var selectVariable = group === null || group === void 0 ? void 0 : group.variables.find(function(item) {
|
|
5297
|
+
return item.name === variableName;
|
|
5220
5298
|
});
|
|
5221
5299
|
return {
|
|
5222
5300
|
group: group,
|
|
@@ -5417,4 +5495,4 @@ var PLUGIN_LOAD_STATUS = {
|
|
|
5417
5495
|
FAILED: "failed"
|
|
5418
5496
|
};
|
|
5419
5497
|
|
|
5420
|
-
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, 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, 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
|
+
"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.3.
|
|
22
|
+
"@xpert-ai/chatkit-types": "^0.3.6"
|
|
23
23
|
},
|
|
24
24
|
"types": "./index.d.ts"
|
|
25
25
|
}
|
package/src/agent/variables.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TWorkflowVarGroup } from
|
|
2
|
-
import { TXpertParameter } from
|
|
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
|
};
|
package/src/ai/index.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ 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';
|
|
85
86
|
export * from './prompt-workflow.model';
|
|
86
87
|
export * from './middleware.model';
|
|
@@ -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>;
|
|
@@ -94,6 +94,10 @@ export interface IWFNKnowledgeBase extends IWorkflowNode {
|
|
|
94
94
|
* @deprecated Configure rerank model on the knowledgebase.
|
|
95
95
|
*/
|
|
96
96
|
rerankModel?: ICopilotModel;
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated Configure chat model on the knowledgebase.
|
|
99
|
+
*/
|
|
100
|
+
chatModel?: ICopilotModel;
|
|
97
101
|
/**
|
|
98
102
|
* @deprecated Configure vision model on the knowledgebase.
|
|
99
103
|
*/
|
|
@@ -5,6 +5,7 @@ import { IKnowledgeDocument } from './knowledge-doc.model';
|
|
|
5
5
|
import { IXpert } from './xpert.model';
|
|
6
6
|
import { IIntegration } from '../integration.model';
|
|
7
7
|
import { IDocChunkMetadata } from './knowledge-doc-chunk.model';
|
|
8
|
+
import type { GraphRagConfig, KnowledgeGraphStatus } from './knowledge-graph.model';
|
|
8
9
|
/**
|
|
9
10
|
* Non-internal types should remain the same as IntegrationEnum.
|
|
10
11
|
*/
|
|
@@ -67,6 +68,11 @@ export type TKnowledgebase = {
|
|
|
67
68
|
*/
|
|
68
69
|
copilotModel?: ICopilotModel;
|
|
69
70
|
copilotModelId?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Chat model for knowledgebase LLM tasks.
|
|
73
|
+
*/
|
|
74
|
+
chatModel?: ICopilotModel | null;
|
|
75
|
+
chatModelId?: string | null;
|
|
70
76
|
embeddingCollectionName?: string | null;
|
|
71
77
|
embeddingModelFingerprint?: string | null;
|
|
72
78
|
embeddingDimensions?: number | null;
|
|
@@ -79,6 +85,10 @@ export type TKnowledgebase = {
|
|
|
79
85
|
pendingEmbeddingRevision?: number | null;
|
|
80
86
|
rebuildTaskId?: string | null;
|
|
81
87
|
embeddingRebuildError?: string | null;
|
|
88
|
+
graphRag?: GraphRagConfig | null;
|
|
89
|
+
graphStatus?: KnowledgeGraphStatus | null;
|
|
90
|
+
graphRevision?: number | null;
|
|
91
|
+
graphIndexError?: string | null;
|
|
82
92
|
rerankModel?: ICopilotModel;
|
|
83
93
|
rerankModelId?: string;
|
|
84
94
|
visionModel?: ICopilotModel;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { IWorkflowNode, WorkflowNodeTypeEnum } from
|
|
2
|
-
import { I18nObject, IconDefinition } from
|
|
3
|
-
import { TXpertFeatureKey, TXpertGraph, TXpertTeamNode } from
|
|
4
|
-
import { JsonSchemaObjectType } from
|
|
1
|
+
import { IWorkflowNode, WorkflowNodeTypeEnum } from './xpert-workflow.model';
|
|
2
|
+
import { I18nObject, IconDefinition } from '../types';
|
|
3
|
+
import { TXpertFeatureKey, TXpertGraph, TXpertTeamNode } from './xpert.model';
|
|
4
|
+
import { JsonSchemaObjectType } from './types';
|
|
5
|
+
import type { SkillSlashCommand } from './skill.model';
|
|
5
6
|
export declare const LEGACY_SANDBOX_COMPRESSION_MIDDLEWARE_NAME = "SandboxCompressionMiddleware";
|
|
6
7
|
export declare const CONTEXT_COMPRESSION_MIDDLEWARE_NAME = "ContextCompressionMiddleware";
|
|
7
8
|
export interface IWFNMiddleware extends IWorkflowNode {
|
|
@@ -30,5 +31,6 @@ export type TAgentMiddlewareMeta = {
|
|
|
30
31
|
description?: I18nObject;
|
|
31
32
|
configSchema?: JsonSchemaObjectType;
|
|
32
33
|
features?: TXpertFeatureKey[];
|
|
34
|
+
slashCommands?: SkillSlashCommand[];
|
|
33
35
|
};
|
|
34
36
|
export declare function getAgentMiddlewareNodes(graph: TXpertGraph, agentKey: string): TXpertTeamNode[];
|
package/src/ai/xpert.model.d.ts
CHANGED
|
@@ -522,16 +522,21 @@ export type TChatOptions = {
|
|
|
522
522
|
* Knowledgebase retrieval settings
|
|
523
523
|
*/
|
|
524
524
|
export type TKBRetrievalSettings = {
|
|
525
|
-
|
|
525
|
+
mode?: 'vector' | 'graph' | 'hybrid';
|
|
526
|
+
neighborHops?: number;
|
|
527
|
+
entityTopK?: number;
|
|
528
|
+
communityTopK?: number;
|
|
529
|
+
graphWeight?: number;
|
|
530
|
+
metadata?: {
|
|
526
531
|
filtering_mode: 'disabled' | 'automatic' | 'manual';
|
|
527
532
|
/**
|
|
528
533
|
* Conditions (filter) when mode is manual
|
|
529
534
|
*/
|
|
530
|
-
filtering_conditions
|
|
535
|
+
filtering_conditions?: TWFCase;
|
|
531
536
|
/**
|
|
532
537
|
* Parameter fields (tool call) when mode is automatic
|
|
533
538
|
*/
|
|
534
|
-
fields
|
|
539
|
+
fields?: Record<string, object>;
|
|
535
540
|
};
|
|
536
541
|
};
|
|
537
542
|
export declare function isXpertNodeType<T extends TXpertTeamNodeType>(type: T): (node: TXpertTeamNode) => node is NodeOf<T>;
|
package/src/ai/xpert.utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IPoint } from '../types';
|
|
2
2
|
import { IXpertAgent } from './xpert-agent.model';
|
|
3
|
-
import { IXpert, TXpertTeamConnection, TXpertTeamDraft, TXpertTeamNode } from './xpert.model';
|
|
3
|
+
import { IXpert, TXpertGraph, TXpertTeamConnection, TXpertTeamDraft, TXpertTeamNode } from './xpert.model';
|
|
4
4
|
export declare function omitXpertRelations(xpert: Partial<IXpert>): {
|
|
5
5
|
environmentId?: string;
|
|
6
6
|
workspaceId?: string;
|
|
@@ -37,7 +37,7 @@ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
|
|
|
37
37
|
latest?: boolean;
|
|
38
38
|
releaseNotes?: string;
|
|
39
39
|
exportedTemplate?: import("./xpert.model").TXpertExportedTemplate | null;
|
|
40
|
-
graph?:
|
|
40
|
+
graph?: TXpertGraph;
|
|
41
41
|
api?: import("./xpert.model").TChatApi;
|
|
42
42
|
app?: import("./xpert.model").TChatApp;
|
|
43
43
|
userId?: string;
|
|
@@ -54,6 +54,9 @@ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
|
|
|
54
54
|
* @returns
|
|
55
55
|
*/
|
|
56
56
|
export declare function figureOutXpert(xpert: IXpert, isDraft: boolean): Partial<IXpert>;
|
|
57
|
+
export declare function resolveRuntimeXpert(xpert: IXpert, isDraft: boolean): IXpert;
|
|
58
|
+
export declare function resolveDraftRuntimeGraph(xpert: IXpert, draft: TXpertTeamDraft): TXpertGraph;
|
|
59
|
+
export declare function resolveDraftPrimaryAgent(xpert: IXpert, draft: TXpertTeamDraft, graph: TXpertGraph): IXpertAgent | undefined;
|
|
57
60
|
export declare function xpertLabel(agent: Partial<IXpert>): string;
|
|
58
61
|
export declare function createXpertGraph(xpert: IXpert, position: IPoint): {
|
|
59
62
|
nodes: TXpertTeamNode[];
|