@xpert-ai/contracts 3.9.1 → 3.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var ShortUniqueId = require('short-unique-id');
4
+ var chatkitTypes = require('@xpert-ai/chatkit-types');
4
5
 
5
6
  function _array_like_to_array$7(arr, len) {
6
7
  if (len == null || len > arr.length) len = arr.length;
@@ -1920,7 +1921,6 @@ function _object_spread$7(target) {
1920
1921
  }
1921
1922
  var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
1922
1923
  var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
1923
- var CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = "follow_up_consumed";
1924
1924
  function createConversationTitleSummaryEvent(event) {
1925
1925
  return _object_spread$7({
1926
1926
  type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
@@ -1928,7 +1928,7 @@ function createConversationTitleSummaryEvent(event) {
1928
1928
  }
1929
1929
  function createFollowUpConsumedEvent(event) {
1930
1930
  return _object_spread$7({
1931
- type: CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED
1931
+ type: chatkitTypes.CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED
1932
1932
  }, event);
1933
1933
  }
1934
1934
 
@@ -2606,6 +2606,13 @@ exports.KnowledgebaseTypeEnum = void 0;
2606
2606
  KnowledgebaseTypeEnum["Standard"] = "standard";
2607
2607
  KnowledgebaseTypeEnum["External"] = "external";
2608
2608
  })(exports.KnowledgebaseTypeEnum || (exports.KnowledgebaseTypeEnum = {}));
2609
+ exports.KnowledgebaseStatusEnum = void 0;
2610
+ (function(KnowledgebaseStatusEnum) {
2611
+ KnowledgebaseStatusEnum["READY"] = "ready";
2612
+ KnowledgebaseStatusEnum["REBUILD_REQUIRED"] = "rebuild_required";
2613
+ KnowledgebaseStatusEnum["REBUILDING"] = "rebuilding";
2614
+ KnowledgebaseStatusEnum["REBUILD_FAILED"] = "rebuild_failed";
2615
+ })(exports.KnowledgebaseStatusEnum || (exports.KnowledgebaseStatusEnum = {}));
2609
2616
  exports.KnowledgeStructureEnum = void 0;
2610
2617
  (function(KnowledgeStructureEnum) {
2611
2618
  KnowledgeStructureEnum["General"] = "general";
@@ -3818,6 +3825,9 @@ function isMiddlewareToolEnabled(config) {
3818
3825
  }
3819
3826
  return (config === null || config === void 0 ? void 0 : config.enabled) !== false;
3820
3827
  }
3828
+ function isRequiredMiddleware(entity) {
3829
+ return (entity === null || entity === void 0 ? void 0 : entity.required) === true;
3830
+ }
3821
3831
  function genXpertMiddlewareKey() {
3822
3832
  return letterStartSUID("Middleware_");
3823
3833
  }
@@ -5403,11 +5413,14 @@ var PLUGIN_LOAD_STATUS = {
5403
5413
  FAILED: "failed"
5404
5414
  };
5405
5415
 
5416
+ Object.defineProperty(exports, "CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED", {
5417
+ enumerable: true,
5418
+ get: function () { return chatkitTypes.CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED; }
5419
+ });
5406
5420
  exports.AI_MODEL_TYPE_VARIABLE = AI_MODEL_TYPE_VARIABLE;
5407
5421
  exports.API_PRINCIPAL_USER_ID_HEADER = API_PRINCIPAL_USER_ID_HEADER;
5408
5422
  exports.Attachment_Type_Options = Attachment_Type_Options;
5409
5423
  exports.CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY;
5410
- exports.CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED;
5411
5424
  exports.CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE;
5412
5425
  exports.CONTEXT_COMPRESSION_COMPONENT_TYPE = CONTEXT_COMPRESSION_COMPONENT_TYPE;
5413
5426
  exports.CONTEXT_COMPRESSION_MIDDLEWARE_NAME = CONTEXT_COMPRESSION_MIDDLEWARE_NAME;
@@ -5555,6 +5568,7 @@ exports.isIteratingKey = isIteratingKey;
5555
5568
  exports.isIteratorKey = isIteratorKey;
5556
5569
  exports.isMessageGroup = isMessageGroup;
5557
5570
  exports.isMiddlewareToolEnabled = isMiddlewareToolEnabled;
5571
+ exports.isRequiredMiddleware = isRequiredMiddleware;
5558
5572
  exports.isRouterKey = isRouterKey;
5559
5573
  exports.isSystemManagedAssistant = isSystemManagedAssistant;
5560
5574
  exports.isTenantSharedXpertWorkspace = isTenantSharedXpertWorkspace;
package/index.esm.js CHANGED
@@ -1,4 +1,6 @@
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';
2
4
 
3
5
  function _array_like_to_array$7(arr, len) {
4
6
  if (len == null || len > arr.length) len = arr.length;
@@ -1918,7 +1920,6 @@ function _object_spread$7(target) {
1918
1920
  }
1919
1921
  var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
1920
1922
  var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
1921
- var CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = "follow_up_consumed";
1922
1923
  function createConversationTitleSummaryEvent(event) {
1923
1924
  return _object_spread$7({
1924
1925
  type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
@@ -2604,6 +2605,13 @@ var KnowledgebaseTypeEnum;
2604
2605
  KnowledgebaseTypeEnum["Standard"] = "standard";
2605
2606
  KnowledgebaseTypeEnum["External"] = "external";
2606
2607
  })(KnowledgebaseTypeEnum || (KnowledgebaseTypeEnum = {}));
2608
+ var KnowledgebaseStatusEnum;
2609
+ (function(KnowledgebaseStatusEnum) {
2610
+ KnowledgebaseStatusEnum["READY"] = "ready";
2611
+ KnowledgebaseStatusEnum["REBUILD_REQUIRED"] = "rebuild_required";
2612
+ KnowledgebaseStatusEnum["REBUILDING"] = "rebuilding";
2613
+ KnowledgebaseStatusEnum["REBUILD_FAILED"] = "rebuild_failed";
2614
+ })(KnowledgebaseStatusEnum || (KnowledgebaseStatusEnum = {}));
2607
2615
  var KnowledgeStructureEnum;
2608
2616
  (function(KnowledgeStructureEnum) {
2609
2617
  KnowledgeStructureEnum["General"] = "general";
@@ -3816,6 +3824,9 @@ function isMiddlewareToolEnabled(config) {
3816
3824
  }
3817
3825
  return (config === null || config === void 0 ? void 0 : config.enabled) !== false;
3818
3826
  }
3827
+ function isRequiredMiddleware(entity) {
3828
+ return (entity === null || entity === void 0 ? void 0 : entity.required) === true;
3829
+ }
3819
3830
  function genXpertMiddlewareKey() {
3820
3831
  return letterStartSUID("Middleware_");
3821
3832
  }
@@ -5401,4 +5412,4 @@ var PLUGIN_LOAD_STATUS = {
5401
5412
  FAILED: "failed"
5402
5413
  };
5403
5414
 
5404
- 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, 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, 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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/contracts",
3
- "version": "3.9.1",
3
+ "version": "3.9.3",
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.0.17"
22
+ "@xpert-ai/chatkit-types": "^0.2.3"
23
23
  },
24
24
  "types": "./index.d.ts"
25
25
  }
@@ -1,18 +1,9 @@
1
- import type { TChatEventMessage } from '@xpert-ai/chatkit-types';
1
+ import { type TFollowUpConsumedEvent, type TChatEventMessage } from '@xpert-ai/chatkit-types';
2
2
  export declare const CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE: "thread_context_usage";
3
3
  export declare const CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY: "conversation_title_summary";
4
- export declare const CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED: "follow_up_consumed";
5
4
  export type TConversationTitleSummaryEvent = TChatEventMessage & {
6
5
  id?: string;
7
6
  type: typeof CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY;
8
7
  };
9
- export type TFollowUpConsumedEvent = TChatEventMessage & {
10
- type: typeof CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED;
11
- mode: 'queue' | 'steer';
12
- messageIds: string[];
13
- clientMessageIds?: string[];
14
- executionId?: string | null;
15
- visibleAt?: string | null;
16
- };
17
8
  export declare function createConversationTitleSummaryEvent(event: Omit<TConversationTitleSummaryEvent, 'type'>): TConversationTitleSummaryEvent;
18
9
  export declare function createFollowUpConsumedEvent(event: Omit<TFollowUpConsumedEvent, 'type'>): TFollowUpConsumedEvent;
@@ -1,5 +1,5 @@
1
1
  import { MessageType } from '@langchain/core/messages';
2
- import type { TChatMessageStep, TMessageContent, TMessageContentReasoning } from '@xpert-ai/chatkit-types';
2
+ import type { ChatKitReference, ChatKitReferenceBase, TChatMessageStep, TMessageContent, TMessageContentReasoning } from '@xpert-ai/chatkit-types';
3
3
  import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
4
4
  import { IChatConversation } from './chat.model';
5
5
  import { LongTermMemoryTypeEnum } from './xpert.model';
@@ -12,50 +12,6 @@ export type TSummaryJob = Record<LongTermMemoryTypeEnum, {
12
12
  progress?: number;
13
13
  memoryKey?: string;
14
14
  }>;
15
- /**
16
- * @deprecated Temporary duplicate of `ChatKitReferenceBase` from `@xpert-ai/chatkit-types`.
17
- * Use the shared chatkit type once that package release is available to contracts.
18
- */
19
- export type TChatReferenceBase = {
20
- id?: string;
21
- label?: string;
22
- text: string;
23
- };
24
- /**
25
- * @deprecated Temporary duplicate of `ChatKitCodeReference` from `@xpert-ai/chatkit-types`.
26
- * Use the shared chatkit type once that package release is available to contracts.
27
- */
28
- export type TChatCodeReference = TChatReferenceBase & {
29
- type: 'code';
30
- path: string;
31
- startLine: number;
32
- endLine: number;
33
- language?: string;
34
- taskId?: string;
35
- };
36
- /**
37
- * @deprecated Temporary duplicate of `ChatKitQuoteReference` from `@xpert-ai/chatkit-types`.
38
- * Use the shared chatkit type once that package release is available to contracts.
39
- */
40
- export type TChatQuoteReference = TChatReferenceBase & {
41
- type: 'quote';
42
- messageId?: string;
43
- source?: string;
44
- };
45
- /**
46
- * @deprecated Temporary duplicate of `ChatKitImageReference` from `@xpert-ai/chatkit-types`.
47
- * Use the shared chatkit type once that package release is available to contracts.
48
- */
49
- export type TChatImageReference = TChatReferenceBase & {
50
- type: 'image';
51
- fileId?: string;
52
- url?: string;
53
- mimeType?: string;
54
- name?: string;
55
- size?: number;
56
- width?: number;
57
- height?: number;
58
- };
59
15
  export type TChatElementAttribute = {
60
16
  name: string;
61
17
  value: string;
@@ -70,13 +26,32 @@ export type TChatElementReferenceFields = {
70
26
  serviceId: string;
71
27
  tagName: string;
72
28
  };
29
+ export type TChatFileElementReferenceFields = {
30
+ attributes: TChatElementAttribute[];
31
+ documentTitle?: string;
32
+ domPath: string;
33
+ filePath: string;
34
+ outerHtml: string;
35
+ role?: string;
36
+ selector: string;
37
+ sourceEndLine?: number;
38
+ sourceStartLine?: number;
39
+ tagName: string;
40
+ text: string;
41
+ };
73
42
  export type TChatElementReferenceCandidateFields = {
74
43
  [Property in keyof TChatElementReferenceFields]?: unknown;
75
44
  };
76
- export type TChatElementReference = TChatReferenceBase & TChatElementReferenceFields & {
45
+ export type TChatFileElementReferenceCandidateFields = {
46
+ [Property in keyof TChatFileElementReferenceFields]?: unknown;
47
+ };
48
+ export type TChatElementReference = ChatKitReferenceBase & TChatElementReferenceFields & {
77
49
  type: 'element';
78
50
  };
79
- export type TChatReference = TChatCodeReference | TChatQuoteReference | TChatImageReference | TChatElementReference;
51
+ export type TChatFileElementReference = ChatKitReferenceBase & TChatFileElementReferenceFields & {
52
+ type: 'file_element';
53
+ };
54
+ export type TChatReference = ChatKitReference | TChatElementReference | TChatFileElementReference;
80
55
  /**
81
56
  * Chat message entity type
82
57
  */
@@ -10,6 +10,7 @@ import { IXpertTask } from './xpert-task.model';
10
10
  import { TToolCall } from '../agent';
11
11
  import { TInterrupt } from '../agent/interrupt';
12
12
  import { IUser } from '../user.model';
13
+ import type { RuntimeCapabilitiesSelection } from '@xpert-ai/chatkit-types';
13
14
  export type TChatConversationOptions = {
14
15
  parameters?: {
15
16
  input?: string;
@@ -21,6 +22,7 @@ export type TChatConversationOptions = {
21
22
  workspacePath?: string;
22
23
  workspaceUrl?: string;
23
24
  sandboxEnvironmentId?: string;
25
+ runtimeCapabilities?: RuntimeCapabilitiesSelection;
24
26
  };
25
27
  export type TChatConversationStatus = 'idle' | 'busy' | 'interrupted' | 'error';
26
28
  export type TToolCallType = 'agent' | 'tool';
package/src/ai/index.d.ts CHANGED
@@ -34,6 +34,7 @@ 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';
37
38
  export type { TChatRequest } from './xpert-chat.model';
38
39
  export * from './assistant-binding.model';
39
40
  export * from './ai-model.model';
@@ -150,6 +150,7 @@ export type TKnowledgeDocument = {
150
150
  processMsg?: string | null;
151
151
  processBeginAt?: Date | null;
152
152
  processDuation?: number | null;
153
+ processDuration?: number | null;
153
154
  /**
154
155
  * is it validate (0: wasted,1: validate)
155
156
  */
@@ -87,15 +87,15 @@ export interface IWFNKnowledgeBase extends IWorkflowNode {
87
87
  */
88
88
  inputs?: string[];
89
89
  /**
90
- * Embedding model
90
+ * @deprecated Configure embedding model on the knowledgebase.
91
91
  */
92
92
  copilotModel?: ICopilotModel;
93
93
  /**
94
- * (optional) Rerank model
94
+ * @deprecated Configure rerank model on the knowledgebase.
95
95
  */
96
96
  rerankModel?: ICopilotModel;
97
97
  /**
98
- * (optional) Vision model
98
+ * @deprecated Configure vision model on the knowledgebase.
99
99
  */
100
100
  visionModel?: ICopilotModel;
101
101
  documents?: string[];
@@ -15,6 +15,12 @@ export declare enum KnowledgebaseTypeEnum {
15
15
  Standard = "standard",
16
16
  External = "external"
17
17
  }
18
+ export declare enum KnowledgebaseStatusEnum {
19
+ READY = "ready",
20
+ REBUILD_REQUIRED = "rebuild_required",
21
+ REBUILDING = "rebuilding",
22
+ REBUILD_FAILED = "rebuild_failed"
23
+ }
18
24
  export declare enum KnowledgeStructureEnum {
19
25
  General = "general",
20
26
  ParentChild = "parent-child",
@@ -61,6 +67,18 @@ export type TKnowledgebase = {
61
67
  */
62
68
  copilotModel?: ICopilotModel;
63
69
  copilotModelId?: string;
70
+ embeddingCollectionName?: string | null;
71
+ embeddingModelFingerprint?: string | null;
72
+ embeddingDimensions?: number | null;
73
+ embeddingRevision?: number | null;
74
+ pendingCopilotModel?: ICopilotModel | null;
75
+ pendingCopilotModelId?: string | null;
76
+ pendingEmbeddingCollectionName?: string | null;
77
+ pendingEmbeddingModelFingerprint?: string | null;
78
+ pendingEmbeddingDimensions?: number | null;
79
+ pendingEmbeddingRevision?: number | null;
80
+ rebuildTaskId?: string | null;
81
+ embeddingRebuildError?: string | null;
64
82
  rerankModel?: ICopilotModel;
65
83
  rerankModelId?: string;
66
84
  visionModel?: ICopilotModel;
@@ -88,7 +106,7 @@ export type TKnowledgebase = {
88
106
  * Recall params for kb chunks
89
107
  */
90
108
  recall?: TKBRecallParams;
91
- status?: string;
109
+ status?: KnowledgebaseStatusEnum;
92
110
  /**
93
111
  * Metadata custom field definition array
94
112
  */
@@ -7,6 +7,10 @@ export declare const CONTEXT_COMPRESSION_MIDDLEWARE_NAME = "ContextCompressionMi
7
7
  export interface IWFNMiddleware extends IWorkflowNode {
8
8
  type: WorkflowNodeTypeEnum.MIDDLEWARE;
9
9
  provider: string;
10
+ /**
11
+ * Required middlewares are always loaded at runtime and hidden from user-facing runtime selectors.
12
+ */
13
+ required?: boolean;
10
14
  options?: Record<string, any>;
11
15
  tools?: Record<string, TMiddlewareToolConfig | boolean>;
12
16
  }
@@ -14,6 +18,7 @@ export type TMiddlewareToolConfig = {
14
18
  enabled?: boolean;
15
19
  };
16
20
  export declare function isMiddlewareToolEnabled(config?: TMiddlewareToolConfig | boolean): boolean;
21
+ export declare function isRequiredMiddleware(entity?: Pick<IWFNMiddleware, 'required'> | null): boolean;
17
22
  export declare function genXpertMiddlewareKey(): string;
18
23
  export declare function normalizeMiddlewareProvider(provider?: string | null): string;
19
24
  export declare function normalizeMiddlewareNode<T extends TXpertTeamNode>(node: T): T;
@@ -82,7 +82,7 @@ export interface IXpertProjectVCS extends IBasePerXpertProjectEntityModel {
82
82
  /**
83
83
  * @deprecated Use `attachments`
84
84
  */
85
- export interface IXpertProjectFile extends IBasePerXpertProjectEntityModel, Omit<TFile, 'createdAt'> {
85
+ export interface IXpertProjectFile extends IBasePerXpertProjectEntityModel, Omit<TFile, 'createdAt' | 'updatedAt'> {
86
86
  }
87
87
  export type TXpertProjectDSL = IXpertProject & {
88
88
  xperts?: TXpertTeamDraft[];
@@ -76,6 +76,13 @@ export type TXpertFeatures = {
76
76
  title?: TXpertTitleFeature;
77
77
  };
78
78
  export type TXpertFeatureKey = keyof TXpertFeatures;
79
+ export type TXpertExportedTemplate = {
80
+ id: string;
81
+ filePath: string;
82
+ exportedAt: string;
83
+ isDraft: boolean;
84
+ includeMemory: boolean;
85
+ };
79
86
  export type TXpert = {
80
87
  /**
81
88
  * Unique slug identifier, generated from name
@@ -139,6 +146,7 @@ export type TXpert = {
139
146
  * Release notes
140
147
  */
141
148
  releaseNotes?: string;
149
+ exportedTemplate?: TXpertExportedTemplate | null;
142
150
  /**
143
151
  * Draft on current version
144
152
  */
@@ -458,6 +466,11 @@ export interface TXpertTeamConnection {
458
466
  * - others: Vertical Process, agent
459
467
  */
460
468
  type: 'edge' | TXpertTeamNodeType;
469
+ /**
470
+ * Runtime selection behavior for selectable connections.
471
+ * For sub-agent connections, omitted means required.
472
+ */
473
+ required?: boolean;
461
474
  readonly?: boolean;
462
475
  }
463
476
  export type TChatOptions = {
@@ -35,6 +35,7 @@ export declare function omitXpertRelations(xpert: Partial<IXpert>): {
35
35
  version?: string;
36
36
  latest?: boolean;
37
37
  releaseNotes?: string;
38
+ exportedTemplate?: import("./xpert.model").TXpertExportedTemplate | null;
38
39
  graph?: import("./xpert.model").TXpertGraph;
39
40
  api?: import("./xpert.model").TChatApi;
40
41
  app?: import("./xpert.model").TChatApp;
@@ -7,6 +7,7 @@ export type TFile = _TFile & {
7
7
  description?: string;
8
8
  size?: number;
9
9
  createdAt?: Date;
10
+ updatedAt?: Date;
10
11
  storageFileId?: string;
11
12
  };
12
13
  export interface IStorageFile extends IBasePerTenantAndOrganizationEntityModel {