@xpert-ai/contracts 3.9.9 → 3.10.1

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
@@ -1557,6 +1557,13 @@ function _define_property$9(obj, key, value) {
1557
1557
  }
1558
1558
  return obj;
1559
1559
  }
1560
+ function _instanceof(left, right) {
1561
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1562
+ return !!right[Symbol.hasInstance](left);
1563
+ } else {
1564
+ return left instanceof right;
1565
+ }
1566
+ }
1560
1567
  function _object_spread$8(target) {
1561
1568
  for(var i = 1; i < arguments.length; i++){
1562
1569
  var source = arguments[i] != null ? arguments[i] : {};
@@ -1575,6 +1582,8 @@ function _object_spread$8(target) {
1575
1582
  var CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = "follow_up_consumed";
1576
1583
  var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
1577
1584
  var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
1585
+ var CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED = "thread_goal_updated";
1586
+ var CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED = "thread_goal_cleared";
1578
1587
  function createConversationTitleSummaryEvent(event) {
1579
1588
  return _object_spread$8({
1580
1589
  type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
@@ -1585,6 +1594,36 @@ function createFollowUpConsumedEvent(event) {
1585
1594
  type: CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED
1586
1595
  }, event);
1587
1596
  }
1597
+ function createThreadGoalUpdatedEvent(goal) {
1598
+ var updatedAt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new Date();
1599
+ return {
1600
+ type: CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED,
1601
+ conversationId: goal.conversationId,
1602
+ threadId: goal.threadId,
1603
+ goal: goal,
1604
+ updatedAt: toIsoString(updatedAt)
1605
+ };
1606
+ }
1607
+ function createThreadGoalClearedEvent(event) {
1608
+ return {
1609
+ type: CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED,
1610
+ conversationId: event.conversationId,
1611
+ threadId: event.threadId,
1612
+ updatedAt: toIsoString(event.updatedAt)
1613
+ };
1614
+ }
1615
+ function toIsoString(value) {
1616
+ if (_instanceof(value, Date)) {
1617
+ return value.toISOString();
1618
+ }
1619
+ if (typeof value === "string") {
1620
+ var date = new Date(value);
1621
+ if (!Number.isNaN(date.getTime())) {
1622
+ return date.toISOString();
1623
+ }
1624
+ }
1625
+ return new Date().toISOString();
1626
+ }
1588
1627
 
1589
1628
  function _array_like_to_array$6(arr, len) {
1590
1629
  if (len == null || len > arr.length) len = arr.length;
@@ -2058,6 +2097,19 @@ exports.PriceType = void 0;
2058
2097
  PriceType["OUTPUT"] = "output";
2059
2098
  })(exports.PriceType || (exports.PriceType = {}));
2060
2099
 
2100
+ var THREAD_GOAL_STATUS_VALUES = [
2101
+ "active",
2102
+ "paused",
2103
+ "blocked",
2104
+ // Reserved for future usage-quota enforcement. No backend path emits this status yet.
2105
+ "usage_limited",
2106
+ "budget_limited",
2107
+ "complete"
2108
+ ];
2109
+ function isRunnableThreadGoalStatus(status) {
2110
+ return status === "active";
2111
+ }
2112
+
2061
2113
  /**
2062
2114
  * @deprecated use ChatMessageEventTypeEnum
2063
2115
  */ exports.ChatGatewayEvent = void 0;
@@ -4050,6 +4102,9 @@ function normalizeMiddlewareNodes(nodes) {
4050
4102
  return normalizeMiddlewareNode(node);
4051
4103
  });
4052
4104
  }
4105
+ function isUserAddableAgentMiddleware(meta) {
4106
+ return (meta === null || meta === void 0 ? void 0 : meta.builtin) !== true;
4107
+ }
4053
4108
  var normalizeNodeKey = function(key) {
4054
4109
  var _key_split;
4055
4110
  return key === null || key === void 0 ? void 0 : (_key_split = key.split("/")) === null || _key_split === void 0 ? void 0 : _key_split[0];
@@ -5598,6 +5653,8 @@ exports.Attachment_Type_Options = Attachment_Type_Options;
5598
5653
  exports.CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY;
5599
5654
  exports.CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED;
5600
5655
  exports.CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE;
5656
+ exports.CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED = CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED;
5657
+ exports.CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED = CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED;
5601
5658
  exports.CONTEXT_COMPRESSION_COMPONENT_TYPE = CONTEXT_COMPRESSION_COMPONENT_TYPE;
5602
5659
  exports.CONTEXT_COMPRESSION_MIDDLEWARE_NAME = CONTEXT_COMPRESSION_MIDDLEWARE_NAME;
5603
5660
  exports.CONTEXT_VARIABLE_CURRENTSTATE = CONTEXT_VARIABLE_CURRENTSTATE;
@@ -5666,6 +5723,7 @@ exports.STATE_VARIABLE_TITLE_CHANNEL = STATE_VARIABLE_TITLE_CHANNEL;
5666
5723
  exports.TASK_DESCRIPTION_PREFIX = TASK_DESCRIPTION_PREFIX;
5667
5724
  exports.TASK_DESCRIPTION_SUFFIX = TASK_DESCRIPTION_SUFFIX;
5668
5725
  exports.TENANT_AGENT_LOCAL_URL = TENANT_AGENT_LOCAL_URL;
5726
+ exports.THREAD_GOAL_STATUS_VALUES = THREAD_GOAL_STATUS_VALUES;
5669
5727
  exports.TOOL_NAME_REGEX = TOOL_NAME_REGEX;
5670
5728
  exports.TranslationLanguageMap = TranslationLanguageMap;
5671
5729
  exports.USAGE_HOUR_FORMAT = USAGE_HOUR_FORMAT;
@@ -5687,6 +5745,8 @@ exports.createAgentConnections = createAgentConnections;
5687
5745
  exports.createConversationTitleSummaryEvent = createConversationTitleSummaryEvent;
5688
5746
  exports.createFollowUpConsumedEvent = createFollowUpConsumedEvent;
5689
5747
  exports.createMessageAppendContextTracker = createMessageAppendContextTracker;
5748
+ exports.createThreadGoalClearedEvent = createThreadGoalClearedEvent;
5749
+ exports.createThreadGoalUpdatedEvent = createThreadGoalUpdatedEvent;
5690
5750
  exports.createXpertGraph = createXpertGraph;
5691
5751
  exports.createXpertNodes = createXpertNodes;
5692
5752
  exports.embeddingCubeCollectionName = embeddingCubeCollectionName;
@@ -5751,9 +5811,11 @@ exports.isMessageGroup = isMessageGroup;
5751
5811
  exports.isMiddlewareToolEnabled = isMiddlewareToolEnabled;
5752
5812
  exports.isRequiredMiddleware = isRequiredMiddleware;
5753
5813
  exports.isRouterKey = isRouterKey;
5814
+ exports.isRunnableThreadGoalStatus = isRunnableThreadGoalStatus;
5754
5815
  exports.isSystemManagedAssistant = isSystemManagedAssistant;
5755
5816
  exports.isTenantSharedXpertWorkspace = isTenantSharedXpertWorkspace;
5756
5817
  exports.isToolEnabled = isToolEnabled;
5818
+ exports.isUserAddableAgentMiddleware = isUserAddableAgentMiddleware;
5757
5819
  exports.isUserManagedAssistant = isUserManagedAssistant;
5758
5820
  exports.isVideoType = isVideoType;
5759
5821
  exports.isXpertNodeType = isXpertNodeType;
package/index.esm.js CHANGED
@@ -1555,6 +1555,13 @@ function _define_property$9(obj, key, value) {
1555
1555
  }
1556
1556
  return obj;
1557
1557
  }
1558
+ function _instanceof(left, right) {
1559
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1560
+ return !!right[Symbol.hasInstance](left);
1561
+ } else {
1562
+ return left instanceof right;
1563
+ }
1564
+ }
1558
1565
  function _object_spread$8(target) {
1559
1566
  for(var i = 1; i < arguments.length; i++){
1560
1567
  var source = arguments[i] != null ? arguments[i] : {};
@@ -1573,6 +1580,8 @@ function _object_spread$8(target) {
1573
1580
  var CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = "follow_up_consumed";
1574
1581
  var CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE = "thread_context_usage";
1575
1582
  var CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = "conversation_title_summary";
1583
+ var CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED = "thread_goal_updated";
1584
+ var CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED = "thread_goal_cleared";
1576
1585
  function createConversationTitleSummaryEvent(event) {
1577
1586
  return _object_spread$8({
1578
1587
  type: CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY
@@ -1583,6 +1592,36 @@ function createFollowUpConsumedEvent(event) {
1583
1592
  type: CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED
1584
1593
  }, event);
1585
1594
  }
1595
+ function createThreadGoalUpdatedEvent(goal) {
1596
+ var updatedAt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : new Date();
1597
+ return {
1598
+ type: CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED,
1599
+ conversationId: goal.conversationId,
1600
+ threadId: goal.threadId,
1601
+ goal: goal,
1602
+ updatedAt: toIsoString(updatedAt)
1603
+ };
1604
+ }
1605
+ function createThreadGoalClearedEvent(event) {
1606
+ return {
1607
+ type: CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED,
1608
+ conversationId: event.conversationId,
1609
+ threadId: event.threadId,
1610
+ updatedAt: toIsoString(event.updatedAt)
1611
+ };
1612
+ }
1613
+ function toIsoString(value) {
1614
+ if (_instanceof(value, Date)) {
1615
+ return value.toISOString();
1616
+ }
1617
+ if (typeof value === "string") {
1618
+ var date = new Date(value);
1619
+ if (!Number.isNaN(date.getTime())) {
1620
+ return date.toISOString();
1621
+ }
1622
+ }
1623
+ return new Date().toISOString();
1624
+ }
1586
1625
 
1587
1626
  function _array_like_to_array$6(arr, len) {
1588
1627
  if (len == null || len > arr.length) len = arr.length;
@@ -2056,6 +2095,19 @@ var PriceType;
2056
2095
  PriceType["OUTPUT"] = "output";
2057
2096
  })(PriceType || (PriceType = {}));
2058
2097
 
2098
+ var THREAD_GOAL_STATUS_VALUES = [
2099
+ "active",
2100
+ "paused",
2101
+ "blocked",
2102
+ // Reserved for future usage-quota enforcement. No backend path emits this status yet.
2103
+ "usage_limited",
2104
+ "budget_limited",
2105
+ "complete"
2106
+ ];
2107
+ function isRunnableThreadGoalStatus(status) {
2108
+ return status === "active";
2109
+ }
2110
+
2059
2111
  /**
2060
2112
  * @deprecated use ChatMessageEventTypeEnum
2061
2113
  */ var ChatGatewayEvent;
@@ -4048,6 +4100,9 @@ function normalizeMiddlewareNodes(nodes) {
4048
4100
  return normalizeMiddlewareNode(node);
4049
4101
  });
4050
4102
  }
4103
+ function isUserAddableAgentMiddleware(meta) {
4104
+ return (meta === null || meta === void 0 ? void 0 : meta.builtin) !== true;
4105
+ }
4051
4106
  var normalizeNodeKey = function(key) {
4052
4107
  var _key_split;
4053
4108
  return key === null || key === void 0 ? void 0 : (_key_split = key.split("/")) === null || _key_split === void 0 ? void 0 : _key_split[0];
@@ -5590,4 +5645,4 @@ var PLUGIN_LOAD_STATUS = {
5590
5645
  FAILED: "failed"
5591
5646
  };
5592
5647
 
5593
- 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_AGENT_WORKSPACE_PATH, STATE_SYS_MEMORY_WORKSPACE_PATH, STATE_SYS_SESSION_WORKSPACE_PATH, STATE_SYS_SHARED_WORKSPACE_PATH, STATE_SYS_THREAD_ID, STATE_SYS_VOLUME, STATE_SYS_WORKSPACE_PATH, STATE_SYS_WORKSPACE_ROOT, 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, resolveI18nText, resolveMessageAppendContext, resolveRuntimeXpert, setStateVariable, shortTitle, stringifyMessageContent, transformInstallation, updateAssistantBindingSkillPreferences, updateAssistantBindingToolPreferences, uuid, workflowNodeIdentifier, xpertLabel };
5648
+ 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, CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED, CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED, 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_AGENT_WORKSPACE_PATH, STATE_SYS_MEMORY_WORKSPACE_PATH, STATE_SYS_SESSION_WORKSPACE_PATH, STATE_SYS_SHARED_WORKSPACE_PATH, STATE_SYS_THREAD_ID, STATE_SYS_VOLUME, STATE_SYS_WORKSPACE_PATH, STATE_SYS_WORKSPACE_ROOT, 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, THREAD_GOAL_STATUS_VALUES, 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, createThreadGoalClearedEvent, createThreadGoalUpdatedEvent, 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, isRunnableThreadGoalStatus, isSystemManagedAssistant, isTenantSharedXpertWorkspace, isToolEnabled, isUserAddableAgentMiddleware, isUserManagedAssistant, isVideoType, isXpertNodeType, letterStartSUID, locateNodes, mapTranslationLanguage, mergeMessageContentForDisplay, messageContentText, normalizeAssistantBindingToolPreferences, normalizeMiddlewareNode, normalizeMiddlewareNodes, normalizeMiddlewareProvider, normalizeXpertAgentConfig, omitXpertRelations, replaceAgentInDraft, resolveDraftPrimaryAgent, resolveDraftRuntimeGraph, resolveI18nText, 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.9",
3
+ "version": "3.10.1",
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.9"
22
+ "@xpert-ai/chatkit-types": "~0.3.12"
23
23
  },
24
24
  "types": "./index.d.ts"
25
25
  }
@@ -2,6 +2,7 @@ import type { TFollowUpConsumedEvent, TMessageContentComplex, TThreadContextUsag
2
2
  import type { IChatConversation } from './chat.model';
3
3
  import type { IChatMessage } from './chat-message.model';
4
4
  import type { IXpertAgentExecution } from './xpert-agent-execution.model';
5
+ import type { TThreadGoalClearedEvent, TThreadGoalUpdatedEvent } from './chat-event.model';
5
6
  /**
6
7
  * Business roles for AI copilot (commands or contexts)
7
8
  */
@@ -152,7 +153,7 @@ export type TChatStreamErrorPayload = {
152
153
  error?: string;
153
154
  };
154
155
  };
155
- export type TChatStreamChatEventData = NonNullable<IChatMessage['events']>[number] | TFollowUpConsumedEvent | TThreadContextUsageEvent;
156
+ export type TChatStreamChatEventData = NonNullable<IChatMessage['events']>[number] | TFollowUpConsumedEvent | TThreadContextUsageEvent | TThreadGoalUpdatedEvent | TThreadGoalClearedEvent;
156
157
  export type TChatStreamChatEventPayload = {
157
158
  type: ChatMessageTypeEnum.EVENT;
158
159
  event: ChatMessageEventTypeEnum.ON_CHAT_EVENT;
@@ -1,10 +1,18 @@
1
- import type { TFollowUpConsumedEvent, TChatEventMessage } from '@xpert-ai/chatkit-types';
1
+ import type { TChatEventMessage, TFollowUpConsumedEvent, TThreadGoalClearedEvent, TThreadGoalUpdatedEvent } from '@xpert-ai/chatkit-types';
2
+ import type { IThreadGoal } from './thread-goal.model';
3
+ export type { TThreadGoalClearedEvent, TThreadGoalUpdatedEvent } from '@xpert-ai/chatkit-types';
2
4
  export declare const CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED: "follow_up_consumed";
3
5
  export declare const CHAT_EVENT_TYPE_THREAD_CONTEXT_USAGE: "thread_context_usage";
4
6
  export declare const CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY: "conversation_title_summary";
7
+ export declare const CHAT_EVENT_TYPE_THREAD_GOAL_UPDATED: "thread_goal_updated";
8
+ export declare const CHAT_EVENT_TYPE_THREAD_GOAL_CLEARED: "thread_goal_cleared";
5
9
  export type TConversationTitleSummaryEvent = TChatEventMessage & {
6
10
  id?: string;
7
11
  type: typeof CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY;
8
12
  };
9
13
  export declare function createConversationTitleSummaryEvent(event: Omit<TConversationTitleSummaryEvent, 'type'>): TConversationTitleSummaryEvent;
10
14
  export declare function createFollowUpConsumedEvent(event: Omit<TFollowUpConsumedEvent, 'type'>): TFollowUpConsumedEvent;
15
+ export declare function createThreadGoalUpdatedEvent(goal: IThreadGoal, updatedAt?: string | Date): TThreadGoalUpdatedEvent;
16
+ export declare function createThreadGoalClearedEvent(event: Omit<TThreadGoalClearedEvent, 'type' | 'updatedAt'> & {
17
+ updatedAt?: string | Date;
18
+ }): TThreadGoalClearedEvent;
@@ -60,9 +60,18 @@ export interface IChatMessage extends IBasePerTenantAndOrganizationEntityModel,
60
60
  children?: IChatMessage[];
61
61
  parentId?: string | null;
62
62
  /**
63
- * Files
63
+ * @deprecated Chat attachments now use `fileAssets`. This field is kept only
64
+ * for historical messages that stored raw StorageFile handles.
64
65
  */
65
66
  attachments?: IStorageFile[];
67
+ /**
68
+ * Parsed file assets used by the file understanding pipeline and agent tools.
69
+ */
70
+ fileAssets?: Array<{
71
+ id?: string;
72
+ storageFileId?: string;
73
+ [key: string]: any;
74
+ }>;
66
75
  /**
67
76
  * Structured references associated with the human input
68
77
  */
@@ -114,7 +114,8 @@ export interface IChatConversation extends IBasePerTenantAndOrganizationEntityMo
114
114
  taskId?: string | null;
115
115
  executions?: IXpertAgentExecution[];
116
116
  /**
117
- * Files
117
+ * @deprecated Conversation-level chat attachments are superseded by
118
+ * per-message `fileAssets` and `ConversationFileLink`.
118
119
  */
119
120
  attachments?: IStorageFile[];
120
121
  }
@@ -25,3 +25,26 @@ export interface ICopilotUser extends IBasePerTenantAndOrganizationEntityModel,
25
25
  tokenTotalUsed?: number;
26
26
  priceTotalUsed?: number;
27
27
  }
28
+ export interface ICopilotUserUsageGroupKey {
29
+ tenantId?: string;
30
+ organizationId?: string;
31
+ orgId?: string | null;
32
+ userId?: string;
33
+ provider?: AiProvider | string;
34
+ model?: string;
35
+ currency?: string | null;
36
+ }
37
+ export interface ICopilotUserUsageSummary extends IBasePerTenantAndOrganizationEntityModel, TCopilotTokenUsage {
38
+ orgId?: string | null;
39
+ org?: IOrganization;
40
+ userId?: string;
41
+ user?: IUser;
42
+ provider?: AiProvider | string;
43
+ model?: string;
44
+ currency?: string | null;
45
+ tokenTotalUsed?: number;
46
+ priceTotalUsed?: number;
47
+ groupKey: ICopilotUserUsageGroupKey;
48
+ details?: ICopilotUser[];
49
+ }
50
+ export type TCopilotUserUsageSummaryRenewInput = ICopilotUserUsageGroupKey & Pick<TCopilotTokenUsage, 'tokenLimit' | 'priceLimit'>;
package/src/ai/index.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  export declare const STATE_VARIABLE_HUMAN = "human";
2
2
  export { ChatMessageEventTypeEnum, ChatMessageStepCategory, ChatMessageTypeEnum } from './ai.model';
3
3
  export type * from '@xpert-ai/chatkit-types';
4
+ export type { TThreadGoalClearedEvent, TThreadGoalUpdatedEvent, ThreadGoalStatus } from '@xpert-ai/chatkit-types';
4
5
  export type { TChatRequest } from './xpert-chat.model';
5
6
  export { CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED } from './chat-event.model';
6
7
  export * from './assistant-binding.model';
7
8
  export * from './ai-model.model';
8
9
  export * from './ai.model';
9
10
  export * from './chat-event.model';
11
+ export * from './thread-goal.model';
10
12
  export * from './chat.model';
11
13
  export * from './chat-message.model';
12
14
  export * from './chat-message-feedback.model';
@@ -22,6 +22,7 @@ export type KnowledgeGraphItemOrigin = 'extracted' | 'manual' | 'curated';
22
22
  export type KnowledgeGraphVisibility = 'active' | 'hidden';
23
23
  export type GraphRagConfig = {
24
24
  enabled?: boolean;
25
+ mode?: GraphRagRetrievalMode;
25
26
  entityTopK?: number;
26
27
  neighborHops?: number;
27
28
  communityTopK?: number;
@@ -30,7 +30,17 @@ export type TAgentMiddlewareMeta = {
30
30
  icon?: IconDefinition;
31
31
  description?: I18nObject;
32
32
  configSchema?: JsonSchemaObjectType;
33
- features?: TXpertFeatureKey[];
33
+ features?: Array<TXpertFeatureKey | string>;
34
34
  slashCommands?: SkillSlashCommand[];
35
+ builtin?: boolean;
36
+ /**
37
+ * Marks a middleware as deprecated while keeping it selectable/visible for migration.
38
+ */
39
+ deprecated?: boolean;
40
+ /**
41
+ * Optional user-facing migration guidance shown when the middleware is deprecated.
42
+ */
43
+ deprecationMessage?: I18nObject;
35
44
  };
45
+ export declare function isUserAddableAgentMiddleware(meta?: Pick<TAgentMiddlewareMeta, 'builtin'> | null): boolean;
36
46
  export declare function getAgentMiddlewareNodes(graph: TXpertGraph, agentKey: string): TXpertTeamNode[];
@@ -0,0 +1,26 @@
1
+ import type { ThreadGoalStatus } from '@xpert-ai/chatkit-types';
2
+ import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
3
+ export type { ThreadGoalStatus } from '@xpert-ai/chatkit-types';
4
+ export declare const THREAD_GOAL_STATUS_VALUES: readonly ["active", "paused", "blocked", "usage_limited", "budget_limited", "complete"];
5
+ export type ThreadGoalUserStatus = Extract<ThreadGoalStatus, 'active' | 'paused'>;
6
+ export type ThreadGoalModelStatus = Extract<ThreadGoalStatus, 'complete' | 'blocked'>;
7
+ export interface IThreadGoal extends IBasePerTenantAndOrganizationEntityModel {
8
+ conversationId: string;
9
+ threadId: string;
10
+ objective: string;
11
+ status: ThreadGoalStatus;
12
+ tokensUsed: number;
13
+ elapsedSeconds: number;
14
+ continuationCount: number;
15
+ statusUpdatedAt?: Date | string | null;
16
+ completedAt?: Date | string | null;
17
+ blockedAt?: Date | string | null;
18
+ }
19
+ export type TThreadGoalSetRequest = {
20
+ objective: string;
21
+ };
22
+ export type TThreadGoalPatchRequest = {
23
+ objective?: string;
24
+ status?: ThreadGoalUserStatus;
25
+ };
26
+ export declare function isRunnableThreadGoalStatus(status: ThreadGoalStatus | null | undefined): boolean;
@@ -146,6 +146,10 @@ export type TXpertAgentOptions = {
146
146
  * Attachment config of agent
147
147
  */
148
148
  attachment?: TXpertAgentAttachment;
149
+ /**
150
+ * Built-in file understanding tools config of agent
151
+ */
152
+ fileUnderstanding?: TXpertAgentFileUnderstanding;
149
153
  /**
150
154
  * Config of middlewares for agent
151
155
  */
@@ -170,6 +174,12 @@ export type TXpertAgentAttachment = TXpertAgentVision & {
170
174
  */
171
175
  maxNum?: number;
172
176
  };
177
+ export type TXpertAgentFileUnderstanding = {
178
+ /**
179
+ * Enable built-in tools for understanding conversation files. Default: true
180
+ */
181
+ enabled?: boolean;
182
+ };
173
183
  export type TAgentPromptTemplate = {
174
184
  id: string;
175
185
  role: 'ai' | 'human';
@@ -36,9 +36,12 @@ export interface IXpertProject extends TXpertProject, IBasePerTenantAndOrganizat
36
36
  knowledges?: IKnowledgebase[];
37
37
  members?: IUser[];
38
38
  /**
39
- * @deprecated Use *file volume* instead
39
+ * @deprecated Use project file volume / FileAsset workspace projection instead.
40
40
  */
41
41
  files?: IXpertProjectFile[];
42
+ /**
43
+ * @deprecated Use project file volume / FileAsset workspace projection instead.
44
+ */
42
45
  attachments?: IStorageFile[];
43
46
  vcs?: IXpertProjectVCS;
44
47
  }
@@ -80,7 +83,7 @@ export interface IXpertProjectVCS extends IBasePerXpertProjectEntityModel {
80
83
  repository?: string;
81
84
  }
82
85
  /**
83
- * @deprecated Use `attachments`
86
+ * @deprecated Use project file volume / FileAsset workspace projection instead.
84
87
  */
85
88
  export interface IXpertProjectFile extends IBasePerXpertProjectEntityModel, Omit<TFile, 'createdAt' | 'updatedAt'> {
86
89
  }
@@ -3,6 +3,7 @@ import { IconDefinition, TAvatar } from '../types';
3
3
  import { TCopilotModel } from './copilot-model.model';
4
4
  import { MCPServerType, TMCPServer } from './xpert-tool-mcp.model';
5
5
  import { XpertTypeEnum } from './xpert.model';
6
+ import { PluginTargetApp, PluginTargetAppMeta } from '../plugin';
6
7
  export interface IXpertTemplate extends IBasePerTenantEntityModel {
7
8
  key: string;
8
9
  name?: string;
@@ -74,6 +75,7 @@ export interface ITemplateSkillSyncResult {
74
75
  }
75
76
  export type TTemplate = {
76
77
  id: string;
78
+ key?: string;
77
79
  name: string;
78
80
  title: string;
79
81
  description: string;
@@ -81,6 +83,16 @@ export type TTemplate = {
81
83
  copyright: string;
82
84
  privacyPolicy?: string;
83
85
  export_data: string;
86
+ targetApps?: PluginTargetApp[];
87
+ targetAppMeta?: PluginTargetAppMeta | null;
88
+ source?: 'builtin' | 'plugin' | string;
89
+ pluginName?: string;
90
+ pluginDisplayName?: string;
91
+ order?: number;
92
+ default?: boolean;
93
+ startPrompts?: string[];
94
+ releaseNotes?: string;
95
+ xpertName?: string;
84
96
  };
85
97
  export type TXpertTemplate = TTemplate & {
86
98
  avatar: TAvatar;
package/src/plugin.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
2
2
  import { JsonSchemaObjectType } from './ai/types';
3
- import { IconDefinition } from './types';
3
+ import { IconDefinition, I18nObject } from './types';
4
4
  export type PluginName = string;
5
5
  export declare const PLUGIN_LEVEL: {
6
6
  readonly SYSTEM: "system";
@@ -33,6 +33,63 @@ export type PluginSource = (typeof PLUGIN_SOURCE)[keyof typeof PLUGIN_SOURCE];
33
33
  export type PluginConfigurationStatus = (typeof PLUGIN_CONFIGURATION_STATUS)[keyof typeof PLUGIN_CONFIGURATION_STATUS];
34
34
  export type PluginLoadStatus = (typeof PLUGIN_LOAD_STATUS)[keyof typeof PLUGIN_LOAD_STATUS];
35
35
  export type PluginScopeRelation = 'none' | 'overrides-global' | 'shadowed-by-organization';
36
+ export type PluginTargetApp = 'xpert' | 'data-xpert' | (string & {});
37
+ export type PluginSdkCompatibilityWarningCode = 'plugin-sdk-peer-dependency-missing' | 'plugin-sdk-peer-range-invalid' | 'plugin-sdk-peer-range-incompatible' | 'plugin-sdk-peer-range-spans-major';
38
+ export type PluginMarketplaceContributionType = 'app' | 'view' | 'feature' | 'tool' | 'assistant-template' | (string & {});
39
+ export type PluginMarketplaceOperationAccess = 'read' | 'write' | 'admin' | (string & {});
40
+ export interface PluginMarketplaceOperation {
41
+ name: string;
42
+ displayName?: string | I18nObject;
43
+ description?: string | I18nObject;
44
+ access?: PluginMarketplaceOperationAccess;
45
+ tags?: string[];
46
+ }
47
+ export interface PluginMarketplaceContribution {
48
+ id?: string;
49
+ type: PluginMarketplaceContributionType;
50
+ name: string;
51
+ displayName?: string | I18nObject;
52
+ description?: string | I18nObject;
53
+ icon?: IconDefinition;
54
+ operations?: PluginMarketplaceOperation[];
55
+ tags?: string[];
56
+ metadata?: Record<string, unknown>;
57
+ }
58
+ export interface PluginTargetAppMarketplaceMetadata {
59
+ contents?: PluginMarketplaceContribution[];
60
+ featured?: boolean;
61
+ screenshots?: string[];
62
+ readme?: string;
63
+ updatedAt?: string;
64
+ }
65
+ export interface PluginTargetAppRuntimeMetadata {
66
+ middlewareProviders?: string[];
67
+ viewProviders?: string[];
68
+ templateProviders?: string[];
69
+ [key: string]: unknown;
70
+ }
71
+ export interface PluginSdkCompatibilityWarning {
72
+ code: PluginSdkCompatibilityWarningCode;
73
+ packageName: PluginName;
74
+ hostVersion: string;
75
+ peerRange?: string | null;
76
+ message: string;
77
+ }
78
+ export interface PluginTargetAppMetadata {
79
+ /**
80
+ * App-owned classification values. Each target app owns the vocabulary for its own entry.
81
+ */
82
+ types?: string[];
83
+ /**
84
+ * Minimum version of the target app that can safely use this plugin.
85
+ */
86
+ minAppVersion?: string;
87
+ capabilities?: string[];
88
+ marketplace?: PluginTargetAppMarketplaceMetadata;
89
+ runtime?: PluginTargetAppRuntimeMetadata;
90
+ [key: string]: unknown;
91
+ }
92
+ export type PluginTargetAppMeta = Record<string, PluginTargetAppMetadata | undefined>;
36
93
  export interface PluginCodeSourceConfig {
37
94
  workspacePath?: string;
38
95
  }
@@ -46,6 +103,24 @@ export interface PluginMeta {
46
103
  * Declares the plugin's operational level used for visibility and install/uninstall guardrails.
47
104
  */
48
105
  level?: PluginLevel;
106
+ /**
107
+ * Declares the product surfaces this plugin is intended to appear in.
108
+ *
109
+ * When omitted, the plugin remains a generic xpert-pro plugin for backwards compatibility.
110
+ */
111
+ targetApps?: PluginTargetApp[];
112
+ /**
113
+ * App-specific metadata grouped by target app without overloading the technical category.
114
+ */
115
+ targetAppMeta?: PluginTargetAppMeta;
116
+ /**
117
+ * Marks a plugin as deprecated while keeping it installable/visible for migration.
118
+ */
119
+ deprecated?: boolean;
120
+ /**
121
+ * Optional user-facing migration guidance shown when the plugin is deprecated.
122
+ */
123
+ deprecationMessage?: I18nObject;
49
124
  icon?: IconDefinition;
50
125
  category: 'set' | 'doc-source' | 'agent' | 'tools' | 'model' | 'vlm' | 'vector-store' | 'integration' | 'datasource' | 'database' | 'middleware';
51
126
  displayName: string;
@@ -102,6 +177,7 @@ export interface IPluginDescriptor {
102
177
  configSchema?: JsonSchemaObjectType;
103
178
  configurationStatus?: PluginConfigurationStatus | null;
104
179
  configurationError?: string | null;
180
+ sdkCompatibilityWarnings?: PluginSdkCompatibilityWarning[];
105
181
  loadStatus?: PluginLoadStatus | null;
106
182
  loadError?: string | null;
107
183
  effectiveInCurrentScope: boolean;
@@ -1,11 +1,13 @@
1
- import type { I18nObject } from '../types';
1
+ import type { I18nObject, IconDefinition } from '../types';
2
+ import type { JsonSchemaObjectType } from '../ai/types';
2
3
  export type XpertViewHostType = 'integration' | 'knowledgebase' | 'agent' | 'project' | 'sandbox' | string;
3
4
  export type XpertViewSlotMode = 'tabs' | 'sections' | 'widgets' | 'sidebar';
4
- export type XpertViewSchemaType = 'stats' | 'table' | 'list' | 'detail' | 'raw_json';
5
+ export type XpertViewSchemaType = 'stats' | 'table' | 'list' | 'detail' | 'raw_json' | 'remote_component';
5
6
  export type XpertViewValueType = 'text' | 'number' | 'status' | 'datetime' | 'json';
6
7
  export type XpertViewColumnDataType = 'text' | 'number' | 'date' | 'datetime' | 'status' | 'tag' | 'avatar' | 'link';
7
8
  export type XpertViewActionPlacement = 'toolbar' | 'row';
8
9
  export type XpertViewActionType = 'invoke' | 'navigate' | 'open_detail' | 'refresh';
10
+ export type XpertViewActionTransport = 'json' | 'file';
9
11
  export type XpertViewSortDirection = 'asc' | 'desc';
10
12
  export type XpertViewFilterOperator = 'eq' | 'neq' | 'contains' | 'starts_with' | 'ends_with' | 'in' | 'gt' | 'gte' | 'lt' | 'lte';
11
13
  export type XpertViewScalar = string | number | boolean | null;
@@ -21,9 +23,15 @@ export interface XpertViewHostContext {
21
23
  permissions?: string[];
22
24
  locale?: string;
23
25
  }
26
+ export interface XpertViewHostCapabilities {
27
+ features?: string[];
28
+ }
29
+ export type XpertViewHostState = Record<string, unknown>;
24
30
  export interface XpertResolvedViewHostContext extends XpertViewHostContext {
25
31
  slots: XpertViewSlot[];
26
32
  hostSnapshot?: unknown;
33
+ capabilities?: XpertViewHostCapabilities;
34
+ hostState?: XpertViewHostState;
27
35
  }
28
36
  export interface XpertViewSlot {
29
37
  key: string;
@@ -44,6 +52,18 @@ export interface XpertViewPolling {
44
52
  enabled: boolean;
45
53
  intervalMs?: number;
46
54
  }
55
+ export interface XpertViewActivation {
56
+ requiredFeatures?: string[];
57
+ }
58
+ export interface XpertWorkbenchViewOptions {
59
+ fixed?: boolean;
60
+ menu?: {
61
+ enabled?: boolean;
62
+ label?: string | I18nObject;
63
+ order?: number;
64
+ icon?: IconDefinition;
65
+ };
66
+ }
47
67
  export interface XpertViewCachePolicy {
48
68
  enabled?: boolean;
49
69
  ttlMs?: number;
@@ -55,6 +75,7 @@ export interface XpertViewQuerySchema {
55
75
  supportsFilter?: boolean;
56
76
  supportsCursor?: boolean;
57
77
  supportsSelection?: boolean;
78
+ supportsParameters?: boolean;
58
79
  defaultPageSize?: number;
59
80
  }
60
81
  export interface XpertViewDataSource {
@@ -77,6 +98,7 @@ export interface XpertViewQuery {
77
98
  sortDirection?: XpertViewSortDirection;
78
99
  filters?: XpertViewFilter[];
79
100
  selectionId?: string;
101
+ parameters?: Record<string, XpertViewScalar | XpertViewScalar[]>;
80
102
  }
81
103
  export interface XpertStatsViewSchema {
82
104
  type: 'stats';
@@ -133,24 +155,98 @@ export interface XpertDetailViewSchema {
133
155
  export interface XpertRawJsonViewSchema {
134
156
  type: 'raw_json';
135
157
  }
136
- export type XpertViewSchema = XpertStatsViewSchema | XpertTableViewSchema | XpertListViewSchema | XpertDetailViewSchema | XpertRawJsonViewSchema;
158
+ export interface XpertRemoteComponentViewSchema {
159
+ type: 'remote_component';
160
+ runtime: 'react';
161
+ protocolVersion: 1;
162
+ component: {
163
+ isolation: 'iframe' | 'module_federation';
164
+ entry: string;
165
+ module?: string;
166
+ exportName?: string;
167
+ integrity?: string;
168
+ propsSchema?: JsonSchemaObjectType;
169
+ };
170
+ dataSource: {
171
+ mode: 'platform';
172
+ };
173
+ actions?: XpertViewActionDefinition[];
174
+ }
175
+ export interface XpertRemoteComponentEntry {
176
+ html: string;
177
+ contentType?: 'text/html; charset=utf-8';
178
+ }
179
+ export type XpertViewSchema = XpertStatsViewSchema | XpertTableViewSchema | XpertListViewSchema | XpertDetailViewSchema | XpertRawJsonViewSchema | XpertRemoteComponentViewSchema;
180
+ export interface XpertViewParameterDefinition {
181
+ key: string;
182
+ label: I18nObject;
183
+ description?: I18nObject;
184
+ required?: boolean;
185
+ type?: 'string' | 'number' | 'boolean';
186
+ optionSource?: {
187
+ mode: 'provider';
188
+ searchable?: boolean;
189
+ preload?: boolean;
190
+ dependsOn?: string[];
191
+ };
192
+ }
193
+ export interface XpertViewParameterOption {
194
+ value: XpertViewScalar;
195
+ label: string;
196
+ description?: string | null;
197
+ disabled?: boolean;
198
+ }
199
+ export interface XpertViewParameterOptionsQuery {
200
+ search?: string;
201
+ parameters?: Record<string, XpertViewScalar | XpertViewScalar[]>;
202
+ }
203
+ export interface XpertViewParameterOptionsResult {
204
+ items: XpertViewParameterOption[];
205
+ }
137
206
  export interface XpertViewActionDefinition {
138
207
  key: string;
139
208
  label: I18nObject;
140
209
  icon?: string;
141
210
  placement?: XpertViewActionPlacement;
142
211
  actionType: XpertViewActionType;
212
+ transport?: XpertViewActionTransport;
213
+ inputSchema?: JsonSchemaObjectType;
214
+ inputDefaults?: 'target' | Record<string, unknown>;
143
215
  confirm?: {
144
216
  title?: I18nObject;
145
217
  message?: I18nObject;
146
218
  };
147
219
  permissions?: string[];
148
220
  }
221
+ export interface XpertViewClientCommandDefinition {
222
+ key: string;
223
+ label?: I18nObject;
224
+ description?: I18nObject;
225
+ permissions?: string[];
226
+ }
227
+ export type XpertViewHostEventSubscriptionActionType = 'refresh' | 'forward' | 'refresh-and-forward';
228
+ export interface XpertViewHostEventSubscription {
229
+ key: string;
230
+ event: string;
231
+ filter?: {
232
+ sources?: string[];
233
+ toolNames?: string[];
234
+ viewKeys?: string[];
235
+ visualizationTypes?: string[];
236
+ };
237
+ action?: {
238
+ type?: XpertViewHostEventSubscriptionActionType;
239
+ debounceMs?: number;
240
+ };
241
+ }
242
+ export interface XpertViewHostEvents {
243
+ subscriptions?: XpertViewHostEventSubscription[];
244
+ }
149
245
  export interface XpertExtensionViewManifest {
150
246
  key: string;
151
247
  title: I18nObject;
152
248
  description?: I18nObject;
153
- icon?: string;
249
+ icon?: IconDefinition;
154
250
  hostType: XpertViewHostType;
155
251
  slot: string;
156
252
  order?: number;
@@ -160,12 +256,19 @@ export interface XpertExtensionViewManifest {
160
256
  badge?: XpertViewBadge;
161
257
  refreshable?: boolean;
162
258
  polling?: XpertViewPolling;
259
+ activation?: XpertViewActivation;
260
+ workbench?: XpertWorkbenchViewOptions;
163
261
  view: XpertViewSchema;
164
262
  dataSource: XpertViewDataSource;
263
+ parameters?: XpertViewParameterDefinition[];
165
264
  actions?: XpertViewActionDefinition[];
265
+ clientCommands?: XpertViewClientCommandDefinition[];
266
+ hostEvents?: XpertViewHostEvents;
166
267
  }
167
268
  export interface XpertViewActionRequest {
168
269
  targetId?: string;
270
+ input?: Record<string, unknown> | null;
271
+ parameters?: Record<string, XpertViewScalar | XpertViewScalar[]>;
169
272
  }
170
273
  export interface XpertViewDataResult<TItem = unknown, TSummary = unknown> {
171
274
  items?: TItem[];