@xpert-ai/plugin-sdk 3.12.0 → 3.12.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/CHANGELOG.md +8 -0
- package/index.cjs.js +49 -43
- package/index.esm.js +47 -43
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/lib/agent/middleware/capabilities/assistant-task.d.ts +1 -1
- package/src/lib/agent/middleware/capabilities/file.d.ts +1 -1
- package/src/lib/agent/middleware/capabilities/index.d.ts +0 -2
- package/src/lib/agent/middleware/runtime-capability.d.ts +2 -22
- package/src/lib/agent/middleware/runtime.d.ts +2 -2
- package/src/lib/core/index.d.ts +1 -0
- package/src/lib/core/runtime-capability.d.ts +22 -0
- package/src/lib/runtime/capabilities/index.d.ts +3 -0
- package/src/lib/runtime/capabilities/knowledgebase-documents.d.ts +121 -0
- package/src/lib/{agent/middleware → runtime}/capabilities/knowledgebase.d.ts +21 -21
- package/src/lib/runtime/capabilities/workspace-files.d.ts +45 -0
- package/src/lib/runtime/index.d.ts +2 -0
- package/src/lib/runtime/runtime-capability.d.ts +1 -0
- package/src/lib/agent/middleware/capabilities/knowledgebase-documents.d.ts +0 -121
package/CHANGELOG.md
CHANGED
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
|
});
|
|
@@ -4559,7 +4563,8 @@ exports.DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC = DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC;
|
|
|
4559
4563
|
exports.DOCUMENT_SOURCE_STRATEGY = DOCUMENT_SOURCE_STRATEGY;
|
|
4560
4564
|
exports.DOCUMENT_TRANSFORMER_STRATEGY = DOCUMENT_TRANSFORMER_STRATEGY;
|
|
4561
4565
|
exports.DataSourceStrategy = DataSourceStrategy;
|
|
4562
|
-
exports.DefaultAgentMiddlewareRuntimeCapabilityRegistry =
|
|
4566
|
+
exports.DefaultAgentMiddlewareRuntimeCapabilityRegistry = DefaultRuntimeCapabilityRegistry;
|
|
4567
|
+
exports.DefaultRuntimeCapabilityRegistry = DefaultRuntimeCapabilityRegistry;
|
|
4563
4568
|
exports.DocumentSourceStrategy = DocumentSourceStrategy;
|
|
4564
4569
|
exports.DocumentTransformerStrategy = DocumentTransformerStrategy;
|
|
4565
4570
|
exports.FILE_STORAGE_PROVIDER = FILE_STORAGE_PROVIDER;
|
|
@@ -4634,6 +4639,7 @@ exports.WORKFLOW_NODE_STRATEGY = WORKFLOW_NODE_STRATEGY;
|
|
|
4634
4639
|
exports.WORKFLOW_TRIGGER_STRATEGY = WORKFLOW_TRIGGER_STRATEGY;
|
|
4635
4640
|
exports.WorkflowNodeStrategy = WorkflowNodeStrategy;
|
|
4636
4641
|
exports.WorkflowTriggerStrategy = WorkflowTriggerStrategy;
|
|
4642
|
+
exports.WorkspaceFilesRuntimeCapability = WorkspaceFilesRuntimeCapability;
|
|
4637
4643
|
exports.WrapWorkflowNodeExecutionCommand = WrapWorkflowNodeExecutionCommand;
|
|
4638
4644
|
exports.XPERT_RUNTIME_CAPABILITIES_TOKEN = XPERT_RUNTIME_CAPABILITIES_TOKEN;
|
|
4639
4645
|
exports.XpFileSystem = XpFileSystem;
|
package/index.esm.js
CHANGED
|
@@ -1279,6 +1279,40 @@ PluginWebhookAuthGuard = __decorate([
|
|
|
1279
1279
|
])
|
|
1280
1280
|
], PluginWebhookAuthGuard);
|
|
1281
1281
|
|
|
1282
|
+
function createRuntimeCapability(id, options = {}) {
|
|
1283
|
+
return Object.freeze({
|
|
1284
|
+
id,
|
|
1285
|
+
description: options.description
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
|
|
1289
|
+
class DefaultRuntimeCapabilityRegistry {
|
|
1290
|
+
register(key, implementation) {
|
|
1291
|
+
this.capabilities.set(runtimeCapabilityId(key), implementation);
|
|
1292
|
+
return this;
|
|
1293
|
+
}
|
|
1294
|
+
has(key) {
|
|
1295
|
+
return this.capabilities.has(runtimeCapabilityId(key));
|
|
1296
|
+
}
|
|
1297
|
+
get(key) {
|
|
1298
|
+
return this.capabilities.get(runtimeCapabilityId(key));
|
|
1299
|
+
}
|
|
1300
|
+
require(key) {
|
|
1301
|
+
const implementation = this.get(key);
|
|
1302
|
+
if (!implementation) {
|
|
1303
|
+
throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
|
|
1304
|
+
}
|
|
1305
|
+
return implementation;
|
|
1306
|
+
}
|
|
1307
|
+
constructor(entries = []){
|
|
1308
|
+
this.capabilities = new Map();
|
|
1309
|
+
entries.forEach(([key, implementation])=>this.register(key, implementation));
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
function runtimeCapabilityId(key) {
|
|
1313
|
+
return typeof key === 'string' ? key : key.id;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1282
1316
|
const DATASOURCE_STRATEGY = 'DATASOURCE_STRATEGY';
|
|
1283
1317
|
const DataSourceStrategy = (provider)=>applyDecorators(SetMetadata(DATASOURCE_STRATEGY, provider), SetMetadata(STRATEGY_META_KEY, DATASOURCE_STRATEGY));
|
|
1284
1318
|
|
|
@@ -2654,6 +2688,18 @@ Reflect.defineMetadata(COMMAND_METADATA$1, {
|
|
|
2654
2688
|
id: CreateModelClientCommand.type
|
|
2655
2689
|
}, CreateModelClientCommand);
|
|
2656
2690
|
|
|
2691
|
+
const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
|
|
2692
|
+
description: 'List, search, and write chunks in platform knowledgebases.'
|
|
2693
|
+
});
|
|
2694
|
+
|
|
2695
|
+
const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
|
|
2696
|
+
description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
|
|
2697
|
+
});
|
|
2698
|
+
|
|
2699
|
+
const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
|
|
2700
|
+
description: 'Upload, read, and delete raw files in Xpert workspace volumes.'
|
|
2701
|
+
});
|
|
2702
|
+
|
|
2657
2703
|
const SKILL_SOURCE_PROVIDER = 'SKILL_SOURCE_PROVIDER';
|
|
2658
2704
|
const SkillSourceProviderStrategy = (provider)=>applyDecorators(SetMetadata(SKILL_SOURCE_PROVIDER, provider), SetMetadata(STRATEGY_META_KEY, SKILL_SOURCE_PROVIDER));
|
|
2659
2705
|
|
|
@@ -2694,48 +2740,6 @@ AgentMiddlewareRegistry = __decorate([
|
|
|
2694
2740
|
"end"
|
|
2695
2741
|
];
|
|
2696
2742
|
|
|
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
2743
|
const AssistantTaskRuntimeCapability = createRuntimeCapability('platform.assistant_task', {
|
|
2740
2744
|
description: 'Start asynchronous tasks on the current platform assistant.'
|
|
2741
2745
|
});
|
|
@@ -4495,4 +4499,4 @@ function escapeHtmlAttribute(value) {
|
|
|
4495
4499
|
|
|
4496
4500
|
const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
|
|
4497
4501
|
|
|
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 };
|
|
4502
|
+
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
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("
|
|
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("
|
|
29
|
+
export declare const FileRuntimeCapability: import("../../../core/runtime-capability").RuntimeCapabilityKey<AgentMiddlewareFileApi>;
|
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
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 {
|
|
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?:
|
|
102
|
+
capabilities?: RuntimeCapabilityRegistry;
|
|
103
103
|
}
|
package/src/lib/core/index.d.ts
CHANGED
|
@@ -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,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
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
mode?:
|
|
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
|
|
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?:
|
|
19
|
-
retrieval?:
|
|
18
|
+
filter?: KnowledgebaseMetadata;
|
|
19
|
+
retrieval?: KnowledgebaseRetrievalSettings;
|
|
20
20
|
source: string;
|
|
21
21
|
requestId?: string;
|
|
22
22
|
};
|
|
23
|
-
export type
|
|
23
|
+
export type KnowledgebaseDocument = {
|
|
24
24
|
id?: string;
|
|
25
25
|
pageContent: string;
|
|
26
26
|
metadata?: Record<string, unknown>;
|
|
27
27
|
};
|
|
28
|
-
export type
|
|
28
|
+
export type KnowledgebaseListInput = {
|
|
29
29
|
workspaceId?: string | null;
|
|
30
30
|
published?: boolean;
|
|
31
31
|
limit?: number;
|
|
32
32
|
};
|
|
33
|
-
export type
|
|
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
|
|
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?:
|
|
56
|
+
metadata?: KnowledgebaseMetadata;
|
|
57
57
|
writeKey: string;
|
|
58
58
|
executionId?: string;
|
|
59
59
|
threadId?: string;
|
|
60
60
|
};
|
|
61
|
-
export type
|
|
61
|
+
export type KnowledgebaseWriteChunkResult = {
|
|
62
62
|
status?: 'created' | 'skipped';
|
|
63
63
|
chunkId?: string;
|
|
64
64
|
message?: string;
|
|
65
65
|
};
|
|
66
|
-
export type
|
|
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
|
|
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
|
|
82
|
-
list(input:
|
|
83
|
-
search(input:
|
|
84
|
-
writeChunk(input:
|
|
85
|
-
deleteChunks(input:
|
|
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("
|
|
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 @@
|
|
|
1
|
+
export * from '../core/runtime-capability';
|
|
@@ -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>;
|