@xpert-ai/plugin-sdk 3.12.0 → 3.12.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @xpert-ai/plugin-sdk
2
2
 
3
+ ## 3.12.2
4
+
5
+ ### Patch Changes
6
+
7
+ - f23228b: client commands for extension view
8
+ - Updated dependencies [e6528c8]
9
+ - Updated dependencies [f23228b]
10
+ - @xpert-ai/contracts@3.13.0
11
+
12
+ ## 3.12.1
13
+
14
+ ### Patch Changes
15
+
16
+ - 6a17eca: plugin sdk and mcp toolset close
17
+ - Updated dependencies [6a17eca]
18
+ - @xpert-ai/contracts@3.12.1
19
+
3
20
  ## 3.12.0
4
21
 
5
22
  ### Minor Changes
package/index.cjs.js CHANGED
@@ -1300,6 +1300,40 @@ exports.PluginWebhookAuthGuard = __decorate([
1300
1300
  ])
1301
1301
  ], exports.PluginWebhookAuthGuard);
1302
1302
 
1303
+ function createRuntimeCapability(id, options = {}) {
1304
+ return Object.freeze({
1305
+ id,
1306
+ description: options.description
1307
+ });
1308
+ }
1309
+ const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
1310
+ class DefaultRuntimeCapabilityRegistry {
1311
+ register(key, implementation) {
1312
+ this.capabilities.set(runtimeCapabilityId(key), implementation);
1313
+ return this;
1314
+ }
1315
+ has(key) {
1316
+ return this.capabilities.has(runtimeCapabilityId(key));
1317
+ }
1318
+ get(key) {
1319
+ return this.capabilities.get(runtimeCapabilityId(key));
1320
+ }
1321
+ require(key) {
1322
+ const implementation = this.get(key);
1323
+ if (!implementation) {
1324
+ throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
1325
+ }
1326
+ return implementation;
1327
+ }
1328
+ constructor(entries = []){
1329
+ this.capabilities = new Map();
1330
+ entries.forEach(([key, implementation])=>this.register(key, implementation));
1331
+ }
1332
+ }
1333
+ function runtimeCapabilityId(key) {
1334
+ return typeof key === 'string' ? key : key.id;
1335
+ }
1336
+
1303
1337
  const DATASOURCE_STRATEGY = 'DATASOURCE_STRATEGY';
1304
1338
  const DataSourceStrategy = (provider)=>common.applyDecorators(common.SetMetadata(DATASOURCE_STRATEGY, provider), common.SetMetadata(STRATEGY_META_KEY, DATASOURCE_STRATEGY));
1305
1339
 
@@ -2675,6 +2709,18 @@ Reflect.defineMetadata(COMMAND_METADATA$1, {
2675
2709
  id: CreateModelClientCommand.type
2676
2710
  }, CreateModelClientCommand);
2677
2711
 
2712
+ const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
2713
+ description: 'List, search, and write chunks in platform knowledgebases.'
2714
+ });
2715
+
2716
+ const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
2717
+ description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2718
+ });
2719
+
2720
+ const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
2721
+ description: 'Upload, read, and delete raw files in Xpert workspace volumes.'
2722
+ });
2723
+
2678
2724
  const SKILL_SOURCE_PROVIDER = 'SKILL_SOURCE_PROVIDER';
2679
2725
  const SkillSourceProviderStrategy = (provider)=>common.applyDecorators(common.SetMetadata(SKILL_SOURCE_PROVIDER, provider), common.SetMetadata(STRATEGY_META_KEY, SKILL_SOURCE_PROVIDER));
2680
2726
 
@@ -2715,48 +2761,6 @@ exports.AgentMiddlewareRegistry = __decorate([
2715
2761
  "end"
2716
2762
  ];
2717
2763
 
2718
- function createRuntimeCapability(id, options = {}) {
2719
- return Object.freeze({
2720
- id,
2721
- description: options.description
2722
- });
2723
- }
2724
- const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
2725
- class DefaultAgentMiddlewareRuntimeCapabilityRegistry {
2726
- register(key, implementation) {
2727
- this.capabilities.set(runtimeCapabilityId(key), implementation);
2728
- return this;
2729
- }
2730
- has(key) {
2731
- return this.capabilities.has(runtimeCapabilityId(key));
2732
- }
2733
- get(key) {
2734
- return this.capabilities.get(runtimeCapabilityId(key));
2735
- }
2736
- require(key) {
2737
- const implementation = this.get(key);
2738
- if (!implementation) {
2739
- throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
2740
- }
2741
- return implementation;
2742
- }
2743
- constructor(entries = []){
2744
- this.capabilities = new Map();
2745
- entries.forEach(([key, implementation])=>this.register(key, implementation));
2746
- }
2747
- }
2748
- function runtimeCapabilityId(key) {
2749
- return typeof key === 'string' ? key : key.id;
2750
- }
2751
-
2752
- const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
2753
- description: 'List, search, and write chunks in platform knowledgebases.'
2754
- });
2755
-
2756
- const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
2757
- description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2758
- });
2759
-
2760
2764
  const AssistantTaskRuntimeCapability = createRuntimeCapability('platform.assistant_task', {
2761
2765
  description: 'Start asynchronous tasks on the current platform assistant.'
2762
2766
  });
@@ -4516,6 +4520,14 @@ function escapeHtmlAttribute(value) {
4516
4520
 
4517
4521
  const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
4518
4522
 
4523
+ Object.defineProperty(exports, "ASSISTANT_CHAT_SEND_MESSAGE_COMMAND", {
4524
+ enumerable: true,
4525
+ get: function () { return contracts.ASSISTANT_CHAT_SEND_MESSAGE_COMMAND; }
4526
+ });
4527
+ Object.defineProperty(exports, "ASSISTANT_CONTEXT_SET_COMMAND", {
4528
+ enumerable: true,
4529
+ get: function () { return contracts.ASSISTANT_CONTEXT_SET_COMMAND; }
4530
+ });
4519
4531
  exports.ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN = ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN;
4520
4532
  exports.AGENT_CHAT_DISPATCH_MESSAGE_TYPE = AGENT_CHAT_DISPATCH_MESSAGE_TYPE;
4521
4533
  exports.AGENT_MIDDLEWARE_STRATEGY = AGENT_MIDDLEWARE_STRATEGY;
@@ -4559,7 +4571,8 @@ exports.DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC = DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC;
4559
4571
  exports.DOCUMENT_SOURCE_STRATEGY = DOCUMENT_SOURCE_STRATEGY;
4560
4572
  exports.DOCUMENT_TRANSFORMER_STRATEGY = DOCUMENT_TRANSFORMER_STRATEGY;
4561
4573
  exports.DataSourceStrategy = DataSourceStrategy;
4562
- exports.DefaultAgentMiddlewareRuntimeCapabilityRegistry = DefaultAgentMiddlewareRuntimeCapabilityRegistry;
4574
+ exports.DefaultAgentMiddlewareRuntimeCapabilityRegistry = DefaultRuntimeCapabilityRegistry;
4575
+ exports.DefaultRuntimeCapabilityRegistry = DefaultRuntimeCapabilityRegistry;
4563
4576
  exports.DocumentSourceStrategy = DocumentSourceStrategy;
4564
4577
  exports.DocumentTransformerStrategy = DocumentTransformerStrategy;
4565
4578
  exports.FILE_STORAGE_PROVIDER = FILE_STORAGE_PROVIDER;
@@ -4634,6 +4647,7 @@ exports.WORKFLOW_NODE_STRATEGY = WORKFLOW_NODE_STRATEGY;
4634
4647
  exports.WORKFLOW_TRIGGER_STRATEGY = WORKFLOW_TRIGGER_STRATEGY;
4635
4648
  exports.WorkflowNodeStrategy = WorkflowNodeStrategy;
4636
4649
  exports.WorkflowTriggerStrategy = WorkflowTriggerStrategy;
4650
+ exports.WorkspaceFilesRuntimeCapability = WorkspaceFilesRuntimeCapability;
4637
4651
  exports.WrapWorkflowNodeExecutionCommand = WrapWorkflowNodeExecutionCommand;
4638
4652
  exports.XPERT_RUNTIME_CAPABILITIES_TOKEN = XPERT_RUNTIME_CAPABILITIES_TOKEN;
4639
4653
  exports.XpFileSystem = XpFileSystem;
package/index.esm.js CHANGED
@@ -4,6 +4,7 @@ import { pick } from 'lodash-es';
4
4
  import { DiscoveryService, Reflector } from '@nestjs/core';
5
5
  import { Subject, filter } from 'rxjs';
6
6
  import { LanguagesEnum, AiModelTypeEnum, ParameterType, PriceType, FetchFrom, ModelFeature, ModelPropertyKey } from '@xpert-ai/contracts';
7
+ export { ASSISTANT_CHAT_SEND_MESSAGE_COMMAND, ASSISTANT_CONTEXT_SET_COMMAND } from '@xpert-ai/contracts';
7
8
  import { AsyncLocalStorage } from 'node:async_hooks';
8
9
  import { ExtractJwt } from 'passport-jwt';
9
10
  import { verify, JsonWebTokenError } from 'jsonwebtoken';
@@ -1279,6 +1280,40 @@ PluginWebhookAuthGuard = __decorate([
1279
1280
  ])
1280
1281
  ], PluginWebhookAuthGuard);
1281
1282
 
1283
+ function createRuntimeCapability(id, options = {}) {
1284
+ return Object.freeze({
1285
+ id,
1286
+ description: options.description
1287
+ });
1288
+ }
1289
+ const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
1290
+ class DefaultRuntimeCapabilityRegistry {
1291
+ register(key, implementation) {
1292
+ this.capabilities.set(runtimeCapabilityId(key), implementation);
1293
+ return this;
1294
+ }
1295
+ has(key) {
1296
+ return this.capabilities.has(runtimeCapabilityId(key));
1297
+ }
1298
+ get(key) {
1299
+ return this.capabilities.get(runtimeCapabilityId(key));
1300
+ }
1301
+ require(key) {
1302
+ const implementation = this.get(key);
1303
+ if (!implementation) {
1304
+ throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
1305
+ }
1306
+ return implementation;
1307
+ }
1308
+ constructor(entries = []){
1309
+ this.capabilities = new Map();
1310
+ entries.forEach(([key, implementation])=>this.register(key, implementation));
1311
+ }
1312
+ }
1313
+ function runtimeCapabilityId(key) {
1314
+ return typeof key === 'string' ? key : key.id;
1315
+ }
1316
+
1282
1317
  const DATASOURCE_STRATEGY = 'DATASOURCE_STRATEGY';
1283
1318
  const DataSourceStrategy = (provider)=>applyDecorators(SetMetadata(DATASOURCE_STRATEGY, provider), SetMetadata(STRATEGY_META_KEY, DATASOURCE_STRATEGY));
1284
1319
 
@@ -2654,6 +2689,18 @@ Reflect.defineMetadata(COMMAND_METADATA$1, {
2654
2689
  id: CreateModelClientCommand.type
2655
2690
  }, CreateModelClientCommand);
2656
2691
 
2692
+ const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
2693
+ description: 'List, search, and write chunks in platform knowledgebases.'
2694
+ });
2695
+
2696
+ const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
2697
+ description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2698
+ });
2699
+
2700
+ const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
2701
+ description: 'Upload, read, and delete raw files in Xpert workspace volumes.'
2702
+ });
2703
+
2657
2704
  const SKILL_SOURCE_PROVIDER = 'SKILL_SOURCE_PROVIDER';
2658
2705
  const SkillSourceProviderStrategy = (provider)=>applyDecorators(SetMetadata(SKILL_SOURCE_PROVIDER, provider), SetMetadata(STRATEGY_META_KEY, SKILL_SOURCE_PROVIDER));
2659
2706
 
@@ -2694,48 +2741,6 @@ AgentMiddlewareRegistry = __decorate([
2694
2741
  "end"
2695
2742
  ];
2696
2743
 
2697
- function createRuntimeCapability(id, options = {}) {
2698
- return Object.freeze({
2699
- id,
2700
- description: options.description
2701
- });
2702
- }
2703
- const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
2704
- class DefaultAgentMiddlewareRuntimeCapabilityRegistry {
2705
- register(key, implementation) {
2706
- this.capabilities.set(runtimeCapabilityId(key), implementation);
2707
- return this;
2708
- }
2709
- has(key) {
2710
- return this.capabilities.has(runtimeCapabilityId(key));
2711
- }
2712
- get(key) {
2713
- return this.capabilities.get(runtimeCapabilityId(key));
2714
- }
2715
- require(key) {
2716
- const implementation = this.get(key);
2717
- if (!implementation) {
2718
- throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
2719
- }
2720
- return implementation;
2721
- }
2722
- constructor(entries = []){
2723
- this.capabilities = new Map();
2724
- entries.forEach(([key, implementation])=>this.register(key, implementation));
2725
- }
2726
- }
2727
- function runtimeCapabilityId(key) {
2728
- return typeof key === 'string' ? key : key.id;
2729
- }
2730
-
2731
- const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
2732
- description: 'List, search, and write chunks in platform knowledgebases.'
2733
- });
2734
-
2735
- const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
2736
- description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2737
- });
2738
-
2739
2744
  const AssistantTaskRuntimeCapability = createRuntimeCapability('platform.assistant_task', {
2740
2745
  description: 'Start asynchronous tasks on the current platform assistant.'
2741
2746
  });
@@ -4495,4 +4500,4 @@ function escapeHtmlAttribute(value) {
4495
4500
 
4496
4501
  const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
4497
4502
 
4498
- export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PERMISSION_SERVICE_TOKEN, AdapterDataSourceStrategy, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AiModelNotFoundException, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CommonParameterRules, CreateModelClientCommand, CredentialsValidateFailedError, DATASOURCE_STRATEGY, DBCreateTableMode, DBProtocolEnum, DBSyntaxEnum, DBTableAction, DBTableDataAction, DEFAULT_EXECUTION_CONFIG, DEFAULT_SANDBOX_EXECUTION_MAX_OUTPUT_BYTES, DEFAULT_SANDBOX_FILE_OPERATION_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_SEC, DEFAULT_SANDBOX_FILE_SEARCH_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_SEC, DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS, DEFAULT_SANDBOX_SHELL_TIMEOUT_MS, DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC, DOCUMENT_SOURCE_STRATEGY, DOCUMENT_TRANSFORMER_STRATEGY, DataSourceStrategy, DataSourceStrategyRegistry, DefaultAgentMiddlewareRuntimeCapabilityRegistry, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, FileRuntimeCapability, FileStorageProvider, FileStorageProviderRegistry, FileUploadTargetRegistry, FileUploadTargetStrategy, GLOBAL_ORGANIZATION_SCOPE, HANDOFF_PERMISSION_SERVICE_TOKEN, HANDOFF_PROCESSOR_STRATEGY, HANDOFF_QUEUE_SERVICE_TOKEN, HandoffProcessorRegistry, HandoffProcessorStrategy, IMAGE_UNDERSTANDING_STRATEGY, INTEGRATION_PERMISSION_SERVICE_TOKEN, INTEGRATION_STRATEGY, ImageUnderstandingRegistry, ImageUnderstandingStrategy, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KNOWLEDGE_STRATEGY, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, PROVIDE_AI_MODEL_LLM, PROVIDE_AI_MODEL_MODERATION, PROVIDE_AI_MODEL_RERANK, PROVIDE_AI_MODEL_SPEECH2TEXT, PROVIDE_AI_MODEL_TEXT_EMBEDDING, PROVIDE_AI_MODEL_TTS, PluginWebhookAuth, PluginWebhookAuthGuard, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SKILL_SOURCE_PROVIDER, SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN, SPEECH_TO_TEXT_SERVICE_TOKEN, SSOProviderRegistry, SSOProviderStrategyKey, SSO_BINDING_PERMISSION_SERVICE_TOKEN, SSO_PROVIDER, STRATEGY_META_KEY, SandboxProviderRegistry, SandboxProviderStrategy, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, TEXT_SPLITTER_STRATEGY, TOOLSET_STRATEGY, TextEmbeddingModelManager, TextSplitterRegistry, TextSplitterStrategy, TextToSpeechModel, ToolsetRegistry, ToolsetStrategy, USER_PERMISSION_SERVICE_TOKEN, VECTOR_STORE_STRATEGY, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, ViewExtensionProvider, ViewExtensionProviderRegistry, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, renderRemoteReactIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, runWithRequestContext, secondsToMilliseconds, sumTokenUsage };
4503
+ export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PERMISSION_SERVICE_TOKEN, AdapterDataSourceStrategy, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AiModelNotFoundException, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CommonParameterRules, CreateModelClientCommand, CredentialsValidateFailedError, DATASOURCE_STRATEGY, DBCreateTableMode, DBProtocolEnum, DBSyntaxEnum, DBTableAction, DBTableDataAction, DEFAULT_EXECUTION_CONFIG, DEFAULT_SANDBOX_EXECUTION_MAX_OUTPUT_BYTES, DEFAULT_SANDBOX_FILE_OPERATION_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_SEC, DEFAULT_SANDBOX_FILE_SEARCH_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_SEC, DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS, DEFAULT_SANDBOX_SHELL_TIMEOUT_MS, DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC, DOCUMENT_SOURCE_STRATEGY, DOCUMENT_TRANSFORMER_STRATEGY, DataSourceStrategy, DataSourceStrategyRegistry, DefaultRuntimeCapabilityRegistry as DefaultAgentMiddlewareRuntimeCapabilityRegistry, DefaultRuntimeCapabilityRegistry, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, FileRuntimeCapability, FileStorageProvider, FileStorageProviderRegistry, FileUploadTargetRegistry, FileUploadTargetStrategy, GLOBAL_ORGANIZATION_SCOPE, HANDOFF_PERMISSION_SERVICE_TOKEN, HANDOFF_PROCESSOR_STRATEGY, HANDOFF_QUEUE_SERVICE_TOKEN, HandoffProcessorRegistry, HandoffProcessorStrategy, IMAGE_UNDERSTANDING_STRATEGY, INTEGRATION_PERMISSION_SERVICE_TOKEN, INTEGRATION_STRATEGY, ImageUnderstandingRegistry, ImageUnderstandingStrategy, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KNOWLEDGE_STRATEGY, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, PROVIDE_AI_MODEL_LLM, PROVIDE_AI_MODEL_MODERATION, PROVIDE_AI_MODEL_RERANK, PROVIDE_AI_MODEL_SPEECH2TEXT, PROVIDE_AI_MODEL_TEXT_EMBEDDING, PROVIDE_AI_MODEL_TTS, PluginWebhookAuth, PluginWebhookAuthGuard, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SKILL_SOURCE_PROVIDER, SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN, SPEECH_TO_TEXT_SERVICE_TOKEN, SSOProviderRegistry, SSOProviderStrategyKey, SSO_BINDING_PERMISSION_SERVICE_TOKEN, SSO_PROVIDER, STRATEGY_META_KEY, SandboxProviderRegistry, SandboxProviderStrategy, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, TEXT_SPLITTER_STRATEGY, TOOLSET_STRATEGY, TextEmbeddingModelManager, TextSplitterRegistry, TextSplitterStrategy, TextToSpeechModel, ToolsetRegistry, ToolsetStrategy, USER_PERMISSION_SERVICE_TOKEN, VECTOR_STORE_STRATEGY, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, ViewExtensionProvider, ViewExtensionProviderRegistry, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, renderRemoteReactIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, runWithRequestContext, secondsToMilliseconds, sumTokenUsage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/plugin-sdk",
3
- "version": "3.12.0",
3
+ "version": "3.12.2",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './lib/toolset/index';
11
11
  export * from './lib/core/index';
12
12
  export * from './lib/data/index';
13
13
  export * from './lib/ai-model/index';
14
+ export * from './lib/runtime/index';
14
15
  export * from './lib/agent/index';
15
16
  export * from './lib/channel/index';
16
17
  export * from './lib/file/index';
@@ -42,4 +42,4 @@ export interface AgentMiddlewareAssistantTaskApi {
42
42
  startTask(input: AgentMiddlewareAssistantTaskInput): Promise<AgentMiddlewareAssistantTaskResult>;
43
43
  getTaskStatus?(input: AgentMiddlewareAssistantTaskStatusInput): Promise<AgentMiddlewareAssistantTaskResult | null>;
44
44
  }
45
- export declare const AssistantTaskRuntimeCapability: import("../runtime-capability").RuntimeCapabilityKey<AgentMiddlewareAssistantTaskApi>;
45
+ export declare const AssistantTaskRuntimeCapability: import("../../../core/runtime-capability").RuntimeCapabilityKey<AgentMiddlewareAssistantTaskApi>;
@@ -26,4 +26,4 @@ export type AgentMiddlewareResolvedFile = {
26
26
  export interface AgentMiddlewareFileApi {
27
27
  resolveFile(input: AgentMiddlewareFileReference): Promise<AgentMiddlewareResolvedFile | null>;
28
28
  }
29
- export declare const FileRuntimeCapability: import("../runtime-capability").RuntimeCapabilityKey<AgentMiddlewareFileApi>;
29
+ export declare const FileRuntimeCapability: import("../../../core/runtime-capability").RuntimeCapabilityKey<AgentMiddlewareFileApi>;
@@ -1,4 +1,2 @@
1
- export * from './knowledgebase';
2
- export * from './knowledgebase-documents';
3
1
  export * from './assistant-task';
4
2
  export * from './file';
@@ -1,22 +1,2 @@
1
- export type RuntimeCapabilityKey<T> = {
2
- readonly id: string;
3
- readonly description?: string;
4
- readonly __type?: T;
5
- };
6
- export declare function createRuntimeCapability<T>(id: string, options?: {
7
- description?: string;
8
- }): RuntimeCapabilityKey<T>;
9
- export interface AgentMiddlewareRuntimeCapabilityRegistry {
10
- has<T>(key: RuntimeCapabilityKey<T> | string): boolean;
11
- get<T>(key: RuntimeCapabilityKey<T> | string): T | undefined;
12
- require<T>(key: RuntimeCapabilityKey<T> | string): T;
13
- }
14
- export declare const XPERT_RUNTIME_CAPABILITIES_TOKEN = "XPERT_RUNTIME_CAPABILITIES";
15
- export declare class DefaultAgentMiddlewareRuntimeCapabilityRegistry implements AgentMiddlewareRuntimeCapabilityRegistry {
16
- private readonly capabilities;
17
- constructor(entries?: Array<[RuntimeCapabilityKey<unknown> | string, unknown]>);
18
- register<T>(key: RuntimeCapabilityKey<T> | string, implementation: T): this;
19
- has<T>(key: RuntimeCapabilityKey<T> | string): boolean;
20
- get<T>(key: RuntimeCapabilityKey<T> | string): T | undefined;
21
- require<T>(key: RuntimeCapabilityKey<T> | string): T;
22
- }
1
+ export { createRuntimeCapability, DefaultRuntimeCapabilityRegistry, DefaultRuntimeCapabilityRegistry as DefaultAgentMiddlewareRuntimeCapabilityRegistry, XPERT_RUNTIME_CAPABILITIES_TOKEN } from '../../core/runtime-capability';
2
+ export type { RuntimeCapabilityKey, RuntimeCapabilityRegistry, RuntimeCapabilityRegistry as AgentMiddlewareRuntimeCapabilityRegistry } from '../../core/runtime-capability';
@@ -6,7 +6,7 @@ import type { BaseMessage } from '@langchain/core/messages';
6
6
  import { ICopilotModel, ILLMUsage, IXpertAgentExecution, JSONValue, TSandboxConfigurable } from '@xpert-ai/contracts';
7
7
  import { Subscriber } from 'rxjs';
8
8
  import { IRerank } from '../../ai-model/types';
9
- import type { AgentMiddlewareRuntimeCapabilityRegistry } from './runtime-capability';
9
+ import type { RuntimeCapabilityRegistry } from '../../core';
10
10
  export * from './runtime-capability';
11
11
  export * from './capabilities';
12
12
  /**
@@ -99,5 +99,5 @@ export interface AgentMiddlewareRuntimeApi {
99
99
  createModelClient<T = AgentMiddlewareModelClient>(copilotModel: ICopilotModel, options: AgentMiddlewareCreateModelClientOptions): Promise<T>;
100
100
  wrapWorkflowNodeExecution<T>(run: (execution: Partial<IXpertAgentExecution>) => Promise<AgentMiddlewareWrapWorkflowNodeExecutionResult<T>>, params: AgentMiddlewareWrapWorkflowNodeExecutionParams): Promise<T>;
101
101
  emitMiddlewareEvent?(event: AgentMiddlewareEvent): Promise<void> | void;
102
- capabilities?: AgentMiddlewareRuntimeCapabilityRegistry;
102
+ capabilities?: RuntimeCapabilityRegistry;
103
103
  }
@@ -8,3 +8,4 @@ export * from './context/index';
8
8
  export * from './types';
9
9
  export * from './strategy-bus';
10
10
  export * from './webhook';
11
+ export * from './runtime-capability';
@@ -0,0 +1,22 @@
1
+ export type RuntimeCapabilityKey<T> = {
2
+ readonly id: string;
3
+ readonly description?: string;
4
+ readonly __type?: T;
5
+ };
6
+ export declare function createRuntimeCapability<T>(id: string, options?: {
7
+ description?: string;
8
+ }): RuntimeCapabilityKey<T>;
9
+ export interface RuntimeCapabilityRegistry {
10
+ has<T>(key: RuntimeCapabilityKey<T> | string): boolean;
11
+ get<T>(key: RuntimeCapabilityKey<T> | string): T | undefined;
12
+ require<T>(key: RuntimeCapabilityKey<T> | string): T;
13
+ }
14
+ export declare const XPERT_RUNTIME_CAPABILITIES_TOKEN = "XPERT_RUNTIME_CAPABILITIES";
15
+ export declare class DefaultRuntimeCapabilityRegistry implements RuntimeCapabilityRegistry {
16
+ private readonly capabilities;
17
+ constructor(entries?: Array<[RuntimeCapabilityKey<unknown> | string, unknown]>);
18
+ register<T>(key: RuntimeCapabilityKey<T> | string, implementation: T): this;
19
+ has<T>(key: RuntimeCapabilityKey<T> | string): boolean;
20
+ get<T>(key: RuntimeCapabilityKey<T> | string): T | undefined;
21
+ require<T>(key: RuntimeCapabilityKey<T> | string): T;
22
+ }
@@ -0,0 +1,3 @@
1
+ export * from './knowledgebase';
2
+ export * from './knowledgebase-documents';
3
+ export * from './workspace-files';
@@ -0,0 +1,121 @@
1
+ import { JSONValue } from '@xpert-ai/contracts';
2
+ export type KnowledgebaseDocumentFile = {
3
+ buffer: Buffer;
4
+ originalname?: string;
5
+ mimetype?: string;
6
+ size?: number;
7
+ };
8
+ export type KnowledgebaseDocumentMetadata = Record<string, JSONValue>;
9
+ export type KnowledgebaseDocumentParserConfig = Record<string, JSONValue>;
10
+ export type KnowledgebaseDocumentDraft = {
11
+ id?: string;
12
+ name?: string;
13
+ type?: string;
14
+ category?: string;
15
+ sourceType?: string;
16
+ sourceConfig?: Record<string, JSONValue>;
17
+ filePath?: string;
18
+ fileUrl?: string;
19
+ mimeType?: string;
20
+ size?: string | number;
21
+ parentId?: string;
22
+ parserConfig?: KnowledgebaseDocumentParserConfig;
23
+ metadata?: KnowledgebaseDocumentMetadata;
24
+ };
25
+ export type KnowledgebaseDocumentRecord = {
26
+ id: string;
27
+ name?: string;
28
+ type?: string;
29
+ category?: string | null;
30
+ sourceType?: string | null;
31
+ filePath?: string;
32
+ fileUrl?: string;
33
+ mimeType?: string;
34
+ size?: string | number;
35
+ status?: string | null;
36
+ progress?: number | null;
37
+ processMsg?: string | null;
38
+ knowledgebaseId?: string;
39
+ metadata?: KnowledgebaseDocumentMetadata;
40
+ };
41
+ export type KnowledgebaseUploadFileInput = {
42
+ knowledgebaseId: string;
43
+ file: KnowledgebaseDocumentFile;
44
+ path?: string;
45
+ parentId?: string;
46
+ };
47
+ export type KnowledgebaseUploadedFile = {
48
+ name: string;
49
+ filePath: string;
50
+ fileUrl: string;
51
+ mimeType?: string;
52
+ size?: number;
53
+ sourceHash?: string;
54
+ };
55
+ export type KnowledgebaseCreateDocumentsInput = {
56
+ knowledgebaseId: string;
57
+ documents: KnowledgebaseDocumentDraft[];
58
+ parserConfig?: KnowledgebaseDocumentParserConfig;
59
+ metadata?: KnowledgebaseDocumentMetadata;
60
+ process?: boolean;
61
+ };
62
+ export type KnowledgebaseCreateDocumentsResult = {
63
+ documents: KnowledgebaseDocumentRecord[];
64
+ processingStarted?: boolean;
65
+ };
66
+ export type KnowledgebaseImportArchiveInput = {
67
+ knowledgebaseId: string;
68
+ file: KnowledgebaseDocumentFile;
69
+ path?: string;
70
+ parentId?: string;
71
+ packageId?: string;
72
+ packageCode?: string;
73
+ parserConfig?: KnowledgebaseDocumentParserConfig;
74
+ metadata?: KnowledgebaseDocumentMetadata;
75
+ process?: boolean;
76
+ maxEntries?: number;
77
+ maxEntrySizeBytes?: number;
78
+ maxDepth?: number;
79
+ supportedExtensions?: string[];
80
+ };
81
+ export type KnowledgebaseImportArchiveResult = {
82
+ archive: KnowledgebaseUploadedFile;
83
+ documents: KnowledgebaseDocumentRecord[];
84
+ skipped: Array<{
85
+ path: string;
86
+ reason: string;
87
+ }>;
88
+ warnings: string[];
89
+ processingStarted?: boolean;
90
+ unsupported?: boolean;
91
+ };
92
+ export type KnowledgebaseStartProcessingInput = {
93
+ knowledgebaseId?: string;
94
+ documentIds: string[];
95
+ };
96
+ export type KnowledgebaseDocumentStatusInput = {
97
+ knowledgebaseId?: string;
98
+ documentIds: string[];
99
+ };
100
+ export type KnowledgebaseDocumentStatusResult = {
101
+ documents: KnowledgebaseDocumentRecord[];
102
+ };
103
+ export type KnowledgebaseDeleteDocumentsInput = {
104
+ knowledgebaseId?: string;
105
+ documentIds: string[];
106
+ };
107
+ export type KnowledgebaseDeleteDocumentsResult = {
108
+ knowledgebaseId?: string;
109
+ documentIds: string[];
110
+ deletedDocumentCount: number;
111
+ missingDocumentIds?: string[];
112
+ };
113
+ export interface KnowledgebaseDocumentsApi {
114
+ uploadFile(input: KnowledgebaseUploadFileInput): Promise<KnowledgebaseUploadedFile>;
115
+ importArchive(input: KnowledgebaseImportArchiveInput): Promise<KnowledgebaseImportArchiveResult>;
116
+ createDocuments(input: KnowledgebaseCreateDocumentsInput): Promise<KnowledgebaseCreateDocumentsResult>;
117
+ startProcessing(input: KnowledgebaseStartProcessingInput): Promise<KnowledgebaseDocumentStatusResult>;
118
+ getDocumentStatus(input: KnowledgebaseDocumentStatusInput): Promise<KnowledgebaseDocumentStatusResult>;
119
+ deleteDocuments(input: KnowledgebaseDeleteDocumentsInput): Promise<KnowledgebaseDeleteDocumentsResult>;
120
+ }
121
+ export declare const KnowledgebaseDocumentsRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<KnowledgebaseDocumentsApi>;
@@ -1,36 +1,36 @@
1
1
  import { JSONValue } from '@xpert-ai/contracts';
2
- export type AgentMiddlewareKnowledgebaseRetrievalMode = 'vector' | 'graph' | 'hybrid';
3
- export type AgentMiddlewareKnowledgebaseMetadata = Record<string, JSONValue>;
4
- export type AgentMiddlewareKnowledgebaseRetrievalSettings = {
5
- mode?: AgentMiddlewareKnowledgebaseRetrievalMode;
2
+ export type KnowledgebaseRetrievalMode = 'vector' | 'graph' | 'hybrid';
3
+ export type KnowledgebaseMetadata = Record<string, JSONValue>;
4
+ export type KnowledgebaseRetrievalSettings = {
5
+ mode?: KnowledgebaseRetrievalMode;
6
6
  neighborHops?: number;
7
7
  entityTopK?: number;
8
8
  communityTopK?: number;
9
9
  graphWeight?: number;
10
10
  };
11
- export type AgentMiddlewareKnowledgebaseSearchInput = {
11
+ export type KnowledgebaseSearchInput = {
12
12
  tenantId?: string;
13
13
  organizationId?: string;
14
14
  knowledgebaseIds: string[];
15
15
  query: string;
16
16
  k?: number;
17
17
  score?: number;
18
- filter?: AgentMiddlewareKnowledgebaseMetadata;
19
- retrieval?: AgentMiddlewareKnowledgebaseRetrievalSettings;
18
+ filter?: KnowledgebaseMetadata;
19
+ retrieval?: KnowledgebaseRetrievalSettings;
20
20
  source: string;
21
21
  requestId?: string;
22
22
  };
23
- export type AgentMiddlewareKnowledgebaseDocument = {
23
+ export type KnowledgebaseDocument = {
24
24
  id?: string;
25
25
  pageContent: string;
26
26
  metadata?: Record<string, unknown>;
27
27
  };
28
- export type AgentMiddlewareKnowledgebaseListInput = {
28
+ export type KnowledgebaseListInput = {
29
29
  workspaceId?: string | null;
30
30
  published?: boolean;
31
31
  limit?: number;
32
32
  };
33
- export type AgentMiddlewareKnowledgebaseListItem = {
33
+ export type KnowledgebaseListItem = {
34
34
  id: string;
35
35
  name?: string;
36
36
  description?: string | null;
@@ -46,24 +46,24 @@ export type AgentMiddlewareKnowledgebaseListItem = {
46
46
  } | null;
47
47
  graphStatus?: string | null;
48
48
  };
49
- export type AgentMiddlewareKnowledgebaseWriteChunkInput = {
49
+ export type KnowledgebaseWriteChunkInput = {
50
50
  xpertId: string;
51
51
  agentKey: string;
52
52
  knowledgebaseIds: string[];
53
53
  knowledgebaseId: string;
54
54
  text: string;
55
55
  title?: string;
56
- metadata?: AgentMiddlewareKnowledgebaseMetadata;
56
+ metadata?: KnowledgebaseMetadata;
57
57
  writeKey: string;
58
58
  executionId?: string;
59
59
  threadId?: string;
60
60
  };
61
- export type AgentMiddlewareKnowledgebaseWriteChunkResult = {
61
+ export type KnowledgebaseWriteChunkResult = {
62
62
  status?: 'created' | 'skipped';
63
63
  chunkId?: string;
64
64
  message?: string;
65
65
  };
66
- export type AgentMiddlewareKnowledgebaseDeleteChunksInput = {
66
+ export type KnowledgebaseDeleteChunksInput = {
67
67
  xpertId: string;
68
68
  agentKey: string;
69
69
  knowledgebaseIds: string[];
@@ -71,17 +71,17 @@ export type AgentMiddlewareKnowledgebaseDeleteChunksInput = {
71
71
  writeKeys?: string[];
72
72
  writeKeyPrefix?: string;
73
73
  };
74
- export type AgentMiddlewareKnowledgebaseDeleteChunksResult = {
74
+ export type KnowledgebaseDeleteChunksResult = {
75
75
  deletedCount: number;
76
76
  knowledgebaseId: string;
77
77
  documentId?: string;
78
78
  writeKeys?: string[];
79
79
  writeKeyPrefix?: string;
80
80
  };
81
- export interface AgentMiddlewareKnowledgebaseApi {
82
- list(input: AgentMiddlewareKnowledgebaseListInput): Promise<AgentMiddlewareKnowledgebaseListItem[]>;
83
- search(input: AgentMiddlewareKnowledgebaseSearchInput): Promise<AgentMiddlewareKnowledgebaseDocument[]>;
84
- writeChunk(input: AgentMiddlewareKnowledgebaseWriteChunkInput): Promise<AgentMiddlewareKnowledgebaseWriteChunkResult>;
85
- deleteChunks(input: AgentMiddlewareKnowledgebaseDeleteChunksInput): Promise<AgentMiddlewareKnowledgebaseDeleteChunksResult>;
81
+ export interface KnowledgebaseApi {
82
+ list(input: KnowledgebaseListInput): Promise<KnowledgebaseListItem[]>;
83
+ search(input: KnowledgebaseSearchInput): Promise<KnowledgebaseDocument[]>;
84
+ writeChunk(input: KnowledgebaseWriteChunkInput): Promise<KnowledgebaseWriteChunkResult>;
85
+ deleteChunks(input: KnowledgebaseDeleteChunksInput): Promise<KnowledgebaseDeleteChunksResult>;
86
86
  }
87
- export declare const KnowledgebaseRuntimeCapability: import("../runtime-capability").RuntimeCapabilityKey<AgentMiddlewareKnowledgebaseApi>;
87
+ export declare const KnowledgebaseRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<KnowledgebaseApi>;
@@ -0,0 +1,45 @@
1
+ export type WorkspaceFileCatalog = 'projects' | 'users' | 'knowledges' | 'skills' | 'xperts';
2
+ export type WorkspaceFileScope = {
3
+ tenantId?: string | null;
4
+ userId?: string | null;
5
+ catalog?: WorkspaceFileCatalog | null;
6
+ scopeId?: string | null;
7
+ projectId?: string | null;
8
+ knowledgeId?: string | null;
9
+ rootId?: string | null;
10
+ xpertId?: string | null;
11
+ isolateByUser?: boolean | null;
12
+ };
13
+ export type WorkspaceUploadBufferInput = WorkspaceFileScope & {
14
+ buffer: Buffer;
15
+ originalName: string;
16
+ mimeType?: string | null;
17
+ size?: number | null;
18
+ folder?: string | null;
19
+ fileName?: string | null;
20
+ metadata?: Record<string, unknown>;
21
+ };
22
+ export type WorkspaceFileReference = WorkspaceFileScope & {
23
+ filePath: string;
24
+ };
25
+ export type WorkspaceFile = {
26
+ name: string;
27
+ filePath: string;
28
+ workspacePath: string;
29
+ fileUrl?: string;
30
+ url?: string;
31
+ mimeType?: string;
32
+ size?: number;
33
+ catalog: WorkspaceFileCatalog;
34
+ scopeId?: string;
35
+ metadata?: Record<string, unknown>;
36
+ };
37
+ export type WorkspaceFileBuffer = WorkspaceFile & {
38
+ buffer: Buffer;
39
+ };
40
+ export interface WorkspaceFilesApi {
41
+ uploadBuffer(input: WorkspaceUploadBufferInput): Promise<WorkspaceFile>;
42
+ readBuffer(input: WorkspaceFileReference): Promise<WorkspaceFileBuffer>;
43
+ deleteFile(input: WorkspaceFileReference): Promise<void>;
44
+ }
45
+ export declare const WorkspaceFilesRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<WorkspaceFilesApi>;
@@ -0,0 +1,2 @@
1
+ export * from './runtime-capability';
2
+ export * from './capabilities';
@@ -0,0 +1 @@
1
+ export * from '../core/runtime-capability';
@@ -3,3 +3,4 @@ export * from './provider.interface';
3
3
  export * from './provider.registry';
4
4
  export * from './remote-component-html';
5
5
  export * from './tokens';
6
+ export { ASSISTANT_CHAT_SEND_MESSAGE_COMMAND, ASSISTANT_CONTEXT_SET_COMMAND } from '@xpert-ai/contracts';
@@ -1,121 +0,0 @@
1
- import { JSONValue } from '@xpert-ai/contracts';
2
- export type AgentMiddlewareKnowledgebaseDocumentFile = {
3
- buffer: Buffer;
4
- originalname?: string;
5
- mimetype?: string;
6
- size?: number;
7
- };
8
- export type AgentMiddlewareKnowledgebaseDocumentMetadata = Record<string, JSONValue>;
9
- export type AgentMiddlewareKnowledgebaseDocumentParserConfig = Record<string, JSONValue>;
10
- export type AgentMiddlewareKnowledgebaseDocumentDraft = {
11
- id?: string;
12
- name?: string;
13
- type?: string;
14
- category?: string;
15
- sourceType?: string;
16
- sourceConfig?: Record<string, JSONValue>;
17
- filePath?: string;
18
- fileUrl?: string;
19
- mimeType?: string;
20
- size?: string | number;
21
- parentId?: string;
22
- parserConfig?: AgentMiddlewareKnowledgebaseDocumentParserConfig;
23
- metadata?: AgentMiddlewareKnowledgebaseDocumentMetadata;
24
- };
25
- export type AgentMiddlewareKnowledgebaseDocumentRecord = {
26
- id: string;
27
- name?: string;
28
- type?: string;
29
- category?: string | null;
30
- sourceType?: string | null;
31
- filePath?: string;
32
- fileUrl?: string;
33
- mimeType?: string;
34
- size?: string | number;
35
- status?: string | null;
36
- progress?: number | null;
37
- processMsg?: string | null;
38
- knowledgebaseId?: string;
39
- metadata?: AgentMiddlewareKnowledgebaseDocumentMetadata;
40
- };
41
- export type AgentMiddlewareKnowledgebaseUploadFileInput = {
42
- knowledgebaseId: string;
43
- file: AgentMiddlewareKnowledgebaseDocumentFile;
44
- path?: string;
45
- parentId?: string;
46
- };
47
- export type AgentMiddlewareKnowledgebaseUploadedFile = {
48
- name: string;
49
- filePath: string;
50
- fileUrl: string;
51
- mimeType?: string;
52
- size?: number;
53
- sourceHash?: string;
54
- };
55
- export type AgentMiddlewareKnowledgebaseCreateDocumentsInput = {
56
- knowledgebaseId: string;
57
- documents: AgentMiddlewareKnowledgebaseDocumentDraft[];
58
- parserConfig?: AgentMiddlewareKnowledgebaseDocumentParserConfig;
59
- metadata?: AgentMiddlewareKnowledgebaseDocumentMetadata;
60
- process?: boolean;
61
- };
62
- export type AgentMiddlewareKnowledgebaseCreateDocumentsResult = {
63
- documents: AgentMiddlewareKnowledgebaseDocumentRecord[];
64
- processingStarted?: boolean;
65
- };
66
- export type AgentMiddlewareKnowledgebaseImportArchiveInput = {
67
- knowledgebaseId: string;
68
- file: AgentMiddlewareKnowledgebaseDocumentFile;
69
- path?: string;
70
- parentId?: string;
71
- packageId?: string;
72
- packageCode?: string;
73
- parserConfig?: AgentMiddlewareKnowledgebaseDocumentParserConfig;
74
- metadata?: AgentMiddlewareKnowledgebaseDocumentMetadata;
75
- process?: boolean;
76
- maxEntries?: number;
77
- maxEntrySizeBytes?: number;
78
- maxDepth?: number;
79
- supportedExtensions?: string[];
80
- };
81
- export type AgentMiddlewareKnowledgebaseImportArchiveResult = {
82
- archive: AgentMiddlewareKnowledgebaseUploadedFile;
83
- documents: AgentMiddlewareKnowledgebaseDocumentRecord[];
84
- skipped: Array<{
85
- path: string;
86
- reason: string;
87
- }>;
88
- warnings: string[];
89
- processingStarted?: boolean;
90
- unsupported?: boolean;
91
- };
92
- export type AgentMiddlewareKnowledgebaseStartProcessingInput = {
93
- knowledgebaseId?: string;
94
- documentIds: string[];
95
- };
96
- export type AgentMiddlewareKnowledgebaseDocumentStatusInput = {
97
- knowledgebaseId?: string;
98
- documentIds: string[];
99
- };
100
- export type AgentMiddlewareKnowledgebaseDocumentStatusResult = {
101
- documents: AgentMiddlewareKnowledgebaseDocumentRecord[];
102
- };
103
- export type AgentMiddlewareKnowledgebaseDeleteDocumentsInput = {
104
- knowledgebaseId?: string;
105
- documentIds: string[];
106
- };
107
- export type AgentMiddlewareKnowledgebaseDeleteDocumentsResult = {
108
- knowledgebaseId?: string;
109
- documentIds: string[];
110
- deletedDocumentCount: number;
111
- missingDocumentIds?: string[];
112
- };
113
- export interface AgentMiddlewareKnowledgebaseDocumentsApi {
114
- uploadFile(input: AgentMiddlewareKnowledgebaseUploadFileInput): Promise<AgentMiddlewareKnowledgebaseUploadedFile>;
115
- importArchive(input: AgentMiddlewareKnowledgebaseImportArchiveInput): Promise<AgentMiddlewareKnowledgebaseImportArchiveResult>;
116
- createDocuments(input: AgentMiddlewareKnowledgebaseCreateDocumentsInput): Promise<AgentMiddlewareKnowledgebaseCreateDocumentsResult>;
117
- startProcessing(input: AgentMiddlewareKnowledgebaseStartProcessingInput): Promise<AgentMiddlewareKnowledgebaseDocumentStatusResult>;
118
- getDocumentStatus(input: AgentMiddlewareKnowledgebaseDocumentStatusInput): Promise<AgentMiddlewareKnowledgebaseDocumentStatusResult>;
119
- deleteDocuments(input: AgentMiddlewareKnowledgebaseDeleteDocumentsInput): Promise<AgentMiddlewareKnowledgebaseDeleteDocumentsResult>;
120
- }
121
- export declare const KnowledgebaseDocumentsRuntimeCapability: import("../runtime-capability").RuntimeCapabilityKey<AgentMiddlewareKnowledgebaseDocumentsApi>;