@xpert-ai/plugin-sdk 3.15.6 → 3.15.8
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 +15 -0
- package/index.cjs.js +58 -3
- package/index.esm.js +54 -4
- package/package.json +2 -2
- package/src/index.d.ts +1 -0
- package/src/lib/connector/index.d.ts +4 -0
- package/src/lib/connector/runtime-capability.d.ts +2 -0
- package/src/lib/connector/strategy.decorator.d.ts +2 -0
- package/src/lib/connector/strategy.interface.d.ts +186 -0
- package/src/lib/connector/strategy.registry.d.ts +6 -0
- package/src/lib/view-extension/remote-component-html.d.ts +10 -0
- package/src/lib/workflow/node/strategy.interface.d.ts +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @xpert-ai/plugin-sdk
|
|
2
2
|
|
|
3
|
+
## 3.15.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 121ced0: Final stable version
|
|
8
|
+
- Updated dependencies [7ab7aa1]
|
|
9
|
+
- Updated dependencies [121ced0]
|
|
10
|
+
- @xpert-ai/contracts@3.15.8
|
|
11
|
+
|
|
12
|
+
## 3.15.7
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 5e553ae: Add connector strategy contracts and runtime capability helpers for workspace connector plugins.
|
|
17
|
+
|
|
3
18
|
## 3.15.6
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/index.cjs.js
CHANGED
|
@@ -3120,6 +3120,26 @@ exports.SSOProviderRegistry = __decorate([
|
|
|
3120
3120
|
])
|
|
3121
3121
|
], exports.SSOProviderRegistry);
|
|
3122
3122
|
|
|
3123
|
+
const ConnectorRuntimeCapability = createRuntimeCapability('platform.connector', {
|
|
3124
|
+
description: 'Resolve connector credentials for agent middleware.'
|
|
3125
|
+
});
|
|
3126
|
+
|
|
3127
|
+
const CONNECTOR_STRATEGY = 'CONNECTOR_STRATEGY';
|
|
3128
|
+
const ConnectorStrategyKey = (provider)=>common.applyDecorators(common.SetMetadata(CONNECTOR_STRATEGY, provider), common.SetMetadata(STRATEGY_META_KEY, CONNECTOR_STRATEGY));
|
|
3129
|
+
|
|
3130
|
+
exports.ConnectorStrategyRegistry = class ConnectorStrategyRegistry extends BaseStrategyRegistry {
|
|
3131
|
+
constructor(discoveryService, reflector){
|
|
3132
|
+
super(CONNECTOR_STRATEGY, discoveryService, reflector);
|
|
3133
|
+
}
|
|
3134
|
+
};
|
|
3135
|
+
exports.ConnectorStrategyRegistry = __decorate([
|
|
3136
|
+
common.Injectable(),
|
|
3137
|
+
__metadata("design:paramtypes", [
|
|
3138
|
+
core.DiscoveryService,
|
|
3139
|
+
core.Reflector
|
|
3140
|
+
])
|
|
3141
|
+
], exports.ConnectorStrategyRegistry);
|
|
3142
|
+
|
|
3123
3143
|
const SANDBOX_SHELL_TIMEOUT_LIMITS_SEC = {
|
|
3124
3144
|
min: 1,
|
|
3125
3145
|
max: 3600
|
|
@@ -4610,10 +4630,10 @@ ${XPERT_REMOTE_UI_CSS}
|
|
|
4610
4630
|
${(_options_appCss = options.appCss) != null ? _options_appCss : ''}
|
|
4611
4631
|
</style>
|
|
4612
4632
|
<script>
|
|
4613
|
-
${options.reactUmd}
|
|
4633
|
+
${escapeInlineScript(options.reactUmd)}
|
|
4614
4634
|
</script>
|
|
4615
4635
|
<script>
|
|
4616
|
-
${options.reactDomUmd}
|
|
4636
|
+
${escapeInlineScript(options.reactDomUmd)}
|
|
4617
4637
|
</script>
|
|
4618
4638
|
<script>
|
|
4619
4639
|
${XPERT_REMOTE_UI_BOOTSTRAP}
|
|
@@ -4622,17 +4642,47 @@ ${XPERT_REMOTE_UI_BOOTSTRAP}
|
|
|
4622
4642
|
<body>
|
|
4623
4643
|
<div id="root"></div>
|
|
4624
4644
|
<script>
|
|
4625
|
-
${options.appScript}
|
|
4645
|
+
${escapeInlineScript(options.appScript)}
|
|
4626
4646
|
</script>
|
|
4627
4647
|
</body>
|
|
4628
4648
|
</html>`;
|
|
4629
4649
|
}
|
|
4650
|
+
function renderRemoteModuleIframeHtml(options) {
|
|
4651
|
+
var _options_lang, _options_appCss;
|
|
4652
|
+
return `<!doctype html>
|
|
4653
|
+
<html lang="${escapeHtmlAttribute((_options_lang = options.lang) != null ? _options_lang : 'en')}">
|
|
4654
|
+
<head>
|
|
4655
|
+
<meta charset="utf-8" />
|
|
4656
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
4657
|
+
<title>${escapeHtml(options.title)}</title>
|
|
4658
|
+
<style>
|
|
4659
|
+
${XPERT_REMOTE_UI_CSS}
|
|
4660
|
+
${(_options_appCss = options.appCss) != null ? _options_appCss : ''}
|
|
4661
|
+
</style>
|
|
4662
|
+
<script>
|
|
4663
|
+
${XPERT_REMOTE_UI_BOOTSTRAP}
|
|
4664
|
+
</script>
|
|
4665
|
+
</head>
|
|
4666
|
+
<body>
|
|
4667
|
+
<div id="root"></div>
|
|
4668
|
+
<script type="module">
|
|
4669
|
+
${escapeInlineScript(options.appScript)}
|
|
4670
|
+
</script>
|
|
4671
|
+
</body>
|
|
4672
|
+
</html>`;
|
|
4673
|
+
}
|
|
4674
|
+
function renderRemoteVueIframeHtml(options) {
|
|
4675
|
+
return renderRemoteModuleIframeHtml(options);
|
|
4676
|
+
}
|
|
4630
4677
|
function escapeHtml(value) {
|
|
4631
4678
|
return value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
4632
4679
|
}
|
|
4633
4680
|
function escapeHtmlAttribute(value) {
|
|
4634
4681
|
return escapeHtml(value).replace(/`/g, '`');
|
|
4635
4682
|
}
|
|
4683
|
+
function escapeInlineScript(value) {
|
|
4684
|
+
return value.replace(/<\/script/gi, '<\\/script');
|
|
4685
|
+
}
|
|
4636
4686
|
|
|
4637
4687
|
const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
|
|
4638
4688
|
|
|
@@ -4668,10 +4718,13 @@ exports.BuiltinToolset = BuiltinToolset;
|
|
|
4668
4718
|
exports.CHAT_CHANNEL = CHAT_CHANNEL;
|
|
4669
4719
|
exports.CHAT_CHANNEL_TEXT_LIMITS = CHAT_CHANNEL_TEXT_LIMITS;
|
|
4670
4720
|
exports.CONNECTION_COMMAND_ROUTER_TOKEN = CONNECTION_COMMAND_ROUTER_TOKEN;
|
|
4721
|
+
exports.CONNECTOR_STRATEGY = CONNECTOR_STRATEGY;
|
|
4671
4722
|
exports.CancelConversationCommand = CancelConversationCommand;
|
|
4672
4723
|
exports.ChatChannel = ChatChannel;
|
|
4673
4724
|
exports.ChatOAICompatReasoningModel = ChatOAICompatReasoningModel;
|
|
4674
4725
|
exports.CommonParameterRules = CommonParameterRules;
|
|
4726
|
+
exports.ConnectorRuntimeCapability = ConnectorRuntimeCapability;
|
|
4727
|
+
exports.ConnectorStrategyKey = ConnectorStrategyKey;
|
|
4675
4728
|
exports.CreateModelClientCommand = CreateModelClientCommand;
|
|
4676
4729
|
exports.CredentialsValidateFailedError = CredentialsValidateFailedError;
|
|
4677
4730
|
exports.DATASOURCE_STRATEGY = DATASOURCE_STRATEGY;
|
|
@@ -4814,7 +4867,9 @@ exports.mergeCredentials = mergeCredentials;
|
|
|
4814
4867
|
exports.mergeParentChildChunks = mergeParentChildChunks;
|
|
4815
4868
|
exports.normalizeContextSize = normalizeContextSize;
|
|
4816
4869
|
exports.pluginArtifactTableName = pluginArtifactTableName;
|
|
4870
|
+
exports.renderRemoteModuleIframeHtml = renderRemoteModuleIframeHtml;
|
|
4817
4871
|
exports.renderRemoteReactIframeHtml = renderRemoteReactIframeHtml;
|
|
4872
|
+
exports.renderRemoteVueIframeHtml = renderRemoteVueIframeHtml;
|
|
4818
4873
|
exports.resolveSandboxBackend = resolveSandboxBackend;
|
|
4819
4874
|
exports.resolveSandboxExecutionOptions = resolveSandboxExecutionOptions;
|
|
4820
4875
|
exports.resolveSandboxManagedServiceAdapter = resolveSandboxManagedServiceAdapter;
|
package/index.esm.js
CHANGED
|
@@ -3100,6 +3100,26 @@ SSOProviderRegistry = __decorate([
|
|
|
3100
3100
|
])
|
|
3101
3101
|
], SSOProviderRegistry);
|
|
3102
3102
|
|
|
3103
|
+
const ConnectorRuntimeCapability = createRuntimeCapability('platform.connector', {
|
|
3104
|
+
description: 'Resolve connector credentials for agent middleware.'
|
|
3105
|
+
});
|
|
3106
|
+
|
|
3107
|
+
const CONNECTOR_STRATEGY = 'CONNECTOR_STRATEGY';
|
|
3108
|
+
const ConnectorStrategyKey = (provider)=>applyDecorators(SetMetadata(CONNECTOR_STRATEGY, provider), SetMetadata(STRATEGY_META_KEY, CONNECTOR_STRATEGY));
|
|
3109
|
+
|
|
3110
|
+
let ConnectorStrategyRegistry = class ConnectorStrategyRegistry extends BaseStrategyRegistry {
|
|
3111
|
+
constructor(discoveryService, reflector){
|
|
3112
|
+
super(CONNECTOR_STRATEGY, discoveryService, reflector);
|
|
3113
|
+
}
|
|
3114
|
+
};
|
|
3115
|
+
ConnectorStrategyRegistry = __decorate([
|
|
3116
|
+
Injectable(),
|
|
3117
|
+
__metadata("design:paramtypes", [
|
|
3118
|
+
DiscoveryService,
|
|
3119
|
+
Reflector
|
|
3120
|
+
])
|
|
3121
|
+
], ConnectorStrategyRegistry);
|
|
3122
|
+
|
|
3103
3123
|
const SANDBOX_SHELL_TIMEOUT_LIMITS_SEC = {
|
|
3104
3124
|
min: 1,
|
|
3105
3125
|
max: 3600
|
|
@@ -4590,10 +4610,10 @@ ${XPERT_REMOTE_UI_CSS}
|
|
|
4590
4610
|
${(_options_appCss = options.appCss) != null ? _options_appCss : ''}
|
|
4591
4611
|
</style>
|
|
4592
4612
|
<script>
|
|
4593
|
-
${options.reactUmd}
|
|
4613
|
+
${escapeInlineScript(options.reactUmd)}
|
|
4594
4614
|
</script>
|
|
4595
4615
|
<script>
|
|
4596
|
-
${options.reactDomUmd}
|
|
4616
|
+
${escapeInlineScript(options.reactDomUmd)}
|
|
4597
4617
|
</script>
|
|
4598
4618
|
<script>
|
|
4599
4619
|
${XPERT_REMOTE_UI_BOOTSTRAP}
|
|
@@ -4602,18 +4622,48 @@ ${XPERT_REMOTE_UI_BOOTSTRAP}
|
|
|
4602
4622
|
<body>
|
|
4603
4623
|
<div id="root"></div>
|
|
4604
4624
|
<script>
|
|
4605
|
-
${options.appScript}
|
|
4625
|
+
${escapeInlineScript(options.appScript)}
|
|
4606
4626
|
</script>
|
|
4607
4627
|
</body>
|
|
4608
4628
|
</html>`;
|
|
4609
4629
|
}
|
|
4630
|
+
function renderRemoteModuleIframeHtml(options) {
|
|
4631
|
+
var _options_lang, _options_appCss;
|
|
4632
|
+
return `<!doctype html>
|
|
4633
|
+
<html lang="${escapeHtmlAttribute((_options_lang = options.lang) != null ? _options_lang : 'en')}">
|
|
4634
|
+
<head>
|
|
4635
|
+
<meta charset="utf-8" />
|
|
4636
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
4637
|
+
<title>${escapeHtml(options.title)}</title>
|
|
4638
|
+
<style>
|
|
4639
|
+
${XPERT_REMOTE_UI_CSS}
|
|
4640
|
+
${(_options_appCss = options.appCss) != null ? _options_appCss : ''}
|
|
4641
|
+
</style>
|
|
4642
|
+
<script>
|
|
4643
|
+
${XPERT_REMOTE_UI_BOOTSTRAP}
|
|
4644
|
+
</script>
|
|
4645
|
+
</head>
|
|
4646
|
+
<body>
|
|
4647
|
+
<div id="root"></div>
|
|
4648
|
+
<script type="module">
|
|
4649
|
+
${escapeInlineScript(options.appScript)}
|
|
4650
|
+
</script>
|
|
4651
|
+
</body>
|
|
4652
|
+
</html>`;
|
|
4653
|
+
}
|
|
4654
|
+
function renderRemoteVueIframeHtml(options) {
|
|
4655
|
+
return renderRemoteModuleIframeHtml(options);
|
|
4656
|
+
}
|
|
4610
4657
|
function escapeHtml(value) {
|
|
4611
4658
|
return value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
4612
4659
|
}
|
|
4613
4660
|
function escapeHtmlAttribute(value) {
|
|
4614
4661
|
return escapeHtml(value).replace(/`/g, '`');
|
|
4615
4662
|
}
|
|
4663
|
+
function escapeInlineScript(value) {
|
|
4664
|
+
return value.replace(/<\/script/gi, '<\\/script');
|
|
4665
|
+
}
|
|
4616
4666
|
|
|
4617
4667
|
const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
|
|
4618
4668
|
|
|
4619
|
-
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, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CONNECTION_COMMAND_ROUTER_TOKEN, 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, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, 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, PluginJobProcessor, 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, SYSTEM_GLOBAL_SCOPE, SandboxProviderRegistry, SandboxProviderStrategy, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, TENANT_GLOBAL_SCOPE_PREFIX, TENANT_GLOBAL_SCOPE_SUFFIX, 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, WORKSPACE_FILES_SOURCE, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, derivePluginArtifactNamespace, downloadRemoteFile, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, isTenantGlobalScopeKey, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, pluginArtifactTableName, renderRemoteReactIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveTenantGlobalScopeKey, runWithRequestContext, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage };
|
|
4669
|
+
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, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CONNECTION_COMMAND_ROUTER_TOKEN, CONNECTOR_STRATEGY, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CommonParameterRules, ConnectorRuntimeCapability, ConnectorStrategyKey, ConnectorStrategyRegistry, 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, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, 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, PluginJobProcessor, 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, SYSTEM_GLOBAL_SCOPE, SandboxProviderRegistry, SandboxProviderStrategy, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, TENANT_GLOBAL_SCOPE_PREFIX, TENANT_GLOBAL_SCOPE_SUFFIX, 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, WORKSPACE_FILES_SOURCE, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, derivePluginArtifactNamespace, downloadRemoteFile, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, isTenantGlobalScopeKey, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, pluginArtifactTableName, renderRemoteModuleIframeHtml, renderRemoteReactIframeHtml, renderRemoteVueIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveTenantGlobalScopeKey, runWithRequestContext, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xpert-ai/plugin-sdk",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.8",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@langchain/openai": "0.6.9",
|
|
20
|
-
"@xpert-ai/contracts": "3.15.
|
|
20
|
+
"@xpert-ai/contracts": "3.15.8",
|
|
21
21
|
"express": "^4.22.1",
|
|
22
22
|
"js-tiktoken": "^1.0.21"
|
|
23
23
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './lib/channel/index';
|
|
|
18
18
|
export * from './lib/file/index';
|
|
19
19
|
export * from './lib/strategy';
|
|
20
20
|
export * from './lib/sso/index';
|
|
21
|
+
export * from './lib/connector/index';
|
|
21
22
|
export * from './lib/sandbox/index';
|
|
22
23
|
export * from './lib/managed-connection/index';
|
|
23
24
|
export * from './lib/managed-queue/index';
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { I18nText, IconDefinition } from '@xpert-ai/contracts';
|
|
2
|
+
export type RuntimeI18nText = I18nText;
|
|
3
|
+
export type RuntimeCapabilityIcon = IconDefinition;
|
|
4
|
+
export type ConnectorStatus = 'pending' | 'active' | 'expired' | 'error' | 'disconnected';
|
|
5
|
+
export type ConnectorOAuthConfig = {
|
|
6
|
+
type: 'oauth2';
|
|
7
|
+
authorizationUrl?: string;
|
|
8
|
+
tokenUrl?: string;
|
|
9
|
+
userInfoUrl?: string;
|
|
10
|
+
scopes?: string[];
|
|
11
|
+
redirectPath?: string;
|
|
12
|
+
};
|
|
13
|
+
export type ConnectorAppCredentialField = {
|
|
14
|
+
name: string;
|
|
15
|
+
label: RuntimeI18nText;
|
|
16
|
+
type?: 'text' | 'password';
|
|
17
|
+
required?: boolean;
|
|
18
|
+
placeholder?: RuntimeI18nText;
|
|
19
|
+
description?: RuntimeI18nText;
|
|
20
|
+
secret?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type ConnectorAppCredentialsConfig = {
|
|
23
|
+
fields?: ConnectorAppCredentialField[];
|
|
24
|
+
help?: {
|
|
25
|
+
label: RuntimeI18nText;
|
|
26
|
+
url: string;
|
|
27
|
+
};
|
|
28
|
+
defaultValues?: Record<string, string | number | boolean | null>;
|
|
29
|
+
};
|
|
30
|
+
export type ConnectorPermissionDeclaration = {
|
|
31
|
+
key: string;
|
|
32
|
+
label?: RuntimeI18nText;
|
|
33
|
+
description?: RuntimeI18nText;
|
|
34
|
+
identity?: 'user' | 'app' | 'tenant';
|
|
35
|
+
scopes?: string[];
|
|
36
|
+
credential?: 'access_token' | 'refresh_token' | 'app_credential' | 'api_key';
|
|
37
|
+
storage?: 'platform_vault' | 'runtime_only' | 'external';
|
|
38
|
+
required?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type ConnectorDefinition = {
|
|
41
|
+
provider: string;
|
|
42
|
+
label: RuntimeI18nText;
|
|
43
|
+
description?: RuntimeI18nText;
|
|
44
|
+
icon?: RuntimeCapabilityIcon;
|
|
45
|
+
auth: ConnectorOAuthConfig;
|
|
46
|
+
permissions?: ConnectorPermissionDeclaration[];
|
|
47
|
+
appCredentials?: ConnectorAppCredentialsConfig;
|
|
48
|
+
};
|
|
49
|
+
export type ConnectorProfile = {
|
|
50
|
+
openId?: string;
|
|
51
|
+
unionId?: string;
|
|
52
|
+
userId?: string;
|
|
53
|
+
name?: string;
|
|
54
|
+
avatarUrl?: string;
|
|
55
|
+
email?: string;
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
};
|
|
58
|
+
export type ConnectorInstance = {
|
|
59
|
+
id: string;
|
|
60
|
+
workspaceId: string;
|
|
61
|
+
provider: string;
|
|
62
|
+
status: ConnectorStatus;
|
|
63
|
+
profile?: ConnectorProfile | null;
|
|
64
|
+
scopes?: string[];
|
|
65
|
+
expiresAt?: string | null;
|
|
66
|
+
refreshExpiresAt?: string | null;
|
|
67
|
+
connectedAt?: string | null;
|
|
68
|
+
disconnectedAt?: string | null;
|
|
69
|
+
lastError?: string | null;
|
|
70
|
+
createdById?: string | null;
|
|
71
|
+
updatedById?: string | null;
|
|
72
|
+
createdAt?: string;
|
|
73
|
+
updatedAt?: string;
|
|
74
|
+
};
|
|
75
|
+
export type ConnectorOAuthStartRequest = {
|
|
76
|
+
app?: ConnectorAppCredentialPayload;
|
|
77
|
+
};
|
|
78
|
+
export type ConnectorOAuthStartResponse = {
|
|
79
|
+
connector: ConnectorInstance;
|
|
80
|
+
authorizationUrl: string;
|
|
81
|
+
stateExpiresAt: string;
|
|
82
|
+
pollIntervalSeconds?: number | null;
|
|
83
|
+
};
|
|
84
|
+
export type ConnectorOAuthStatusResponse = {
|
|
85
|
+
connector: ConnectorInstance;
|
|
86
|
+
authorizationUrl?: string | null;
|
|
87
|
+
stateExpiresAt?: string | null;
|
|
88
|
+
pollIntervalSeconds?: number | null;
|
|
89
|
+
message?: string | null;
|
|
90
|
+
};
|
|
91
|
+
export type ConnectorRuntimeCredential = {
|
|
92
|
+
connectorId: string;
|
|
93
|
+
workspaceId: string;
|
|
94
|
+
provider: string;
|
|
95
|
+
appId: string;
|
|
96
|
+
brand?: string;
|
|
97
|
+
accessToken: string;
|
|
98
|
+
expiresAt?: string | null;
|
|
99
|
+
scopes?: string[];
|
|
100
|
+
profile?: ConnectorProfile | null;
|
|
101
|
+
};
|
|
102
|
+
export type ConnectorRuntimeGetInput = {
|
|
103
|
+
workspaceId: string;
|
|
104
|
+
provider: string;
|
|
105
|
+
connectorId?: string;
|
|
106
|
+
};
|
|
107
|
+
export interface ConnectorRuntimeApi {
|
|
108
|
+
getConnector(input: ConnectorRuntimeGetInput): Promise<ConnectorRuntimeCredential>;
|
|
109
|
+
}
|
|
110
|
+
export type ConnectorSelectOption = {
|
|
111
|
+
value: string;
|
|
112
|
+
label: RuntimeI18nText;
|
|
113
|
+
provider: string;
|
|
114
|
+
status: ConnectorStatus;
|
|
115
|
+
description?: RuntimeI18nText;
|
|
116
|
+
avatarUrl?: string;
|
|
117
|
+
};
|
|
118
|
+
export type ConnectorAppCredentialPayload = Record<string, unknown>;
|
|
119
|
+
export type ConnectorAuthorizationUrlInput = {
|
|
120
|
+
app?: ConnectorAppCredentialPayload;
|
|
121
|
+
redirectUri: string;
|
|
122
|
+
state: string;
|
|
123
|
+
scopes?: string[];
|
|
124
|
+
};
|
|
125
|
+
export type ConnectorAuthorizationUrlResult = {
|
|
126
|
+
authorizationUrl: string;
|
|
127
|
+
scopes?: string[];
|
|
128
|
+
metadata?: Record<string, unknown>;
|
|
129
|
+
pollIntervalSeconds?: number | null;
|
|
130
|
+
};
|
|
131
|
+
export type ConnectorOAuthCodeInput = {
|
|
132
|
+
app?: ConnectorAppCredentialPayload;
|
|
133
|
+
code: string;
|
|
134
|
+
redirectUri: string;
|
|
135
|
+
scopes?: string[];
|
|
136
|
+
};
|
|
137
|
+
export type ConnectorRefreshInput = {
|
|
138
|
+
app?: ConnectorAppCredentialPayload;
|
|
139
|
+
refreshToken: string;
|
|
140
|
+
};
|
|
141
|
+
export type ConnectorOAuthCredential = {
|
|
142
|
+
appId: string;
|
|
143
|
+
brand?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Provider app credentials retained only for encrypted platform storage and token refresh.
|
|
146
|
+
* Hosts must not expose this field through public connector or runtime credential APIs.
|
|
147
|
+
*/
|
|
148
|
+
app?: ConnectorAppCredentialPayload;
|
|
149
|
+
accessToken: string;
|
|
150
|
+
refreshToken?: string;
|
|
151
|
+
expiresAt?: string | null;
|
|
152
|
+
refreshExpiresAt?: string | null;
|
|
153
|
+
scopes?: string[];
|
|
154
|
+
profile?: ConnectorProfile | null;
|
|
155
|
+
};
|
|
156
|
+
export type ConnectorOAuthCompleteRequest = {
|
|
157
|
+
state: string;
|
|
158
|
+
code: string;
|
|
159
|
+
};
|
|
160
|
+
export type ConnectorAuthorizationPollInput = {
|
|
161
|
+
metadata?: Record<string, unknown> | null;
|
|
162
|
+
redirectUri: string;
|
|
163
|
+
scopes?: string[];
|
|
164
|
+
};
|
|
165
|
+
export type ConnectorAuthorizationPollResult = {
|
|
166
|
+
status: 'pending';
|
|
167
|
+
authorizationUrl?: string;
|
|
168
|
+
metadata?: Record<string, unknown>;
|
|
169
|
+
pollIntervalSeconds?: number | null;
|
|
170
|
+
message?: string;
|
|
171
|
+
} | {
|
|
172
|
+
status: 'complete';
|
|
173
|
+
credential: ConnectorOAuthCredential;
|
|
174
|
+
metadata?: Record<string, unknown>;
|
|
175
|
+
} | {
|
|
176
|
+
status: 'error';
|
|
177
|
+
error: string;
|
|
178
|
+
metadata?: Record<string, unknown>;
|
|
179
|
+
};
|
|
180
|
+
export interface ConnectorStrategy {
|
|
181
|
+
definition: ConnectorDefinition;
|
|
182
|
+
buildAuthorizationUrl(input: ConnectorAuthorizationUrlInput): Promise<ConnectorAuthorizationUrlResult>;
|
|
183
|
+
exchangeOAuthCode(input: ConnectorOAuthCodeInput): Promise<ConnectorOAuthCredential>;
|
|
184
|
+
refreshCredential?(input: ConnectorRefreshInput): Promise<ConnectorOAuthCredential>;
|
|
185
|
+
pollAuthorization?(input: ConnectorAuthorizationPollInput): Promise<ConnectorAuthorizationPollResult>;
|
|
186
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
2
|
+
import { BaseStrategyRegistry } from '../strategy';
|
|
3
|
+
import type { ConnectorStrategy } from './strategy.interface';
|
|
4
|
+
export declare class ConnectorStrategyRegistry extends BaseStrategyRegistry<ConnectorStrategy> {
|
|
5
|
+
constructor(discoveryService: DiscoveryService, reflector: Reflector);
|
|
6
|
+
}
|
|
@@ -6,4 +6,14 @@ export interface RenderRemoteReactIframeHtmlOptions {
|
|
|
6
6
|
appCss?: string;
|
|
7
7
|
lang?: string;
|
|
8
8
|
}
|
|
9
|
+
export interface RenderRemoteModuleIframeHtmlOptions {
|
|
10
|
+
title: string;
|
|
11
|
+
appScript: string;
|
|
12
|
+
appCss?: string;
|
|
13
|
+
lang?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RenderRemoteVueIframeHtmlOptions extends RenderRemoteModuleIframeHtmlOptions {
|
|
16
|
+
}
|
|
9
17
|
export declare function renderRemoteReactIframeHtml(options: RenderRemoteReactIframeHtmlOptions): string;
|
|
18
|
+
export declare function renderRemoteModuleIframeHtml(options: RenderRemoteModuleIframeHtmlOptions): string;
|
|
19
|
+
export declare function renderRemoteVueIframeHtml(options: RenderRemoteVueIframeHtmlOptions): string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
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';
|
|
2
|
+
import { DynamicStructuredTool, StructuredToolInterface, type ToolSchemaBase } from '@langchain/core/tools';
|
|
4
3
|
import { InteropZodType } from '@langchain/core/utils/types';
|
|
5
4
|
import { BaseChannel } from '@langchain/langgraph';
|
|
6
5
|
import { IEnvironment, IWorkflowNode, TWorkflowNodeMeta, TVariableAssigner, TXpertGraph, TWorkflowVarGroup, TXpertParameter, TXpertTeamNode } from '@xpert-ai/contracts';
|
|
@@ -26,7 +25,7 @@ export type TWorkflowNodeResult = {
|
|
|
26
25
|
title: string;
|
|
27
26
|
id?: string;
|
|
28
27
|
};
|
|
29
|
-
tool?: DynamicStructuredTool<
|
|
28
|
+
tool?: DynamicStructuredTool<ToolSchemaBase, any, any> | StructuredToolInterface<ToolSchemaBase, any, any> | RunnableToolLike<InteropZodType, unknown>;
|
|
30
29
|
variables?: TVariableAssigner[];
|
|
31
30
|
};
|
|
32
31
|
/**
|