@xpert-ai/plugin-sdk 3.15.6 → 3.15.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @xpert-ai/plugin-sdk
2
2
 
3
+ ## 3.15.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 5e553ae: Add connector strategy contracts and runtime capability helpers for workspace connector plugins.
8
+
3
9
  ## 3.15.6
4
10
 
5
11
  ### 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 workspace 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
@@ -4668,10 +4688,13 @@ exports.BuiltinToolset = BuiltinToolset;
4668
4688
  exports.CHAT_CHANNEL = CHAT_CHANNEL;
4669
4689
  exports.CHAT_CHANNEL_TEXT_LIMITS = CHAT_CHANNEL_TEXT_LIMITS;
4670
4690
  exports.CONNECTION_COMMAND_ROUTER_TOKEN = CONNECTION_COMMAND_ROUTER_TOKEN;
4691
+ exports.CONNECTOR_STRATEGY = CONNECTOR_STRATEGY;
4671
4692
  exports.CancelConversationCommand = CancelConversationCommand;
4672
4693
  exports.ChatChannel = ChatChannel;
4673
4694
  exports.ChatOAICompatReasoningModel = ChatOAICompatReasoningModel;
4674
4695
  exports.CommonParameterRules = CommonParameterRules;
4696
+ exports.ConnectorRuntimeCapability = ConnectorRuntimeCapability;
4697
+ exports.ConnectorStrategyKey = ConnectorStrategyKey;
4675
4698
  exports.CreateModelClientCommand = CreateModelClientCommand;
4676
4699
  exports.CredentialsValidateFailedError = CredentialsValidateFailedError;
4677
4700
  exports.DATASOURCE_STRATEGY = DATASOURCE_STRATEGY;
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 workspace 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
@@ -4616,4 +4636,4 @@ function escapeHtmlAttribute(value) {
4616
4636
 
4617
4637
  const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
4618
4638
 
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 };
4639
+ 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, renderRemoteReactIframeHtml, 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.6",
3
+ "version": "3.15.7",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
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,4 @@
1
+ export * from './runtime-capability';
2
+ export * from './strategy.decorator';
3
+ export * from './strategy.interface';
4
+ export * from './strategy.registry';
@@ -0,0 +1,2 @@
1
+ import type { ConnectorRuntimeApi } from './strategy.interface';
2
+ export declare const ConnectorRuntimeCapability: import("../core").RuntimeCapabilityKey<ConnectorRuntimeApi>;
@@ -0,0 +1,2 @@
1
+ export declare const CONNECTOR_STRATEGY = "CONNECTOR_STRATEGY";
2
+ export declare const ConnectorStrategyKey: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,207 @@
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
+ integrationLabel?: RuntimeI18nText;
24
+ noIntegrationLabel?: RuntimeI18nText;
25
+ noIntegrationDescription?: RuntimeI18nText;
26
+ fields?: ConnectorAppCredentialField[];
27
+ help?: {
28
+ label: RuntimeI18nText;
29
+ url: string;
30
+ };
31
+ defaultValues?: Record<string, string | number | boolean | null>;
32
+ integrationName?: RuntimeI18nText;
33
+ };
34
+ export type ConnectorAppIntegration = {
35
+ id?: string;
36
+ provider: string;
37
+ name?: string;
38
+ description?: string | null;
39
+ options?: unknown;
40
+ };
41
+ export type ConnectorAppIntegrationSelectOption = {
42
+ value: string;
43
+ label: string;
44
+ description?: string | null;
45
+ };
46
+ export type ConnectorPermissionDeclaration = {
47
+ key: string;
48
+ label?: RuntimeI18nText;
49
+ description?: RuntimeI18nText;
50
+ identity?: 'user' | 'app' | 'tenant';
51
+ scopes?: string[];
52
+ credential?: 'access_token' | 'refresh_token' | 'app_credential' | 'api_key';
53
+ storage?: 'platform_vault' | 'runtime_only' | 'external';
54
+ required?: boolean;
55
+ };
56
+ export type ConnectorDefinition = {
57
+ provider: string;
58
+ label: RuntimeI18nText;
59
+ description?: RuntimeI18nText;
60
+ icon?: RuntimeCapabilityIcon;
61
+ auth: ConnectorOAuthConfig;
62
+ permissions?: ConnectorPermissionDeclaration[];
63
+ appIntegrationProvider?: string;
64
+ appIntegrationOptional?: boolean;
65
+ appCredentials?: ConnectorAppCredentialsConfig;
66
+ };
67
+ export type ConnectorProfile = {
68
+ openId?: string;
69
+ unionId?: string;
70
+ userId?: string;
71
+ name?: string;
72
+ avatarUrl?: string;
73
+ email?: string;
74
+ [key: string]: unknown;
75
+ };
76
+ export type ConnectorInstance = {
77
+ id: string;
78
+ workspaceId: string;
79
+ provider: string;
80
+ status: ConnectorStatus;
81
+ appIntegrationId?: string | null;
82
+ profile?: ConnectorProfile | null;
83
+ scopes?: string[];
84
+ expiresAt?: string | null;
85
+ refreshExpiresAt?: string | null;
86
+ connectedAt?: string | null;
87
+ disconnectedAt?: string | null;
88
+ lastError?: string | null;
89
+ createdById?: string | null;
90
+ updatedById?: string | null;
91
+ createdAt?: string;
92
+ updatedAt?: string;
93
+ };
94
+ export type ConnectorOAuthStartRequest = {
95
+ appIntegrationId?: string;
96
+ app?: ConnectorAppCredentialPayload;
97
+ };
98
+ export type ConnectorOAuthStartResponse = {
99
+ connector: ConnectorInstance;
100
+ authorizationUrl: string;
101
+ stateExpiresAt: string;
102
+ pollIntervalSeconds?: number | null;
103
+ };
104
+ export type ConnectorOAuthStatusResponse = {
105
+ connector: ConnectorInstance;
106
+ authorizationUrl?: string | null;
107
+ stateExpiresAt?: string | null;
108
+ pollIntervalSeconds?: number | null;
109
+ message?: string | null;
110
+ };
111
+ export type ConnectorRuntimeCredential = {
112
+ connectorId: string;
113
+ workspaceId: string;
114
+ provider: string;
115
+ appId: string;
116
+ brand?: string;
117
+ accessToken: string;
118
+ expiresAt?: string | null;
119
+ scopes?: string[];
120
+ profile?: ConnectorProfile | null;
121
+ };
122
+ export type ConnectorRuntimeGetInput = {
123
+ workspaceId: string;
124
+ provider: string;
125
+ connectorId?: string;
126
+ };
127
+ export interface ConnectorRuntimeApi {
128
+ getConnector(input: ConnectorRuntimeGetInput): Promise<ConnectorRuntimeCredential>;
129
+ }
130
+ export type ConnectorSelectOption = {
131
+ value: string;
132
+ label: RuntimeI18nText;
133
+ provider: string;
134
+ status: ConnectorStatus;
135
+ description?: RuntimeI18nText;
136
+ avatarUrl?: string;
137
+ };
138
+ export type ConnectorAppCredentialPayload = Record<string, unknown>;
139
+ export type ConnectorAuthorizationUrlInput = {
140
+ app?: ConnectorAppCredentialPayload;
141
+ redirectUri: string;
142
+ state: string;
143
+ scopes?: string[];
144
+ };
145
+ export type ConnectorAuthorizationUrlResult = {
146
+ authorizationUrl: string;
147
+ scopes?: string[];
148
+ metadata?: Record<string, unknown>;
149
+ pollIntervalSeconds?: number | null;
150
+ };
151
+ export type ConnectorOAuthCodeInput = {
152
+ app?: ConnectorAppCredentialPayload;
153
+ code: string;
154
+ redirectUri: string;
155
+ scopes?: string[];
156
+ };
157
+ export type ConnectorRefreshInput = {
158
+ app?: ConnectorAppCredentialPayload;
159
+ refreshToken: string;
160
+ };
161
+ export type ConnectorOAuthCredential = {
162
+ appId: string;
163
+ brand?: string;
164
+ /**
165
+ * Provider app credentials retained only for encrypted platform storage and token refresh.
166
+ * Hosts must not expose this field through public connector or runtime credential APIs.
167
+ */
168
+ app?: ConnectorAppCredentialPayload;
169
+ accessToken: string;
170
+ refreshToken?: string;
171
+ expiresAt?: string | null;
172
+ refreshExpiresAt?: string | null;
173
+ scopes?: string[];
174
+ profile?: ConnectorProfile | null;
175
+ };
176
+ export type ConnectorOAuthCompleteRequest = {
177
+ state: string;
178
+ code: string;
179
+ };
180
+ export type ConnectorAuthorizationPollInput = {
181
+ metadata?: Record<string, unknown> | null;
182
+ redirectUri: string;
183
+ scopes?: string[];
184
+ };
185
+ export type ConnectorAuthorizationPollResult = {
186
+ status: 'pending';
187
+ authorizationUrl?: string;
188
+ metadata?: Record<string, unknown>;
189
+ pollIntervalSeconds?: number | null;
190
+ message?: string;
191
+ } | {
192
+ status: 'complete';
193
+ credential: ConnectorOAuthCredential;
194
+ metadata?: Record<string, unknown>;
195
+ } | {
196
+ status: 'error';
197
+ error: string;
198
+ metadata?: Record<string, unknown>;
199
+ };
200
+ export interface ConnectorStrategy {
201
+ definition: ConnectorDefinition;
202
+ isSelectableAppIntegration?(integration: ConnectorAppIntegration): boolean | Promise<boolean>;
203
+ buildAuthorizationUrl(input: ConnectorAuthorizationUrlInput): Promise<ConnectorAuthorizationUrlResult>;
204
+ exchangeOAuthCode(input: ConnectorOAuthCodeInput): Promise<ConnectorOAuthCredential>;
205
+ refreshCredential?(input: ConnectorRefreshInput): Promise<ConnectorOAuthCredential>;
206
+ pollAuthorization?(input: ConnectorAuthorizationPollInput): Promise<ConnectorAuthorizationPollResult>;
207
+ }
@@ -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
+ }
@@ -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<ToolInputSchemaBase, any, any> | StructuredToolInterface<ToolInputSchemaBase, any, any> | RunnableToolLike<InteropZodType, unknown>;
28
+ tool?: DynamicStructuredTool<ToolSchemaBase, any, any> | StructuredToolInterface<ToolSchemaBase, any, any> | RunnableToolLike<InteropZodType, unknown>;
30
29
  variables?: TVariableAssigner[];
31
30
  };
32
31
  /**