@metad/contracts 3.8.3 → 3.8.4
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 +42 -19
- package/index.esm.js +40 -20
- package/package.json +1 -1
- package/src/agent/graph.d.ts +24 -0
- package/src/ai/chat.model.d.ts +7 -1
- package/src/ai/index.d.ts +2 -0
- package/src/ai/sandbox.d.ts +3 -1
- package/src/ai/xpert-agent.model.d.ts +3 -31
- package/src/ai/xpert-chat.model.d.ts +64 -0
- package/src/ai/xpert-project.model.d.ts +3 -0
- package/src/ai/xpert.model.d.ts +2 -2
- package/src/plugin.d.ts +28 -1
package/index.cjs.js
CHANGED
|
@@ -1755,7 +1755,8 @@ function agentUniqueName(agent) {
|
|
|
1755
1755
|
function convertToUrlPath(title) {
|
|
1756
1756
|
return title === null || title === void 0 ? void 0 : title.toLowerCase() // Convert to lowercase
|
|
1757
1757
|
.replace(/\s+/g, "-") // Replace spaces with -
|
|
1758
|
-
.replace(/[^a-z0-9-]/g, "")
|
|
1758
|
+
.replace(/[^a-z0-9-]/g, "") // Remove non-alphanumeric characters
|
|
1759
|
+
;
|
|
1759
1760
|
}
|
|
1760
1761
|
var VariableOperations = [
|
|
1761
1762
|
{
|
|
@@ -1906,9 +1907,9 @@ function messageContentText(content) {
|
|
|
1906
1907
|
}
|
|
1907
1908
|
/**
|
|
1908
1909
|
* Get workspace folder for sandbox from runnable configurable
|
|
1909
|
-
*
|
|
1910
|
-
* @param configurable
|
|
1911
|
-
* @returns
|
|
1910
|
+
*
|
|
1911
|
+
* @param configurable
|
|
1912
|
+
* @returns
|
|
1912
1913
|
*/ function getWorkspaceFromRunnable(configurable) {
|
|
1913
1914
|
return (configurable === null || configurable === void 0 ? void 0 : configurable.projectId) ? {
|
|
1914
1915
|
type: "project",
|
|
@@ -1930,9 +1931,9 @@ function getToolCallIdFromConfig(config) {
|
|
|
1930
1931
|
* Compute long-term memory namespace:
|
|
1931
1932
|
* 1. When a user talks to a digital expert individually, use `ExpertId` + `UserId` to store memory
|
|
1932
1933
|
* 2. When talking to a digital expert in a project, all users and digital experts share `ProjectId` to store memory
|
|
1933
|
-
*
|
|
1934
|
-
* @param config
|
|
1935
|
-
* @returns
|
|
1934
|
+
*
|
|
1935
|
+
* @param config
|
|
1936
|
+
* @returns
|
|
1936
1937
|
*/ function getStoreNamespace(config) {
|
|
1937
1938
|
var configurable = config.configurable;
|
|
1938
1939
|
return configurableStoreNamespace(configurable);
|
|
@@ -1947,11 +1948,11 @@ function configurableStoreNamespace(configurable) {
|
|
|
1947
1948
|
}
|
|
1948
1949
|
/**
|
|
1949
1950
|
* Set value into variable of state.
|
|
1950
|
-
*
|
|
1951
|
-
* @param state
|
|
1952
|
-
* @param varName
|
|
1953
|
-
* @param value
|
|
1954
|
-
* @returns
|
|
1951
|
+
*
|
|
1952
|
+
* @param state
|
|
1953
|
+
* @param varName
|
|
1954
|
+
* @param value
|
|
1955
|
+
* @returns
|
|
1955
1956
|
*/ function setStateVariable(state, varName, value) {
|
|
1956
1957
|
var _varName_split = _sliced_to_array$3(varName.split("."), 2), agentChannelName = _varName_split[0], variableName = _varName_split[1];
|
|
1957
1958
|
if (variableName) {
|
|
@@ -1964,10 +1965,10 @@ function configurableStoreNamespace(configurable) {
|
|
|
1964
1965
|
}
|
|
1965
1966
|
/**
|
|
1966
1967
|
* Get agent variable group from graph.
|
|
1967
|
-
*
|
|
1968
|
-
* @param key
|
|
1969
|
-
* @param graph
|
|
1970
|
-
* @returns
|
|
1968
|
+
*
|
|
1969
|
+
* @param key
|
|
1970
|
+
* @param graph
|
|
1971
|
+
* @returns
|
|
1971
1972
|
*/ function getAgentVarGroup(key, graph) {
|
|
1972
1973
|
var _agent_options;
|
|
1973
1974
|
var node = graph.nodes.find(function(_) {
|
|
@@ -2023,9 +2024,9 @@ function configurableStoreNamespace(configurable) {
|
|
|
2023
2024
|
// Swarm
|
|
2024
2025
|
/**
|
|
2025
2026
|
* Get swarm partners of agent in team
|
|
2026
|
-
*
|
|
2027
|
-
* @param graph
|
|
2028
|
-
* @param agentKey
|
|
2027
|
+
*
|
|
2028
|
+
* @param graph
|
|
2029
|
+
* @param agentKey
|
|
2029
2030
|
*/ function getSwarmPartners(graph, agentKey, partners, leaderKey) {
|
|
2030
2031
|
var connections = graph.connections.filter(function(conn) {
|
|
2031
2032
|
return conn.type === "agent" && conn.to === agentKey && (leaderKey ? conn.from !== leaderKey : true) && graph.connections.some(function(_) {
|
|
@@ -3049,6 +3050,12 @@ function getAgentMiddlewareNodes(graph, agentKey) {
|
|
|
3049
3050
|
return middlewares;
|
|
3050
3051
|
}
|
|
3051
3052
|
|
|
3053
|
+
var SANDBOX_WORK_FOR_TYPES = [
|
|
3054
|
+
"user",
|
|
3055
|
+
"project",
|
|
3056
|
+
"environment"
|
|
3057
|
+
];
|
|
3058
|
+
|
|
3052
3059
|
function _array_like_to_array$3(arr, len) {
|
|
3053
3060
|
if (len == null || len > arr.length) len = arr.length;
|
|
3054
3061
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -4350,6 +4357,19 @@ var PLUGIN_LEVEL = {
|
|
|
4350
4357
|
SYSTEM: "system",
|
|
4351
4358
|
ORGANIZATION: "organization"
|
|
4352
4359
|
};
|
|
4360
|
+
var PLUGIN_SOURCE = {
|
|
4361
|
+
MARKETPLACE: "marketplace",
|
|
4362
|
+
LOCAL: "local",
|
|
4363
|
+
GIT: "git",
|
|
4364
|
+
URL: "url",
|
|
4365
|
+
NPM: "npm",
|
|
4366
|
+
CODE: "code",
|
|
4367
|
+
ENV: "env"
|
|
4368
|
+
};
|
|
4369
|
+
var PLUGIN_CONFIGURATION_STATUS = {
|
|
4370
|
+
VALID: "valid",
|
|
4371
|
+
INVALID: "invalid"
|
|
4372
|
+
};
|
|
4353
4373
|
|
|
4354
4374
|
exports.AI_MODEL_TYPE_VARIABLE = AI_MODEL_TYPE_VARIABLE;
|
|
4355
4375
|
exports.Attachment_Type_Options = Attachment_Type_Options;
|
|
@@ -4388,9 +4408,12 @@ exports.MEMORY_PROFILE_PROMPT = MEMORY_PROFILE_PROMPT;
|
|
|
4388
4408
|
exports.MEMORY_QA_PROMPT = MEMORY_QA_PROMPT;
|
|
4389
4409
|
exports.OllamaEmbeddingsProviders = OllamaEmbeddingsProviders;
|
|
4390
4410
|
exports.OpenAIEmbeddingsProviders = OpenAIEmbeddingsProviders;
|
|
4411
|
+
exports.PLUGIN_CONFIGURATION_STATUS = PLUGIN_CONFIGURATION_STATUS;
|
|
4391
4412
|
exports.PLUGIN_LEVEL = PLUGIN_LEVEL;
|
|
4413
|
+
exports.PLUGIN_SOURCE = PLUGIN_SOURCE;
|
|
4392
4414
|
exports.PermissionApprovalStatus = PermissionApprovalStatus;
|
|
4393
4415
|
exports.PermissionGroups = PermissionGroups;
|
|
4416
|
+
exports.SANDBOX_WORK_FOR_TYPES = SANDBOX_WORK_FOR_TYPES;
|
|
4394
4417
|
exports.STANDARD_METADATA_FIELDS = STANDARD_METADATA_FIELDS;
|
|
4395
4418
|
exports.STATE_SYS_VOLUME = STATE_SYS_VOLUME;
|
|
4396
4419
|
exports.STATE_SYS_WORKSPACE_PATH = STATE_SYS_WORKSPACE_PATH;
|
package/index.esm.js
CHANGED
|
@@ -1753,7 +1753,8 @@ function agentUniqueName(agent) {
|
|
|
1753
1753
|
function convertToUrlPath(title) {
|
|
1754
1754
|
return title === null || title === void 0 ? void 0 : title.toLowerCase() // Convert to lowercase
|
|
1755
1755
|
.replace(/\s+/g, "-") // Replace spaces with -
|
|
1756
|
-
.replace(/[^a-z0-9-]/g, "")
|
|
1756
|
+
.replace(/[^a-z0-9-]/g, "") // Remove non-alphanumeric characters
|
|
1757
|
+
;
|
|
1757
1758
|
}
|
|
1758
1759
|
var VariableOperations = [
|
|
1759
1760
|
{
|
|
@@ -1904,9 +1905,9 @@ function messageContentText(content) {
|
|
|
1904
1905
|
}
|
|
1905
1906
|
/**
|
|
1906
1907
|
* Get workspace folder for sandbox from runnable configurable
|
|
1907
|
-
*
|
|
1908
|
-
* @param configurable
|
|
1909
|
-
* @returns
|
|
1908
|
+
*
|
|
1909
|
+
* @param configurable
|
|
1910
|
+
* @returns
|
|
1910
1911
|
*/ function getWorkspaceFromRunnable(configurable) {
|
|
1911
1912
|
return (configurable === null || configurable === void 0 ? void 0 : configurable.projectId) ? {
|
|
1912
1913
|
type: "project",
|
|
@@ -1928,9 +1929,9 @@ function getToolCallIdFromConfig(config) {
|
|
|
1928
1929
|
* Compute long-term memory namespace:
|
|
1929
1930
|
* 1. When a user talks to a digital expert individually, use `ExpertId` + `UserId` to store memory
|
|
1930
1931
|
* 2. When talking to a digital expert in a project, all users and digital experts share `ProjectId` to store memory
|
|
1931
|
-
*
|
|
1932
|
-
* @param config
|
|
1933
|
-
* @returns
|
|
1932
|
+
*
|
|
1933
|
+
* @param config
|
|
1934
|
+
* @returns
|
|
1934
1935
|
*/ function getStoreNamespace(config) {
|
|
1935
1936
|
var configurable = config.configurable;
|
|
1936
1937
|
return configurableStoreNamespace(configurable);
|
|
@@ -1945,11 +1946,11 @@ function configurableStoreNamespace(configurable) {
|
|
|
1945
1946
|
}
|
|
1946
1947
|
/**
|
|
1947
1948
|
* Set value into variable of state.
|
|
1948
|
-
*
|
|
1949
|
-
* @param state
|
|
1950
|
-
* @param varName
|
|
1951
|
-
* @param value
|
|
1952
|
-
* @returns
|
|
1949
|
+
*
|
|
1950
|
+
* @param state
|
|
1951
|
+
* @param varName
|
|
1952
|
+
* @param value
|
|
1953
|
+
* @returns
|
|
1953
1954
|
*/ function setStateVariable(state, varName, value) {
|
|
1954
1955
|
var _varName_split = _sliced_to_array$3(varName.split("."), 2), agentChannelName = _varName_split[0], variableName = _varName_split[1];
|
|
1955
1956
|
if (variableName) {
|
|
@@ -1962,10 +1963,10 @@ function configurableStoreNamespace(configurable) {
|
|
|
1962
1963
|
}
|
|
1963
1964
|
/**
|
|
1964
1965
|
* Get agent variable group from graph.
|
|
1965
|
-
*
|
|
1966
|
-
* @param key
|
|
1967
|
-
* @param graph
|
|
1968
|
-
* @returns
|
|
1966
|
+
*
|
|
1967
|
+
* @param key
|
|
1968
|
+
* @param graph
|
|
1969
|
+
* @returns
|
|
1969
1970
|
*/ function getAgentVarGroup(key, graph) {
|
|
1970
1971
|
var _agent_options;
|
|
1971
1972
|
var node = graph.nodes.find(function(_) {
|
|
@@ -2021,9 +2022,9 @@ function configurableStoreNamespace(configurable) {
|
|
|
2021
2022
|
// Swarm
|
|
2022
2023
|
/**
|
|
2023
2024
|
* Get swarm partners of agent in team
|
|
2024
|
-
*
|
|
2025
|
-
* @param graph
|
|
2026
|
-
* @param agentKey
|
|
2025
|
+
*
|
|
2026
|
+
* @param graph
|
|
2027
|
+
* @param agentKey
|
|
2027
2028
|
*/ function getSwarmPartners(graph, agentKey, partners, leaderKey) {
|
|
2028
2029
|
var connections = graph.connections.filter(function(conn) {
|
|
2029
2030
|
return conn.type === "agent" && conn.to === agentKey && (leaderKey ? conn.from !== leaderKey : true) && graph.connections.some(function(_) {
|
|
@@ -3047,6 +3048,12 @@ function getAgentMiddlewareNodes(graph, agentKey) {
|
|
|
3047
3048
|
return middlewares;
|
|
3048
3049
|
}
|
|
3049
3050
|
|
|
3051
|
+
var SANDBOX_WORK_FOR_TYPES = [
|
|
3052
|
+
"user",
|
|
3053
|
+
"project",
|
|
3054
|
+
"environment"
|
|
3055
|
+
];
|
|
3056
|
+
|
|
3050
3057
|
function _array_like_to_array$3(arr, len) {
|
|
3051
3058
|
if (len == null || len > arr.length) len = arr.length;
|
|
3052
3059
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -4348,5 +4355,18 @@ var PLUGIN_LEVEL = {
|
|
|
4348
4355
|
SYSTEM: "system",
|
|
4349
4356
|
ORGANIZATION: "organization"
|
|
4350
4357
|
};
|
|
4358
|
+
var PLUGIN_SOURCE = {
|
|
4359
|
+
MARKETPLACE: "marketplace",
|
|
4360
|
+
LOCAL: "local",
|
|
4361
|
+
GIT: "git",
|
|
4362
|
+
URL: "url",
|
|
4363
|
+
NPM: "npm",
|
|
4364
|
+
CODE: "code",
|
|
4365
|
+
ENV: "env"
|
|
4366
|
+
};
|
|
4367
|
+
var PLUGIN_CONFIGURATION_STATUS = {
|
|
4368
|
+
VALID: "valid",
|
|
4369
|
+
INVALID: "invalid"
|
|
4370
|
+
};
|
|
4351
4371
|
|
|
4352
|
-
export { AIPermissionsEnum, AI_MODEL_TYPE_VARIABLE, AccessEnum, AgentEventType, AgentType, AiBusinessRole, AiFeatureEnum, AiModelTypeEnum, AiProtocol, AiProvider, AiProviderRole, AlignmentOptions, AnalyticsFeatures, AnalyticsPermissionsEnum, ApiAuthType, ApiProviderSchemaType, ApprovalPolicyTypesEnum, ApprovalPolicyTypesStringEnum, Attachment_Type_Options, AuthenticationEnum, BIInterruptMessageType, BonusTypeEnum, BusinessAreaRole, BusinessType, CONTEXT_VARIABLE_CURRENTSTATE, ChatDashboardMessageType, ChatGatewayEvent, ChatMessageFeedbackRatingEnum, ClientFocusEnum, ConfigurateMethod, ContactOrganizationInviteStatus, ContactType, CredentialFormTypeEnum, CredentialsType, CrudActionEnum, CurrenciesEnum, CurrencyPosition, DEFAULT_CURRENCIES, DEFAULT_DATE_FORMATS, DEFAULT_INTEGRATION_PAID_FILTERS, DEFAULT_INVITE_EXPIRY_PERIOD, DEFAULT_PROFIT_BASED_BONUS, DEFAULT_REVENUE_BASED_BONUS, DEFAULT_TENANT, DEFAULT_TIME_FORMATS, DEFAULT_TYPE, DataSourceProtocolEnum, DataSourceSyntaxEnum, DataSourceTypeEnum, DefaultValueDateTypeEnum, DocumentSourceProviderCategoryEnum, DocumentTypeEnum, EmailTemplateEnum, EmailTemplateNameEnum, EmbeddingStatusEnum, FILE_VARIABLES, FeatureEnum, FeatureStatusEnum, FeedTypeEnum, FetchFrom, FileStorageProviderEnum, GRAPH_NODE_SUMMARIZE_CONVERSATION, GRAPH_NODE_TITLE_CONVERSATION, HttpStatus, IFeatureToggleTypeEnum, INTEGRATION_PROVIDERS, ImportHistoryStatusEnum, ImportTypeEnum, IndicatorDraftFields, IndicatorOptionFields, IndicatorStatusEnum, IndicatorTagEnum, IndicatorType, IntegrationEnum, IntegrationFeatureEnum, IntegrationFilterEnum, IntegrationGitHubProvider, IntegrationLarkProvider, InterruptMessageType, InvitationExpirationEnum, InvitationTypeEnum, InviteStatusEnum, IteratingIndexParameterName, IteratingItemParameterName, IteratorIndexParameterName, IteratorItemParameterName, KBDocumentCategoryEnum, KBDocumentStatusEnum, KDocumentSourceType, KDocumentWebTypeEnum, KDocumentWebTypeOptions, KNOWLEDGE_DOCUMENTS_NAME, KNOWLEDGE_FOLDER_ID_NAME, KNOWLEDGE_SOURCES_NAME, KNOWLEDGE_STAGE_NAME, KnowledgeProviderEnum, KnowledgeStructureEnum, KnowledgeTask, KnowledgebaseChannel, KnowledgebasePermission, KnowledgebaseTypeEnum, LanguagesEnum, LanguagesMap, ListsInputTypeEnum, LocalAgentType, LongTermMemoryTypeEnum, MCPServerType, schema as MDX, MEMORY_PROFILE_PROMPT, MEMORY_QA_PROMPT, MinimumProjectSizeEnum, ModelEntityType, ModelFeature, ModelPropertyKey, ModelTypeEnum, OllamaEmbeddingsProviders, OpenAIEmbeddingsProviders, OrderTypeEnum, OrganizationContactBudgetTypeEnum, OrganizationDemoNetworkEnum, OrganizationPermissionsEnum, OrganizationProjectBudgetTypeEnum, OrganizationSelectInput, PLUGIN_LEVEL, ParameterType, ParameterTypeEnum, PayPeriodEnum, PermissionApprovalStatus, PermissionApprovalStatusTypesEnum, PermissionGroups, PermissionsEnum, PriceType, ProjectBillingEnum, ProjectOwnerEnum, ProjectStatusEnum, ProviderEnum, ProviderType, QueryStatusEnum, RegionsEnum, RequestMethodEnum, RoleTypeEnum, RolesEnum, SMTPSecureEnum, STANDARD_METADATA_FIELDS, STATE_SYS_VOLUME, STATE_SYS_WORKSPACE_PATH, STATE_SYS_WORKSPACE_URL, STATE_VARIABLE_FILES, STATE_VARIABLE_INPUT, STATE_VARIABLE_SYS, STATE_VARIABLE_TITLE_CHANNEL, ScheduleTaskStatus, SemanticModelStatusEnum, StoryStatusEnum, StoryTemplateType, SubscriptionType, TASK_DESCRIPTION_PREFIX, TASK_DESCRIPTION_SUFFIX, TENANT_AGENT_LOCAL_URL, TOOL_NAME_REGEX, TagCategoryEnum, TaskFrequency, TaskListTypeEnum, TimeGranularity, ToolParameterForm, ToolParameterType, ToolTagEnum, TranslationLanguageMap, USAGE_HOUR_FORMAT, UserType, VariableOperationEnum, VariableOperations, VectorTypeEnum, Visibility, VisitEntityEnum, VisitTypeEnum, WeekDaysEnum, WorkflowComparisonOperator, WorkflowLogicalOperator, WorkflowNodeTypeEnum, XpertAgentExecutionStatusEnum, XpertParameterTypeEnum, XpertTableStatus, XpertToolsetCategoryEnum, XpertTypeEnum, agentLabel, agentUniqueName, allChannels, appendMessageContent, appendMessagePlainText, buildChunkTree, channelName, classificateDocumentCategory, collectTreeLeaves, configurableStoreNamespace, convertToUrlPath, createAgentConnections, createMessageAppendContextTracker, createXpertGraph, createXpertNodes, embeddingCubeCollectionName, extractSemanticModelDraft, figureOutXpert, filterMessageText, findStartNodes, genJSONParseKey, genJSONStringifyKey, genListOperatorKey, genPipelineChunkerKey, genPipelineKnowledgeBaseKey, genPipelineProcessorKey, genPipelineSourceKey, genPipelineUnderstandingKey, genVariableAggregatorKey, genXpertDBDeleteKey, genXpertDBInsertKey, genXpertDBQueryKey, genXpertDBSqlKey, genXpertDBUpdateKey, genXpertIteratorKey, genXpertMiddlewareKey, genXpertSkillKey, genXpertStartKey, genXpertTriggerKey, generateCronExpression, getAgentMiddlewareNodes, getAgentVarGroup, getCurrentGraph, getEnabledTools, getStoreNamespace, getSwarmPartners, getToolCallFromConfig, getToolCallIdFromConfig, getToolLabel, getVariableSchema, getWorkflowTriggers, getWorkspaceFromRunnable, inferMessageAppendContext, isAgentKey, isAudioType, isDocumentSheet, isEnableTool, isImageType, isInterruptMessage, isIteratingKey, isIteratorKey, isMessageGroup, isMiddlewareToolEnabled, isRouterKey, isToolEnabled, isVideoType, isXpertNodeType, letterStartSUID, locateNodes, mapTranslationLanguage, messageContentText, omitXpertRelations, resolveMessageAppendContext, setStateVariable, shortTitle, stringifyMessageContent, transformInstallation, uuid, workflowNodeIdentifier, xpertLabel };
|
|
4372
|
+
export { AIPermissionsEnum, AI_MODEL_TYPE_VARIABLE, AccessEnum, AgentEventType, AgentType, AiBusinessRole, AiFeatureEnum, AiModelTypeEnum, AiProtocol, AiProvider, AiProviderRole, AlignmentOptions, AnalyticsFeatures, AnalyticsPermissionsEnum, ApiAuthType, ApiProviderSchemaType, ApprovalPolicyTypesEnum, ApprovalPolicyTypesStringEnum, Attachment_Type_Options, AuthenticationEnum, BIInterruptMessageType, BonusTypeEnum, BusinessAreaRole, BusinessType, CONTEXT_VARIABLE_CURRENTSTATE, ChatDashboardMessageType, ChatGatewayEvent, ChatMessageFeedbackRatingEnum, ClientFocusEnum, ConfigurateMethod, ContactOrganizationInviteStatus, ContactType, CredentialFormTypeEnum, CredentialsType, CrudActionEnum, CurrenciesEnum, CurrencyPosition, DEFAULT_CURRENCIES, DEFAULT_DATE_FORMATS, DEFAULT_INTEGRATION_PAID_FILTERS, DEFAULT_INVITE_EXPIRY_PERIOD, DEFAULT_PROFIT_BASED_BONUS, DEFAULT_REVENUE_BASED_BONUS, DEFAULT_TENANT, DEFAULT_TIME_FORMATS, DEFAULT_TYPE, DataSourceProtocolEnum, DataSourceSyntaxEnum, DataSourceTypeEnum, DefaultValueDateTypeEnum, DocumentSourceProviderCategoryEnum, DocumentTypeEnum, EmailTemplateEnum, EmailTemplateNameEnum, EmbeddingStatusEnum, FILE_VARIABLES, FeatureEnum, FeatureStatusEnum, FeedTypeEnum, FetchFrom, FileStorageProviderEnum, GRAPH_NODE_SUMMARIZE_CONVERSATION, GRAPH_NODE_TITLE_CONVERSATION, HttpStatus, IFeatureToggleTypeEnum, INTEGRATION_PROVIDERS, ImportHistoryStatusEnum, ImportTypeEnum, IndicatorDraftFields, IndicatorOptionFields, IndicatorStatusEnum, IndicatorTagEnum, IndicatorType, IntegrationEnum, IntegrationFeatureEnum, IntegrationFilterEnum, IntegrationGitHubProvider, IntegrationLarkProvider, InterruptMessageType, InvitationExpirationEnum, InvitationTypeEnum, InviteStatusEnum, IteratingIndexParameterName, IteratingItemParameterName, IteratorIndexParameterName, IteratorItemParameterName, KBDocumentCategoryEnum, KBDocumentStatusEnum, KDocumentSourceType, KDocumentWebTypeEnum, KDocumentWebTypeOptions, KNOWLEDGE_DOCUMENTS_NAME, KNOWLEDGE_FOLDER_ID_NAME, KNOWLEDGE_SOURCES_NAME, KNOWLEDGE_STAGE_NAME, KnowledgeProviderEnum, KnowledgeStructureEnum, KnowledgeTask, KnowledgebaseChannel, KnowledgebasePermission, KnowledgebaseTypeEnum, LanguagesEnum, LanguagesMap, ListsInputTypeEnum, LocalAgentType, LongTermMemoryTypeEnum, MCPServerType, schema as MDX, MEMORY_PROFILE_PROMPT, MEMORY_QA_PROMPT, MinimumProjectSizeEnum, ModelEntityType, ModelFeature, ModelPropertyKey, ModelTypeEnum, OllamaEmbeddingsProviders, OpenAIEmbeddingsProviders, OrderTypeEnum, OrganizationContactBudgetTypeEnum, OrganizationDemoNetworkEnum, OrganizationPermissionsEnum, OrganizationProjectBudgetTypeEnum, OrganizationSelectInput, PLUGIN_CONFIGURATION_STATUS, PLUGIN_LEVEL, PLUGIN_SOURCE, ParameterType, ParameterTypeEnum, PayPeriodEnum, PermissionApprovalStatus, PermissionApprovalStatusTypesEnum, PermissionGroups, PermissionsEnum, PriceType, ProjectBillingEnum, ProjectOwnerEnum, ProjectStatusEnum, ProviderEnum, ProviderType, QueryStatusEnum, RegionsEnum, RequestMethodEnum, RoleTypeEnum, RolesEnum, SANDBOX_WORK_FOR_TYPES, SMTPSecureEnum, STANDARD_METADATA_FIELDS, STATE_SYS_VOLUME, STATE_SYS_WORKSPACE_PATH, STATE_SYS_WORKSPACE_URL, STATE_VARIABLE_FILES, STATE_VARIABLE_INPUT, STATE_VARIABLE_SYS, STATE_VARIABLE_TITLE_CHANNEL, ScheduleTaskStatus, SemanticModelStatusEnum, StoryStatusEnum, StoryTemplateType, SubscriptionType, TASK_DESCRIPTION_PREFIX, TASK_DESCRIPTION_SUFFIX, TENANT_AGENT_LOCAL_URL, TOOL_NAME_REGEX, TagCategoryEnum, TaskFrequency, TaskListTypeEnum, TimeGranularity, ToolParameterForm, ToolParameterType, ToolTagEnum, TranslationLanguageMap, USAGE_HOUR_FORMAT, UserType, VariableOperationEnum, VariableOperations, VectorTypeEnum, Visibility, VisitEntityEnum, VisitTypeEnum, WeekDaysEnum, WorkflowComparisonOperator, WorkflowLogicalOperator, WorkflowNodeTypeEnum, XpertAgentExecutionStatusEnum, XpertParameterTypeEnum, XpertTableStatus, XpertToolsetCategoryEnum, XpertTypeEnum, agentLabel, agentUniqueName, allChannels, appendMessageContent, appendMessagePlainText, buildChunkTree, channelName, classificateDocumentCategory, collectTreeLeaves, configurableStoreNamespace, convertToUrlPath, createAgentConnections, createMessageAppendContextTracker, createXpertGraph, createXpertNodes, embeddingCubeCollectionName, extractSemanticModelDraft, figureOutXpert, filterMessageText, findStartNodes, genJSONParseKey, genJSONStringifyKey, genListOperatorKey, genPipelineChunkerKey, genPipelineKnowledgeBaseKey, genPipelineProcessorKey, genPipelineSourceKey, genPipelineUnderstandingKey, genVariableAggregatorKey, genXpertDBDeleteKey, genXpertDBInsertKey, genXpertDBQueryKey, genXpertDBSqlKey, genXpertDBUpdateKey, genXpertIteratorKey, genXpertMiddlewareKey, genXpertSkillKey, genXpertStartKey, genXpertTriggerKey, generateCronExpression, getAgentMiddlewareNodes, getAgentVarGroup, getCurrentGraph, getEnabledTools, getStoreNamespace, getSwarmPartners, getToolCallFromConfig, getToolCallIdFromConfig, getToolLabel, getVariableSchema, getWorkflowTriggers, getWorkspaceFromRunnable, inferMessageAppendContext, isAgentKey, isAudioType, isDocumentSheet, isEnableTool, isImageType, isInterruptMessage, isIteratingKey, isIteratorKey, isMessageGroup, isMiddlewareToolEnabled, isRouterKey, isToolEnabled, isVideoType, isXpertNodeType, letterStartSUID, locateNodes, mapTranslationLanguage, messageContentText, omitXpertRelations, resolveMessageAppendContext, setStateVariable, shortTitle, stringifyMessageContent, transformInstallation, uuid, workflowNodeIdentifier, xpertLabel };
|
package/package.json
CHANGED
package/src/agent/graph.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { BaseMessage } from '@langchain/core/messages';
|
|
|
2
2
|
import { RunnableConfig } from '@langchain/core/runnables';
|
|
3
3
|
import { TMessageContentComplex } from '@xpert-ai/chatkit-types';
|
|
4
4
|
import { Subscriber } from 'rxjs';
|
|
5
|
+
import { ICopilotModel } from '../ai/copilot-model.model';
|
|
5
6
|
import { TWorkflowVarGroup } from '../ai/xpert-workflow.model';
|
|
6
7
|
import { TXpertGraph } from '../ai/xpert.model';
|
|
7
8
|
import { IXpertAgent } from '../ai/xpert-agent.model';
|
|
@@ -31,8 +32,30 @@ export type TMessageChannel = {
|
|
|
31
32
|
error?: string | null;
|
|
32
33
|
};
|
|
33
34
|
export type TSandboxConfigurable = {
|
|
35
|
+
/**
|
|
36
|
+
* Resolved sandbox provider type used for this backend acquisition.
|
|
37
|
+
*/
|
|
34
38
|
provider?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Effective working directory inside the sandbox backend.
|
|
41
|
+
*/
|
|
35
42
|
workingDirectory?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Canonical sandbox environment id that owns this backend/container.
|
|
45
|
+
*/
|
|
46
|
+
environmentId?: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Underlying runtime container id when the backend is container-backed.
|
|
49
|
+
*/
|
|
50
|
+
containerId?: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* Container lifecycle run id created for this acquisition, if a new
|
|
53
|
+
* container run was recorded.
|
|
54
|
+
*/
|
|
55
|
+
runId?: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Concrete backend instance used by the agent/runtime.
|
|
58
|
+
*/
|
|
36
59
|
backend?: unknown;
|
|
37
60
|
};
|
|
38
61
|
export type TAgentRunnableConfigurable = {
|
|
@@ -55,6 +78,7 @@ export type TAgentRunnableConfigurable = {
|
|
|
55
78
|
agentKey: string;
|
|
56
79
|
xpertName?: string;
|
|
57
80
|
toolName?: string;
|
|
81
|
+
copilotModel?: ICopilotModel;
|
|
58
82
|
subscriber: Subscriber<any>;
|
|
59
83
|
/**
|
|
60
84
|
* Execution id of agent workflow node
|
package/src/ai/chat.model.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { IStorageFile } from '../storage-file.model';
|
|
|
9
9
|
import { IXpertTask } from './xpert-task.model';
|
|
10
10
|
import { TToolCall } from '../agent';
|
|
11
11
|
import { TInterrupt } from '../agent/interrupt';
|
|
12
|
+
import { IUser } from '../user.model';
|
|
12
13
|
export type TChatConversationOptions = {
|
|
13
14
|
parameters?: {
|
|
14
15
|
input?: string;
|
|
@@ -19,8 +20,9 @@ export type TChatConversationOptions = {
|
|
|
19
20
|
features?: Array<'timeline' | 'sandbox' | 'files'>;
|
|
20
21
|
workspacePath?: string;
|
|
21
22
|
workspaceUrl?: string;
|
|
23
|
+
sandboxEnvironmentId?: string;
|
|
22
24
|
};
|
|
23
|
-
export type TChatConversationStatus =
|
|
25
|
+
export type TChatConversationStatus = 'idle' | 'busy' | 'interrupted' | 'error';
|
|
24
26
|
export type TToolCallType = 'agent' | 'tool';
|
|
25
27
|
export type TChatFrom = 'platform' | 'webapp' | 'debugger' | 'knowledge' | 'job' | 'api' | 'feishu' | 'lark' | 'dingtalk' | 'wecom';
|
|
26
28
|
/**
|
|
@@ -90,6 +92,10 @@ export interface IChatConversation extends IBasePerTenantAndOrganizationEntityMo
|
|
|
90
92
|
* End anonymous user
|
|
91
93
|
*/
|
|
92
94
|
fromEndUserId?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Internal user matched by fromEndUserId when available
|
|
97
|
+
*/
|
|
98
|
+
fromEndUser?: IUser;
|
|
93
99
|
/**
|
|
94
100
|
* Chat with Xpert
|
|
95
101
|
*/
|
package/src/ai/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from '@xpert-ai/chatkit-types';
|
|
2
|
+
export type { TChatRequest } from './xpert-chat.model';
|
|
2
3
|
export * from './ai-model.model';
|
|
3
4
|
export * from './ai.model';
|
|
4
5
|
export * from './chat.model';
|
|
@@ -21,6 +22,7 @@ export * from './knowledge-doc-page.model';
|
|
|
21
22
|
export * from './role-permissions';
|
|
22
23
|
export * from './xpert-agent-execution.model';
|
|
23
24
|
export * from './xpert-agent.model';
|
|
25
|
+
export * from './xpert-chat.model';
|
|
24
26
|
export * from './xpert-tool.model';
|
|
25
27
|
export * from './xpert-toolset.model';
|
|
26
28
|
export * from './xpert-workspace.model';
|
package/src/ai/sandbox.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { I18nObject, IconDefinition } from
|
|
1
|
+
import { I18nObject, IconDefinition } from '../types';
|
|
2
2
|
export type TSandboxProviderMeta = {
|
|
3
3
|
name: I18nObject;
|
|
4
4
|
description?: I18nObject;
|
|
5
5
|
icon: IconDefinition;
|
|
6
6
|
};
|
|
7
|
+
export declare const SANDBOX_WORK_FOR_TYPES: readonly ["user", "project", "environment"];
|
|
8
|
+
export type TSandboxWorkForType = (typeof SANDBOX_WORK_FOR_TYPES)[number];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { STATE_VARIABLE_HUMAN, TChatRequestHuman, TInterruptCommand } from '@xpert-ai/chatkit-types';
|
|
2
1
|
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
3
2
|
import { ICopilotModel, TCopilotModel } from './copilot-model.model';
|
|
4
3
|
import { IKnowledgebase, TKBRecallParams } from './knowledgebase.model';
|
|
@@ -138,7 +137,7 @@ export type TXpertAgentOptions = {
|
|
|
138
137
|
* - *jsonSchema*
|
|
139
138
|
*
|
|
140
139
|
*/
|
|
141
|
-
structuredOutputMethod?:
|
|
140
|
+
structuredOutputMethod?: 'functionCalling' | 'jsonMode' | 'jsonSchema' | string;
|
|
142
141
|
/**
|
|
143
142
|
* @deprecated use attachment
|
|
144
143
|
*/
|
|
@@ -178,41 +177,14 @@ export type TAgentPromptTemplate = {
|
|
|
178
177
|
};
|
|
179
178
|
export type TAgentOutputVariable = TXpertParameter & {
|
|
180
179
|
/**
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
* value write to state's variable
|
|
181
|
+
*/
|
|
183
182
|
variableSelector: string;
|
|
184
183
|
/**
|
|
185
184
|
* How to write value to variable
|
|
186
185
|
*/
|
|
187
186
|
operation: 'append' | 'extends' | 'overwrite' | 'clear';
|
|
188
187
|
};
|
|
189
|
-
/**
|
|
190
|
-
* @deprecated use TChatRequest
|
|
191
|
-
*/
|
|
192
|
-
export type TChatAgentParams = {
|
|
193
|
-
/**
|
|
194
|
-
* @deprecated use state instead
|
|
195
|
-
*/
|
|
196
|
-
input?: {
|
|
197
|
-
input?: string;
|
|
198
|
-
[key: string]: unknown;
|
|
199
|
-
};
|
|
200
|
-
state: {
|
|
201
|
-
[STATE_VARIABLE_HUMAN]: TChatRequestHuman;
|
|
202
|
-
[key: string]: any;
|
|
203
|
-
};
|
|
204
|
-
agentKey: string;
|
|
205
|
-
xpertId: string;
|
|
206
|
-
executionId?: string;
|
|
207
|
-
environmentId?: string;
|
|
208
|
-
/**
|
|
209
|
-
*/
|
|
210
|
-
command?: TInterruptCommand;
|
|
211
|
-
/**
|
|
212
|
-
* Reject the sensitive tool calls
|
|
213
|
-
*/
|
|
214
|
-
reject?: boolean;
|
|
215
|
-
};
|
|
216
188
|
export declare function agentLabel(agent: Partial<IXpertAgent>): string;
|
|
217
189
|
export declare function agentUniqueName(agent: IXpertAgent): string;
|
|
218
190
|
export declare function convertToUrlPath(title: string): string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { STATE_VARIABLE_HUMAN, TChatRequestHuman, TInterruptCommand } from '@xpert-ai/chatkit-types';
|
|
2
|
+
export type TXpertChatState = {
|
|
3
|
+
[STATE_VARIABLE_HUMAN]?: TChatRequestHuman;
|
|
4
|
+
} & Record<string, any>;
|
|
5
|
+
export type TXpertChatResumeDecision = {
|
|
6
|
+
type: 'confirm' | 'reject';
|
|
7
|
+
payload?: unknown;
|
|
8
|
+
};
|
|
9
|
+
export type TXpertChatInterruptPatch = Pick<TInterruptCommand, 'agentKey' | 'toolCalls' | 'update'>;
|
|
10
|
+
export type TXpertChatTarget = {
|
|
11
|
+
aiMessageId?: string;
|
|
12
|
+
executionId?: string;
|
|
13
|
+
};
|
|
14
|
+
export type TXpertChatSource = {
|
|
15
|
+
aiMessageId?: string;
|
|
16
|
+
executionId?: string;
|
|
17
|
+
};
|
|
18
|
+
export type TXpertChatSendRequest = {
|
|
19
|
+
action: 'send';
|
|
20
|
+
conversationId?: string;
|
|
21
|
+
projectId?: string;
|
|
22
|
+
environmentId?: string;
|
|
23
|
+
sandboxEnvironmentId?: string;
|
|
24
|
+
message: {
|
|
25
|
+
clientMessageId?: string;
|
|
26
|
+
input: TChatRequestHuman;
|
|
27
|
+
};
|
|
28
|
+
state?: TXpertChatState;
|
|
29
|
+
};
|
|
30
|
+
export type TXpertChatResumeRequest = {
|
|
31
|
+
action: 'resume';
|
|
32
|
+
conversationId: string;
|
|
33
|
+
target: TXpertChatTarget;
|
|
34
|
+
decision: TXpertChatResumeDecision;
|
|
35
|
+
patch?: TXpertChatInterruptPatch;
|
|
36
|
+
state?: TXpertChatState;
|
|
37
|
+
};
|
|
38
|
+
export type TXpertChatRetryRequest = {
|
|
39
|
+
action: 'retry';
|
|
40
|
+
conversationId: string;
|
|
41
|
+
source: TXpertChatSource;
|
|
42
|
+
environmentId?: string;
|
|
43
|
+
};
|
|
44
|
+
export type TChatRequest = TXpertChatSendRequest | TXpertChatResumeRequest | TXpertChatRetryRequest;
|
|
45
|
+
export type TXpertAgentChatRunRequest = {
|
|
46
|
+
action: 'run';
|
|
47
|
+
state: TXpertChatState;
|
|
48
|
+
agentKey: string;
|
|
49
|
+
xpertId: string;
|
|
50
|
+
environmentId?: string;
|
|
51
|
+
};
|
|
52
|
+
export type TXpertAgentChatResumeRequest = {
|
|
53
|
+
action: 'resume';
|
|
54
|
+
agentKey: string;
|
|
55
|
+
xpertId: string;
|
|
56
|
+
target: {
|
|
57
|
+
executionId: string;
|
|
58
|
+
};
|
|
59
|
+
decision: TXpertChatResumeDecision;
|
|
60
|
+
patch?: TXpertChatInterruptPatch;
|
|
61
|
+
environmentId?: string;
|
|
62
|
+
state?: TXpertChatState;
|
|
63
|
+
};
|
|
64
|
+
export type TXpertAgentChatRequest = TXpertAgentChatRunRequest | TXpertAgentChatResumeRequest;
|
|
@@ -65,6 +65,9 @@ export interface IXpertProjectTaskLog extends IBasePerXpertProjectEntityModel {
|
|
|
65
65
|
logType: 'input' | 'output' | 'error';
|
|
66
66
|
content: string;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated use CodeXpert instead
|
|
70
|
+
*/
|
|
68
71
|
export interface IXpertProjectVCS extends IBasePerXpertProjectEntityModel {
|
|
69
72
|
integrationId?: string;
|
|
70
73
|
integration?: IIntegration;
|
package/src/ai/xpert.model.d.ts
CHANGED
|
@@ -475,7 +475,7 @@ export type TChatOptions = {
|
|
|
475
475
|
*/
|
|
476
476
|
environment?: IEnvironment;
|
|
477
477
|
/**
|
|
478
|
-
*
|
|
478
|
+
* Specify a sandbox environment container to run in
|
|
479
479
|
*/
|
|
480
480
|
sandboxEnvironmentId?: string;
|
|
481
481
|
/**
|
|
@@ -488,7 +488,7 @@ export type TChatOptions = {
|
|
|
488
488
|
*/
|
|
489
489
|
export type TKBRetrievalSettings = {
|
|
490
490
|
metadata: {
|
|
491
|
-
filtering_mode:
|
|
491
|
+
filtering_mode: 'disabled' | 'automatic' | 'manual';
|
|
492
492
|
/**
|
|
493
493
|
* Conditions (filter) when mode is manual
|
|
494
494
|
*/
|
package/src/plugin.d.ts
CHANGED
|
@@ -6,12 +6,27 @@ export declare const PLUGIN_LEVEL: {
|
|
|
6
6
|
readonly SYSTEM: "system";
|
|
7
7
|
readonly ORGANIZATION: "organization";
|
|
8
8
|
};
|
|
9
|
+
export declare const PLUGIN_SOURCE: {
|
|
10
|
+
readonly MARKETPLACE: "marketplace";
|
|
11
|
+
readonly LOCAL: "local";
|
|
12
|
+
readonly GIT: "git";
|
|
13
|
+
readonly URL: "url";
|
|
14
|
+
readonly NPM: "npm";
|
|
15
|
+
readonly CODE: "code";
|
|
16
|
+
readonly ENV: "env";
|
|
17
|
+
};
|
|
18
|
+
export declare const PLUGIN_CONFIGURATION_STATUS: {
|
|
19
|
+
readonly VALID: "valid";
|
|
20
|
+
readonly INVALID: "invalid";
|
|
21
|
+
};
|
|
9
22
|
/**
|
|
10
23
|
* Classifies plugin scope and governance.
|
|
11
24
|
* - `system`: built-in/platform-managed plugin that users cannot install/uninstall from org APIs.
|
|
12
25
|
* - `organization`: tenant/org-managed plugin that can be installed and removed per organization.
|
|
13
26
|
*/
|
|
14
27
|
export type PluginLevel = (typeof PLUGIN_LEVEL)[keyof typeof PLUGIN_LEVEL];
|
|
28
|
+
export type PluginSource = (typeof PLUGIN_SOURCE)[keyof typeof PLUGIN_SOURCE];
|
|
29
|
+
export type PluginConfigurationStatus = (typeof PLUGIN_CONFIGURATION_STATUS)[keyof typeof PLUGIN_CONFIGURATION_STATUS];
|
|
15
30
|
export interface PluginMeta {
|
|
16
31
|
name: PluginName;
|
|
17
32
|
version: string;
|
|
@@ -31,21 +46,33 @@ export interface IPlugin extends IBasePerTenantAndOrganizationEntityModel {
|
|
|
31
46
|
pluginName: string;
|
|
32
47
|
packageName: string;
|
|
33
48
|
version?: string;
|
|
34
|
-
source?:
|
|
49
|
+
source?: PluginSource;
|
|
35
50
|
level?: PluginLevel;
|
|
36
51
|
config: Record<string, any>;
|
|
52
|
+
configurationStatus?: PluginConfigurationStatus | null;
|
|
53
|
+
configurationError?: string | null;
|
|
37
54
|
}
|
|
38
55
|
export interface IPluginDescriptor {
|
|
39
56
|
organizationId?: string;
|
|
40
57
|
name: PluginName;
|
|
41
58
|
meta: PluginMeta;
|
|
59
|
+
packageName?: string;
|
|
60
|
+
source?: PluginSource;
|
|
61
|
+
currentVersion?: string;
|
|
62
|
+
latestVersion?: string;
|
|
42
63
|
isGlobal: boolean;
|
|
43
64
|
level: PluginLevel;
|
|
44
65
|
canConfigure?: boolean;
|
|
66
|
+
canUpdate?: boolean;
|
|
67
|
+
hasUpdate?: boolean;
|
|
45
68
|
configSchema?: JsonSchemaObjectType;
|
|
69
|
+
configurationStatus?: PluginConfigurationStatus | null;
|
|
70
|
+
configurationError?: string | null;
|
|
46
71
|
}
|
|
47
72
|
export interface IPluginConfiguration<TConfig extends Record<string, any> = Record<string, any>> {
|
|
48
73
|
pluginName: PluginName;
|
|
49
74
|
config: TConfig;
|
|
50
75
|
configSchema?: JsonSchemaObjectType;
|
|
76
|
+
configurationStatus?: PluginConfigurationStatus | null;
|
|
77
|
+
configurationError?: string | null;
|
|
51
78
|
}
|