@xpert-ai/contracts 3.12.0 → 3.13.0

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
@@ -3808,7 +3808,8 @@ var Attachment_Type_Options = [
3808
3808
  }
3809
3809
  ];
3810
3810
 
3811
- var XPERT_TASK_SCHEDULE_RUNTIME_STATE_KEY = "xpertTaskSchedule";
3811
+ var XPERT_TASK_SCHEDULE_PROPERTY_PREFIX = "xpert_task_";
3812
+ var XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY = "__idempotency_key";
3812
3813
 
3813
3814
  var TASK_DESCRIPTION_PREFIX = "Launch a new agent to handle complex, multi-step tasks autonomously. \n\nAvailable agent types and the tools they have access to:";
3814
3815
  var TASK_DESCRIPTION_SUFFIX = 'When using the Task tool, you must specify a subagent_type parameter to select which agent type to use.\n\nWhen to use the Agent tool:\n- When you are instructed to execute custom slash commands. Use the Agent tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Task(description="Check the file")\n\nWhen NOT to use the Agent tool:\n- If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly\n- If you are searching for a specific term or definition within a known location, use the Glob tool instead, to find the match more quickly\n- If you are searching for content within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\n\nUsage notes:\n1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n4. The agent\'s outputs should generally be trusted\n5. Clearly tell the agent whether you expect it to create content, perform analysis, or just do research (search, file reads, web fetches, etc.), since it is not aware of the user\'s intent\n6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n\nExample usage:\n\n<example_agent_descriptions>\n"content-reviewer": use this agent after you are done creating significant content or documents\n"greeting-responder": use this agent when to respond to user greetings with a friendly joke\n"research-analyst": use this agent to conduct thorough research on complex topics\n</example_agent_description>\n\n<example>\nuser: "Please write a function that checks if a number is prime"\nassistant: Sure let me write a function that checks if a number is prime\nassistant: First let me use the Write tool to write a function that checks if a number is prime\nassistant: I\'m going to use the Write tool to write the following code:\n<code>\nfunction isPrime(n) {\n if (n <= 1) return false\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0) return false\n }\n return true\n}\n</code>\n<commentary>\nSince significant content was created and the task was completed, now use the content-reviewer agent to review the work\n</commentary>\nassistant: Now let me use the content-reviewer agent to review the code\nassistant: Uses the Task tool to launch with the content-reviewer agent \n</example>\n\n<example>\nuser: "Can you help me research the environmental impact of different renewable energy sources and create a comprehensive report?"\n<commentary>\nThis is a complex research task that would benefit from using the research-analyst agent to conduct thorough analysis\n</commentary>\nassistant: I\'ll help you research the environmental impact of renewable energy sources. Let me use the research-analyst agent to conduct comprehensive research on this topic.\nassistant: Uses the Task tool to launch with the research-analyst agent, providing detailed instructions about what research to conduct and what format the report should take\n</example>\n\n<example>\nuser: "Hello"\n<commentary>\nSince the user is greeting, use the greeting-responder agent to respond with a friendly joke\n</commentary>\nassistant: "I\'m going to use the Task tool to launch with the greeting-responder agent"\n</example>';
@@ -3820,6 +3821,7 @@ exports.MCPServerType = void 0;
3820
3821
  MCPServerType["CODE"] = "code";
3821
3822
  MCPServerType["HTTP"] = "http";
3822
3823
  })(exports.MCPServerType || (exports.MCPServerType = {}));
3824
+ var MCP_APP_RESOURCE_MIME_TYPE = "text/html;profile=mcp-app";
3823
3825
 
3824
3826
  /**
3825
3827
  * Build a hierarchical tree structure from a flat list of DocumentInterface objects,
@@ -5696,8 +5698,13 @@ var PLUGIN_RESOURCE_INSTALLATION_STATUS = {
5696
5698
  FAILED: "failed"
5697
5699
  };
5698
5700
 
5701
+ var ASSISTANT_CHAT_SEND_MESSAGE_COMMAND = "assistant.chat.send_message";
5702
+ var ASSISTANT_CONTEXT_SET_COMMAND = "assistant.context.set";
5703
+
5699
5704
  exports.AI_MODEL_TYPE_VARIABLE = AI_MODEL_TYPE_VARIABLE;
5700
5705
  exports.API_PRINCIPAL_USER_ID_HEADER = API_PRINCIPAL_USER_ID_HEADER;
5706
+ exports.ASSISTANT_CHAT_SEND_MESSAGE_COMMAND = ASSISTANT_CHAT_SEND_MESSAGE_COMMAND;
5707
+ exports.ASSISTANT_CONTEXT_SET_COMMAND = ASSISTANT_CONTEXT_SET_COMMAND;
5701
5708
  exports.Attachment_Type_Options = Attachment_Type_Options;
5702
5709
  exports.CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY = CHAT_EVENT_TYPE_CONVERSATION_TITLE_SUMMARY;
5703
5710
  exports.CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED = CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED;
@@ -5739,6 +5746,7 @@ exports.KnowledgeTask = KnowledgeTask;
5739
5746
  exports.KnowledgebaseChannel = KnowledgebaseChannel;
5740
5747
  exports.LEGACY_SANDBOX_COMPRESSION_MIDDLEWARE_NAME = LEGACY_SANDBOX_COMPRESSION_MIDDLEWARE_NAME;
5741
5748
  exports.LanguagesMap = LanguagesMap;
5749
+ exports.MCP_APP_RESOURCE_MIME_TYPE = MCP_APP_RESOURCE_MIME_TYPE;
5742
5750
  exports.MDX = schema;
5743
5751
  exports.MEMORY_PROFILE_PROMPT = MEMORY_PROFILE_PROMPT;
5744
5752
  exports.MEMORY_QA_PROMPT = MEMORY_QA_PROMPT;
@@ -5785,7 +5793,8 @@ exports.USAGE_HOUR_FORMAT = USAGE_HOUR_FORMAT;
5785
5793
  exports.VariableOperations = VariableOperations;
5786
5794
  exports.WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME = WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME;
5787
5795
  exports.WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER = WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER;
5788
- exports.XPERT_TASK_SCHEDULE_RUNTIME_STATE_KEY = XPERT_TASK_SCHEDULE_RUNTIME_STATE_KEY;
5796
+ exports.XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY = XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY;
5797
+ exports.XPERT_TASK_SCHEDULE_PROPERTY_PREFIX = XPERT_TASK_SCHEDULE_PROPERTY_PREFIX;
5789
5798
  exports.agentLabel = agentLabel;
5790
5799
  exports.agentUniqueName = agentUniqueName;
5791
5800
  exports.allChannels = allChannels;
package/index.esm.js CHANGED
@@ -3806,7 +3806,8 @@ var Attachment_Type_Options = [
3806
3806
  }
3807
3807
  ];
3808
3808
 
3809
- var XPERT_TASK_SCHEDULE_RUNTIME_STATE_KEY = "xpertTaskSchedule";
3809
+ var XPERT_TASK_SCHEDULE_PROPERTY_PREFIX = "xpert_task_";
3810
+ var XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY = "__idempotency_key";
3810
3811
 
3811
3812
  var TASK_DESCRIPTION_PREFIX = "Launch a new agent to handle complex, multi-step tasks autonomously. \n\nAvailable agent types and the tools they have access to:";
3812
3813
  var TASK_DESCRIPTION_SUFFIX = 'When using the Task tool, you must specify a subagent_type parameter to select which agent type to use.\n\nWhen to use the Agent tool:\n- When you are instructed to execute custom slash commands. Use the Agent tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Task(description="Check the file")\n\nWhen NOT to use the Agent tool:\n- If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly\n- If you are searching for a specific term or definition within a known location, use the Glob tool instead, to find the match more quickly\n- If you are searching for content within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\n\nUsage notes:\n1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n4. The agent\'s outputs should generally be trusted\n5. Clearly tell the agent whether you expect it to create content, perform analysis, or just do research (search, file reads, web fetches, etc.), since it is not aware of the user\'s intent\n6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n\nExample usage:\n\n<example_agent_descriptions>\n"content-reviewer": use this agent after you are done creating significant content or documents\n"greeting-responder": use this agent when to respond to user greetings with a friendly joke\n"research-analyst": use this agent to conduct thorough research on complex topics\n</example_agent_description>\n\n<example>\nuser: "Please write a function that checks if a number is prime"\nassistant: Sure let me write a function that checks if a number is prime\nassistant: First let me use the Write tool to write a function that checks if a number is prime\nassistant: I\'m going to use the Write tool to write the following code:\n<code>\nfunction isPrime(n) {\n if (n <= 1) return false\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0) return false\n }\n return true\n}\n</code>\n<commentary>\nSince significant content was created and the task was completed, now use the content-reviewer agent to review the work\n</commentary>\nassistant: Now let me use the content-reviewer agent to review the code\nassistant: Uses the Task tool to launch with the content-reviewer agent \n</example>\n\n<example>\nuser: "Can you help me research the environmental impact of different renewable energy sources and create a comprehensive report?"\n<commentary>\nThis is a complex research task that would benefit from using the research-analyst agent to conduct thorough analysis\n</commentary>\nassistant: I\'ll help you research the environmental impact of renewable energy sources. Let me use the research-analyst agent to conduct comprehensive research on this topic.\nassistant: Uses the Task tool to launch with the research-analyst agent, providing detailed instructions about what research to conduct and what format the report should take\n</example>\n\n<example>\nuser: "Hello"\n<commentary>\nSince the user is greeting, use the greeting-responder agent to respond with a friendly joke\n</commentary>\nassistant: "I\'m going to use the Task tool to launch with the greeting-responder agent"\n</example>';
@@ -3818,6 +3819,7 @@ var MCPServerType;
3818
3819
  MCPServerType["CODE"] = "code";
3819
3820
  MCPServerType["HTTP"] = "http";
3820
3821
  })(MCPServerType || (MCPServerType = {}));
3822
+ var MCP_APP_RESOURCE_MIME_TYPE = "text/html;profile=mcp-app";
3821
3823
 
3822
3824
  /**
3823
3825
  * Build a hierarchical tree structure from a flat list of DocumentInterface objects,
@@ -5694,4 +5696,7 @@ var PLUGIN_RESOURCE_INSTALLATION_STATUS = {
5694
5696
  FAILED: "failed"
5695
5697
  };
5696
5698
 
5697
- 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_COMPONENT_TYPE, PLUGIN_CONFIGURATION_STATUS, PLUGIN_LEVEL, PLUGIN_LOAD_STATUS, PLUGIN_MARKETPLACE_AUTHENTICATION_POLICY, PLUGIN_MARKETPLACE_INSTALLATION_POLICY, PLUGIN_MCP_TOOL_APPROVAL_MODE, PLUGIN_RESOURCE_INSTALLATION_STATUS, PLUGIN_RESOURCE_RUNTIME_TYPE, 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, XPERT_TASK_SCHEDULE_RUNTIME_STATE_KEY, 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, isAgentWorkflowNode, isAgentWorkflowNodeType, 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 };
5699
+ var ASSISTANT_CHAT_SEND_MESSAGE_COMMAND = "assistant.chat.send_message";
5700
+ var ASSISTANT_CONTEXT_SET_COMMAND = "assistant.context.set";
5701
+
5702
+ export { AIPermissionsEnum, AI_MODEL_TYPE_VARIABLE, API_PRINCIPAL_USER_ID_HEADER, ASSISTANT_CHAT_SEND_MESSAGE_COMMAND, ASSISTANT_CONTEXT_SET_COMMAND, 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, MCP_APP_RESOURCE_MIME_TYPE, schema as MDX, MEMORY_PROFILE_PROMPT, MEMORY_QA_PROMPT, MinimumProjectSizeEnum, ModelEntityType, ModelFeature, ModelPropertyKey, ModelTypeEnum, OllamaEmbeddingsProviders, OpenAIEmbeddingsProviders, OrderTypeEnum, OrganizationContactBudgetTypeEnum, OrganizationDemoNetworkEnum, OrganizationPermissionsEnum, OrganizationProjectBudgetTypeEnum, OrganizationSelectInput, PLUGIN_COMPONENT_TYPE, PLUGIN_CONFIGURATION_STATUS, PLUGIN_LEVEL, PLUGIN_LOAD_STATUS, PLUGIN_MARKETPLACE_AUTHENTICATION_POLICY, PLUGIN_MARKETPLACE_INSTALLATION_POLICY, PLUGIN_MCP_TOOL_APPROVAL_MODE, PLUGIN_RESOURCE_INSTALLATION_STATUS, PLUGIN_RESOURCE_RUNTIME_TYPE, 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, XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY, XPERT_TASK_SCHEDULE_PROPERTY_PREFIX, 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, isAgentWorkflowNode, isAgentWorkflowNodeType, 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.12.0",
3
+ "version": "3.13.0",
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.13"
22
+ "@xpert-ai/chatkit-types": "~0.4.1"
23
23
  },
24
24
  "types": "./index.d.ts"
25
25
  }
@@ -122,6 +122,26 @@ export interface IChatConversation extends IBasePerTenantAndOrganizationEntityMo
122
122
  export type TChatConversationLog = IChatConversation & {
123
123
  messageCount: number;
124
124
  };
125
+ export interface IChatConversationReadState extends IBasePerTenantAndOrganizationEntityModel {
126
+ conversationId: string;
127
+ userId: string;
128
+ lastReadAt: Date | string;
129
+ lastReadMessageId?: string | null;
130
+ }
131
+ export interface IChatConversationMarkReadRequest {
132
+ lastReadMessageId?: string | null;
133
+ }
134
+ export interface IChatConversationUnreadXpertsRequest {
135
+ xpertIds: string[];
136
+ }
137
+ export interface IChatConversationUnreadXpertSummary {
138
+ xpertId: string;
139
+ unreadMessages: number;
140
+ unreadConversations: number;
141
+ latestUnreadAt?: Date | string | null;
142
+ latestUnreadConversationId?: string | null;
143
+ latestUnreadThreadId?: string | null;
144
+ }
125
145
  export type ChatMessage = {
126
146
  conversationId: string;
127
147
  id: string;
package/src/ai/index.d.ts CHANGED
@@ -1,7 +1,7 @@
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
+ export type { IconDefinition, IconType } from '../types';
5
5
  export type { TChatRequest } from './xpert-chat.model';
6
6
  export { CHAT_EVENT_TYPE_FOLLOW_UP_CONSUMED } from './chat-event.model';
7
7
  export * from './assistant-binding.model';
@@ -57,3 +57,4 @@ export * from './middleware.model';
57
57
  export * from './context-compression.model';
58
58
  export * from './sandbox';
59
59
  export * from './message-content.utils';
60
+ export * from './mobile.model';
@@ -0,0 +1,79 @@
1
+ import type { AssistantBindingScope, AssistantBindingSourceScope, AssistantCode, IResolvedAssistantBinding } from './assistant-binding.model';
2
+ import type { SANDBOX_TERMINAL_NAMESPACE } from './sandbox-terminal.model';
3
+ import type { TAvatar } from '../types';
4
+ import type { LanguagesEnum } from '../user.model';
5
+ import type { XpertTypeEnum } from './xpert.model';
6
+ export interface XpertMobileDeploymentConfig {
7
+ apiBaseUrl?: string | null;
8
+ apiBasePath: '/api';
9
+ aiApiPath: '/api/ai';
10
+ chatkitFrameUrl: string;
11
+ viewHostsPath: '/api/view-hosts';
12
+ socketNamespaces: {
13
+ sandboxTerminal: typeof SANDBOX_TERMINAL_NAMESPACE;
14
+ };
15
+ capabilities: {
16
+ chatkit: boolean;
17
+ extensionViews: boolean;
18
+ scheduledTasks: boolean;
19
+ fileMemory: boolean;
20
+ sandboxTerminal: boolean;
21
+ publicChatkitSessions: boolean;
22
+ };
23
+ }
24
+ export interface XpertMobileUserSummary {
25
+ id: string;
26
+ tenantId?: string | null;
27
+ email?: string | null;
28
+ name?: string | null;
29
+ firstName?: string | null;
30
+ lastName?: string | null;
31
+ fullName?: string | null;
32
+ imageUrl?: string | null;
33
+ preferredLanguage?: LanguagesEnum | string | null;
34
+ }
35
+ export interface XpertMobileOrganizationSummary {
36
+ id: string;
37
+ tenantId?: string | null;
38
+ name: string;
39
+ imageUrl?: string | null;
40
+ isDefault: boolean;
41
+ isActive: boolean;
42
+ timeZone?: string | null;
43
+ preferredLanguage?: LanguagesEnum | string | null;
44
+ }
45
+ export interface XpertMobileAssistantBindingSummary extends Pick<IResolvedAssistantBinding, 'assistantId' | 'enabled' | 'tenantId' | 'organizationId' | 'userId'> {
46
+ code: AssistantCode;
47
+ scope: AssistantBindingScope;
48
+ sourceScope: AssistantBindingSourceScope;
49
+ }
50
+ export interface XpertMobileBootstrap {
51
+ deployment: XpertMobileDeploymentConfig;
52
+ user: XpertMobileUserSummary;
53
+ organizations: XpertMobileOrganizationSummary[];
54
+ activeOrganizationId?: string | null;
55
+ defaultOrganizationId?: string | null;
56
+ assistantBindings: XpertMobileAssistantBindingSummary[];
57
+ }
58
+ export interface XpertMobileXpertSummary {
59
+ id: string;
60
+ slug: string;
61
+ name: string;
62
+ type: XpertTypeEnum | string;
63
+ title?: string | null;
64
+ titleCN?: string | null;
65
+ description?: string | null;
66
+ avatar?: TAvatar | null;
67
+ version?: string | null;
68
+ latest?: boolean | null;
69
+ workspaceId?: string | null;
70
+ organizationId?: string | null;
71
+ publishAt?: Date | string | null;
72
+ starters?: string[] | null;
73
+ }
74
+ export interface XpertMobileXpertsResponse {
75
+ items: XpertMobileXpertSummary[];
76
+ total: number;
77
+ limit: number;
78
+ offset: number;
79
+ }
@@ -4,7 +4,8 @@ import type { TXpertChatState } from '@xpert-ai/chatkit-types';
4
4
  import { IChatConversation } from './chat.model';
5
5
  import { JsonSchemaObjectType } from './types';
6
6
  import { IXpert } from './xpert.model';
7
- export declare const XPERT_TASK_SCHEDULE_RUNTIME_STATE_KEY = "xpertTaskSchedule";
7
+ export declare const XPERT_TASK_SCHEDULE_PROPERTY_PREFIX = "xpert_task_";
8
+ export declare const XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY = "__idempotency_key";
8
9
  export type TXpertTaskScheduleCapabilities = {
9
10
  xpertId: string;
10
11
  agentKey?: string;
@@ -16,7 +17,7 @@ export type TXpertTaskScheduleCapabilities = {
16
17
  stateSchema?: JsonSchemaObjectType;
17
18
  };
18
19
  export type TXpertTaskScheduleRuntimeState = {
19
- idempotencyKey?: string;
20
+ [XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY]?: string;
20
21
  };
21
22
  /**
22
23
  * Tools for Xpert
@@ -1,3 +1,6 @@
1
+ import type { TMcpAppCsp, TMcpAppPermissions, TMcpAppToolResult, TMcpAppVisibility } from '@xpert-ai/chatkit-types';
2
+ import type { I18nObject } from '../i18n.model';
3
+ import type { IconDefinition } from '../types';
1
4
  export declare enum MCPServerType {
2
5
  SSE = "sse",
3
6
  STDIO = "stdio",
@@ -8,18 +11,19 @@ export declare enum MCPServerType {
8
11
  * Configuration for stdio transport connection
9
12
  */
10
13
  export interface StdioConnection {
11
- transport: "stdio";
14
+ transport: 'stdio';
12
15
  command: string;
13
16
  args: string[];
14
17
  env?: Record<string, string>;
18
+ stderr?: 'pipe' | 'inherit' | 'ignore' | string;
15
19
  encoding?: string;
16
- encodingErrorHandler?: "strict" | "ignore" | "replace";
20
+ encodingErrorHandler?: 'strict' | 'ignore' | 'replace';
17
21
  }
18
22
  /**
19
23
  * Configuration for SSE transport connection
20
24
  */
21
25
  export interface SSEConnection {
22
- transport: "sse";
26
+ transport: 'sse';
23
27
  url: string;
24
28
  headers?: Record<string, string>;
25
29
  useNodeEventSource?: boolean;
@@ -28,7 +32,7 @@ export interface SSEConnection {
28
32
  * Configuration for Streamable HTTP transport connection
29
33
  */
30
34
  export interface HttpConnection {
31
- transport: "http";
35
+ transport: 'http';
32
36
  url: string;
33
37
  headers?: Record<string, string>;
34
38
  /**
@@ -43,19 +47,44 @@ export type TMCPServerReconnect = {
43
47
  */
44
48
  enabled?: boolean;
45
49
  /**
46
- * Maximum number of restart attempts
47
- */
50
+ * Maximum number of restart attempts
51
+ */
48
52
  maxAttempts?: number;
49
53
  /**
50
- * Delay in milliseconds between restart attempts
51
- */
54
+ * Delay in milliseconds between restart attempts
55
+ */
52
56
  delayMs?: number;
53
57
  };
58
+ export type TMcpStdioRuntimePolicy = {
59
+ /**
60
+ * Runtime provider requested by the toolset or plugin. v1 supports
61
+ * local-process; sandbox and sidecar are reserved extension points.
62
+ */
63
+ provider?: 'local-process' | 'sandbox' | 'sidecar' | string;
64
+ /**
65
+ * Maximum startup wait time in milliseconds.
66
+ */
67
+ startupTimeoutMs?: number;
68
+ /**
69
+ * Maximum idle lifetime in milliseconds before the host may close the runtime.
70
+ */
71
+ idleTimeoutMs?: number;
72
+ /**
73
+ * Maximum total lifetime in milliseconds.
74
+ */
75
+ maxLifetimeMs?: number;
76
+ /**
77
+ * Optional command allow-list requested by the plugin/toolset. The platform
78
+ * allow-list remains authoritative.
79
+ */
80
+ allowedCommands?: string[];
81
+ };
54
82
  export type TMCPServer = {
55
83
  type: MCPServerType;
56
84
  command?: string;
57
85
  args?: string[];
58
86
  env?: Record<string, string>;
87
+ stderr?: 'pipe' | 'inherit' | 'ignore' | string;
59
88
  encoding?: string;
60
89
  encodingErrorHandler?: string;
61
90
  /**
@@ -84,8 +113,74 @@ export type TMCPServer = {
84
113
  * Init scripts for sandbox
85
114
  */
86
115
  initScripts?: string;
116
+ /**
117
+ * Requested stdio runtime policy. The platform clamps this policy before use.
118
+ */
119
+ runtime?: TMcpStdioRuntimePolicy;
87
120
  };
88
121
  export type TMCPSchema = {
89
122
  servers?: Record<string, TMCPServer>;
90
123
  mcpServers?: Record<string, TMCPServer>;
91
124
  };
125
+ export declare const MCP_APP_RESOURCE_MIME_TYPE = "text/html;profile=mcp-app";
126
+ export type TMcpAppUiMeta = {
127
+ resourceUri: string;
128
+ title?: string | I18nObject;
129
+ description?: string | I18nObject;
130
+ icon?: IconDefinition;
131
+ /**
132
+ * @deprecated MCP Apps resource security metadata belongs on the resource
133
+ * content item `_meta.ui`. Tool-level values are kept only as a legacy
134
+ * fallback while older plugins migrate.
135
+ */
136
+ csp?: TMcpAppCsp;
137
+ /**
138
+ * @deprecated MCP Apps resource security metadata belongs on the resource
139
+ * content item `_meta.ui`. Tool-level values are kept only as a legacy
140
+ * fallback while older plugins migrate.
141
+ */
142
+ permissions?: TMcpAppPermissions;
143
+ domain?: string;
144
+ prefersBorder?: boolean;
145
+ };
146
+ export type TMcpToolAppMeta = {
147
+ serverName: string;
148
+ name: string;
149
+ displayName: string;
150
+ inputSchema?: Record<string, unknown>;
151
+ visibility: TMcpAppVisibility[];
152
+ ui?: TMcpAppUiMeta;
153
+ annotations?: Record<string, unknown>;
154
+ _meta?: Record<string, unknown>;
155
+ };
156
+ export type TMcpAppComponentData = {
157
+ type: 'McpApp';
158
+ appInstanceId: string;
159
+ appInstanceToken?: string;
160
+ resourceUri: string;
161
+ toolName: string;
162
+ toolCallId?: string;
163
+ toolsetId?: string;
164
+ serverName?: string;
165
+ executionId?: string;
166
+ title?: string | I18nObject;
167
+ description?: string | I18nObject;
168
+ icon?: IconDefinition;
169
+ csp?: TMcpAppCsp;
170
+ permissions?: TMcpAppPermissions;
171
+ domain?: string;
172
+ prefersBorder?: boolean;
173
+ toolInput?: Record<string, unknown>;
174
+ /**
175
+ * Standardized initial CallToolResult used to replay MCP App history without
176
+ * re-running the originating tool. Raw app HTML is never persisted here.
177
+ */
178
+ toolResult?: TMcpAppToolResult;
179
+ /** Serialized byte size of the initial tool result when known. */
180
+ toolResultSize?: number;
181
+ /** True when the initial tool result was too large to inline in chat history. */
182
+ toolResultTruncated?: boolean;
183
+ visibility?: TMcpAppVisibility[];
184
+ status?: 'running' | 'success' | 'fail';
185
+ error?: string;
186
+ };
@@ -6,6 +6,7 @@ import { ITag } from '../tag-entity.model';
6
6
  import { TCopilotModel } from './copilot-model.model';
7
7
  import { Subscriber } from 'rxjs';
8
8
  import { I18nObject } from '../types';
9
+ import { TMcpStdioRuntimePolicy } from './xpert-tool-mcp.model';
9
10
  export declare enum XpertToolsetCategoryEnum {
10
11
  BUILTIN = "builtin",
11
12
  API = "api",
@@ -63,6 +64,11 @@ export type TXpertToolsetOptions = {
63
64
  toolPositions?: Record<string, number>;
64
65
  disableToolDefault?: boolean;
65
66
  needSandbox?: boolean;
67
+ /**
68
+ * Runtime policy requested for MCP stdio toolsets. The server clamps this
69
+ * policy against platform and tenant-level security settings.
70
+ */
71
+ mcpRuntime?: TMcpStdioRuntimePolicy;
66
72
  [key: string]: any;
67
73
  };
68
74
  /**
@@ -187,6 +193,8 @@ export type TToolsetParams = {
187
193
  xpertId?: string;
188
194
  conversationId?: string;
189
195
  agentKey?: string;
196
+ executionId?: string;
197
+ appInstanceId?: string;
190
198
  signal?: AbortSignal;
191
199
  env: Record<string, unknown>;
192
200
  };
package/src/plugin.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
2
2
  import { JsonSchemaObjectType } from './ai/types';
3
3
  import type { IXpert } from './ai/xpert.model';
4
+ import type { TMcpStdioRuntimePolicy } from './ai/xpert-tool-mcp.model';
4
5
  import type { JSONValue } from './core.model';
5
6
  import { IconDefinition, I18nObject } from './types';
6
7
  export type PluginName = string;
@@ -120,6 +121,7 @@ export interface XpertPluginMcpServerPolicy {
120
121
  enabled?: boolean;
121
122
  defaultToolsApprovalMode?: PluginMcpToolApprovalMode;
122
123
  enabledTools?: string[];
124
+ runtime?: TMcpStdioRuntimePolicy;
123
125
  tools?: {
124
126
  [toolName: string]: {
125
127
  approvalMode?: PluginMcpToolApprovalMode;
@@ -38,6 +38,9 @@ export interface XpertViewSlot {
38
38
  title?: I18nObject;
39
39
  mode: XpertViewSlotMode;
40
40
  order?: number;
41
+ manifestPolicy?: {
42
+ requireFeatureActivation?: boolean;
43
+ };
41
44
  }
42
45
  export interface XpertViewSource {
43
46
  provider: string;
@@ -224,24 +227,94 @@ export interface XpertViewClientCommandDefinition {
224
227
  description?: I18nObject;
225
228
  permissions?: string[];
226
229
  }
230
+ export declare const ASSISTANT_CHAT_SEND_MESSAGE_COMMAND = "assistant.chat.send_message";
231
+ export declare const ASSISTANT_CONTEXT_SET_COMMAND = "assistant.context.set";
232
+ /**
233
+ * Action a host should take when a view host event matches a manifest subscription.
234
+ */
227
235
  export type XpertViewHostEventSubscriptionActionType = 'refresh' | 'forward' | 'refresh-and-forward';
236
+ /**
237
+ * Declarative host event subscription owned by a view manifest.
238
+ */
228
239
  export interface XpertViewHostEventSubscription {
240
+ /** Stable subscription key used for de-duping and diagnostics. */
229
241
  key: string;
242
+ /** Machine-readable event type, for example `assistant.tool.completed`. */
230
243
  event: string;
231
244
  filter?: {
245
+ /** Optional event source allow-list, for example `chatkit`. */
232
246
  sources?: string[];
247
+ /** Optional tool name allow-list for assistant tool completion events. */
233
248
  toolNames?: string[];
249
+ /** Optional remote view key allow-list for visualization events. */
234
250
  viewKeys?: string[];
251
+ /** Optional visualization type allow-list. */
235
252
  visualizationTypes?: string[];
236
253
  };
237
254
  action?: {
255
+ /** Defaults to `refresh` when omitted. */
238
256
  type?: XpertViewHostEventSubscriptionActionType;
257
+ /** Suppresses repeated matching events with the same debounce key for this duration. */
239
258
  debounceMs?: number;
240
259
  };
241
260
  }
261
+ /**
262
+ * Host event subscriptions declared by a remote view manifest.
263
+ */
242
264
  export interface XpertViewHostEvents {
243
265
  subscriptions?: XpertViewHostEventSubscription[];
244
266
  }
267
+ /**
268
+ * Optional visualization metadata attached to a host event.
269
+ */
270
+ export interface XpertViewHostEventVisualization {
271
+ /** Visualization renderer/type discriminator. */
272
+ type?: string;
273
+ /** Remote view key associated with the emitted visualization. */
274
+ viewKey?: string;
275
+ /** Human-readable visualization title. */
276
+ title?: string;
277
+ /** Host slot that should receive the visualization. */
278
+ slotKey?: string;
279
+ /** Parameter key associated with this visualization payload. */
280
+ parameterKey?: string;
281
+ }
282
+ /**
283
+ * Event payload forwarded to remote components. Keep this shape host-agnostic so
284
+ * the same plugin can run in xpert and data-xpert.
285
+ */
286
+ export interface XpertRemoteViewHostEventMessage {
287
+ /** Stable event id for diagnostics and de-duping. */
288
+ id: string;
289
+ /** Machine-readable event type, for example `assistant.tool.completed`. */
290
+ type: string;
291
+ /** Event source, for example `chatkit`. */
292
+ source: string;
293
+ /** ISO timestamp captured when the host normalized the event. */
294
+ receivedAt: string;
295
+ /** Conversation or execution thread id when available. */
296
+ threadId?: string;
297
+ /** Tool name for assistant tool events. */
298
+ toolName?: string;
299
+ /** Tool call id when provided by the runtime. */
300
+ toolCallId?: string;
301
+ /** Runtime run id when provided by the runtime. */
302
+ runId?: string;
303
+ /** Tool duration in milliseconds when provided by the runtime. */
304
+ durationMs?: number;
305
+ /** Opaque event data. Plugin-specific ids stay inside this payload. */
306
+ data?: Record<string, unknown>;
307
+ /** Optional visualization metadata used by manifest filters and remote views. */
308
+ visualization?: XpertViewHostEventVisualization;
309
+ }
310
+ /**
311
+ * Host-internal event message. `hostType` and `hostId` are routing fields and
312
+ * must be stripped before forwarding to remote components.
313
+ */
314
+ export interface XpertViewHostEventMessage extends XpertRemoteViewHostEventMessage {
315
+ hostType?: string;
316
+ hostId?: string;
317
+ }
245
318
  export interface XpertExtensionViewManifest {
246
319
  key: string;
247
320
  title: I18nObject;