@xpert-ai/plugin-sdk 3.10.1 → 3.11.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 +17 -0
- package/index.cjs.js +6 -1
- package/index.esm.js +6 -2
- package/package.json +2 -2
- package/src/lib/agent/middleware/capabilities/index.d.ts +1 -0
- package/src/lib/agent/middleware/capabilities/knowledgebase-documents.d.ts +121 -0
- package/src/lib/agent/middleware/capabilities/knowledgebase.d.ts +1 -0
- package/src/lib/types.d.ts +2 -1
- package/src/lib/workflow/node/strategy.interface.d.ts +15 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @xpert-ai/plugin-sdk
|
|
2
2
|
|
|
3
|
+
## 3.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7418eef: version
|
|
8
|
+
|
|
9
|
+
## 4.0.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- d92d0f2: upgrade zard ui
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [d92d0f2]
|
|
18
|
+
- @xpert-ai/contracts@3.11.0
|
|
19
|
+
|
|
3
20
|
## 3.11.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/index.cjs.js
CHANGED
|
@@ -524,7 +524,7 @@ class BaseStrategyRegistry {
|
|
|
524
524
|
var _this_strategies_get_get;
|
|
525
525
|
const strategy = (_this_strategies_get_get = (_this_strategies_get = this.strategies.get(orgKey)) == null ? void 0 : _this_strategies_get.get(type)) != null ? _this_strategies_get_get : orgKey === GLOBAL_ORGANIZATION_SCOPE ? undefined : (_this_strategies_get1 = this.strategies.get(GLOBAL_ORGANIZATION_SCOPE)) == null ? void 0 : _this_strategies_get1.get(type);
|
|
526
526
|
if (!strategy) {
|
|
527
|
-
throw new Error(`No strategy found for type ${type}`);
|
|
527
|
+
throw new Error(`No strategy found for type '${type}' for strategy '${this.strategyKey}'`);
|
|
528
528
|
}
|
|
529
529
|
return strategy;
|
|
530
530
|
}
|
|
@@ -2678,6 +2678,10 @@ const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowled
|
|
|
2678
2678
|
description: 'List, search, and write chunks in platform knowledgebases.'
|
|
2679
2679
|
});
|
|
2680
2680
|
|
|
2681
|
+
const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
|
|
2682
|
+
description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
|
|
2683
|
+
});
|
|
2684
|
+
|
|
2681
2685
|
const AssistantTaskRuntimeCapability = createRuntimeCapability('platform.assistant_task', {
|
|
2682
2686
|
description: 'Start asynchronous tasks on the current platform assistant.'
|
|
2683
2687
|
});
|
|
@@ -4502,6 +4506,7 @@ exports.JUMP_TO_TARGETS = JUMP_TO_TARGETS;
|
|
|
4502
4506
|
exports.JsonSchemaValidator = JsonSchemaValidator;
|
|
4503
4507
|
exports.KNOWLEDGE_STRATEGY = KNOWLEDGE_STRATEGY;
|
|
4504
4508
|
exports.KnowledgeStrategyKey = KnowledgeStrategyKey;
|
|
4509
|
+
exports.KnowledgebaseDocumentsRuntimeCapability = KnowledgebaseDocumentsRuntimeCapability;
|
|
4505
4510
|
exports.KnowledgebaseRuntimeCapability = KnowledgebaseRuntimeCapability;
|
|
4506
4511
|
exports.LLMUsage = LLMUsage;
|
|
4507
4512
|
exports.LargeLanguageModel = LargeLanguageModel;
|
package/index.esm.js
CHANGED
|
@@ -503,7 +503,7 @@ class BaseStrategyRegistry {
|
|
|
503
503
|
var _this_strategies_get_get;
|
|
504
504
|
const strategy = (_this_strategies_get_get = (_this_strategies_get = this.strategies.get(orgKey)) == null ? void 0 : _this_strategies_get.get(type)) != null ? _this_strategies_get_get : orgKey === GLOBAL_ORGANIZATION_SCOPE ? undefined : (_this_strategies_get1 = this.strategies.get(GLOBAL_ORGANIZATION_SCOPE)) == null ? void 0 : _this_strategies_get1.get(type);
|
|
505
505
|
if (!strategy) {
|
|
506
|
-
throw new Error(`No strategy found for type ${type}`);
|
|
506
|
+
throw new Error(`No strategy found for type '${type}' for strategy '${this.strategyKey}'`);
|
|
507
507
|
}
|
|
508
508
|
return strategy;
|
|
509
509
|
}
|
|
@@ -2657,6 +2657,10 @@ const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowled
|
|
|
2657
2657
|
description: 'List, search, and write chunks in platform knowledgebases.'
|
|
2658
2658
|
});
|
|
2659
2659
|
|
|
2660
|
+
const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
|
|
2661
|
+
description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
|
|
2662
|
+
});
|
|
2663
|
+
|
|
2660
2664
|
const AssistantTaskRuntimeCapability = createRuntimeCapability('platform.assistant_task', {
|
|
2661
2665
|
description: 'Start asynchronous tasks on the current platform assistant.'
|
|
2662
2666
|
});
|
|
@@ -4416,4 +4420,4 @@ function escapeHtmlAttribute(value) {
|
|
|
4416
4420
|
|
|
4417
4421
|
const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
|
|
4418
4422
|
|
|
4419
|
-
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, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_METADATA, PLUGIN_METADATA_KEY, 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, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SKILL_SOURCE_PROVIDER, 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 };
|
|
4423
|
+
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, 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, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SKILL_SOURCE_PROVIDER, 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/plugin-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.2",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"directory": "dist"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
+
"@xpert-ai/contracts": "workspace:*",
|
|
19
20
|
"js-tiktoken": "^1.0.21"
|
|
20
21
|
},
|
|
21
22
|
"peerDependencies": {
|
|
22
23
|
"@langchain/core": "*",
|
|
23
|
-
"@xpert-ai/contracts": "workspace:*",
|
|
24
24
|
"@xpert-ai/ocap-core": "workspace:*",
|
|
25
25
|
"@nestjs/common": "*",
|
|
26
26
|
"@nestjs/core": "*",
|
|
@@ -0,0 +1,121 @@
|
|
|
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>;
|
package/src/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconDefinition, JsonSchemaObjectType, PluginMeta, PluginTargetApp, PluginTargetAppMeta, TAvatar, XpertTypeEnum } from '@xpert-ai/contracts';
|
|
1
|
+
import { IconDefinition, JsonSchemaObjectType, PluginMeta, PluginTargetApp, PluginTargetAppMeta, TAvatar, XpertTemplatePluginDependencies, XpertTypeEnum } from '@xpert-ai/contracts';
|
|
2
2
|
import type { DynamicModule, INestApplicationContext } from '@nestjs/common';
|
|
3
3
|
import { ModuleRef } from '@nestjs/core';
|
|
4
4
|
import type { ZodSchema } from 'zod';
|
|
@@ -68,6 +68,7 @@ export interface XpertTemplateContribution {
|
|
|
68
68
|
startPrompts?: string[];
|
|
69
69
|
releaseNotes?: string;
|
|
70
70
|
xpertName?: string;
|
|
71
|
+
dependencies?: XpertTemplatePluginDependencies;
|
|
71
72
|
[key: string]: unknown;
|
|
72
73
|
}
|
|
73
74
|
export interface XpertTemplateProvider {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Runnable } from '@langchain/core/runnables';
|
|
1
|
+
import { Runnable, RunnableToolLike } from '@langchain/core/runnables';
|
|
2
|
+
import { DynamicStructuredTool, StructuredToolInterface } from '@langchain/core/tools';
|
|
3
|
+
import { ToolInputSchemaBase } from '@langchain/core/dist/tools/types';
|
|
4
|
+
import { InteropZodType } from '@langchain/core/utils/types';
|
|
2
5
|
import { BaseChannel } from '@langchain/langgraph';
|
|
3
|
-
import { IEnvironment, IWorkflowNode, TWorkflowNodeMeta, TXpertGraph, TWorkflowVarGroup, TXpertParameter, TXpertTeamNode } from '@xpert-ai/contracts';
|
|
6
|
+
import { IEnvironment, IWorkflowNode, TWorkflowNodeMeta, TVariableAssigner, TXpertGraph, TWorkflowVarGroup, TXpertParameter, TXpertTeamNode } from '@xpert-ai/contracts';
|
|
4
7
|
import { PromiseOrValue } from '../../types';
|
|
5
8
|
export type TWorkflowNodeParams<TConfig = any> = {
|
|
6
9
|
xpertId: string;
|
|
@@ -17,6 +20,14 @@ export type TWorkflowNodeResult = {
|
|
|
17
20
|
annotation: BaseChannel;
|
|
18
21
|
};
|
|
19
22
|
navigator?: (state: any, config: any) => Promise<any>;
|
|
23
|
+
caller?: string;
|
|
24
|
+
toolset?: {
|
|
25
|
+
provider: string;
|
|
26
|
+
title: string;
|
|
27
|
+
id?: string;
|
|
28
|
+
};
|
|
29
|
+
tool?: DynamicStructuredTool<ToolInputSchemaBase, any, any> | StructuredToolInterface<ToolInputSchemaBase, any, any> | RunnableToolLike<InteropZodType, unknown>;
|
|
30
|
+
variables?: TVariableAssigner[];
|
|
20
31
|
};
|
|
21
32
|
/**
|
|
22
33
|
* Workflow Node Strategy interface
|
|
@@ -37,6 +48,8 @@ export interface IWorkflowNodeStrategy<TConfig = any, TResult = any> {
|
|
|
37
48
|
xpertId: string;
|
|
38
49
|
environment: IEnvironment;
|
|
39
50
|
isDraft: boolean;
|
|
51
|
+
leaderKey?: string;
|
|
52
|
+
conversationId?: string;
|
|
40
53
|
}): PromiseOrValue<TWorkflowNodeResult>;
|
|
41
54
|
inputVariables?(entity: IWorkflowNode, variables?: TWorkflowVarGroup[]): TXpertParameter[];
|
|
42
55
|
outputVariables(entity: IWorkflowNode): TXpertParameter[];
|