@xpert-ai/plugin-sdk 3.9.0-beta.2 → 3.9.0

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,20 @@
1
1
  # @xpert-ai/plugin-sdk
2
2
 
3
+ ## 3.9.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 4dcf5b5: add sso in plugin sdk
8
+ - 7fff870: beta 2
9
+ - c76facd: beta v
10
+ - 5b5c8ef: Updates
11
+ - Updated dependencies [4dcf5b5]
12
+ - Updated dependencies [7fff870]
13
+ - Updated dependencies [c76facd]
14
+ - Updated dependencies [5b5c8ef]
15
+ - @xpert-ai/contracts@3.9.0
16
+ - @xpert-ai/ocap-core@3.9.0
17
+
3
18
  ## 3.9.0-beta.2
4
19
 
5
20
  ### Patch Changes
package/index.cjs.js CHANGED
@@ -1090,6 +1090,18 @@ function getRequiredPermissionOperation(method, permissionType) {
1090
1090
  * Internal system token used by core to expose the handoff queue bridge.
1091
1091
  */ const HANDOFF_QUEUE_SERVICE_TOKEN = 'XPERT_HANDOFF_QUEUE_SERVICE';
1092
1092
 
1093
+ /**
1094
+ * System token for resolving account binding permission service from plugin context.
1095
+ */ const ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_ACCOUNT_BINDING_PERMISSION_SERVICE';
1096
+
1097
+ /**
1098
+ * System token for resolving bound identity login permission service from plugin context.
1099
+ */ const BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE';
1100
+
1101
+ /**
1102
+ * System token for resolving the pending SSO binding challenge service from plugin context.
1103
+ */ const SSO_BINDING_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_SSO_BINDING_PERMISSION_SERVICE';
1104
+
1093
1105
  /**
1094
1106
  * System token for resolving user permission service from plugin context.
1095
1107
  */ const USER_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_USER_PERMISSION_SERVICE';
@@ -2865,6 +2877,22 @@ exports.FileUploadTargetRegistry = __decorate([
2865
2877
  ])
2866
2878
  ], exports.FileUploadTargetRegistry);
2867
2879
 
2880
+ const SSO_PROVIDER = 'SSO_PROVIDER';
2881
+ const SSOProviderStrategyKey = (provider)=>common.applyDecorators(common.SetMetadata(SSO_PROVIDER, provider), common.SetMetadata(STRATEGY_META_KEY, SSO_PROVIDER));
2882
+
2883
+ exports.SSOProviderRegistry = class SSOProviderRegistry extends BaseStrategyRegistry {
2884
+ constructor(discoveryService, reflector){
2885
+ super(SSO_PROVIDER, discoveryService, reflector);
2886
+ }
2887
+ };
2888
+ exports.SSOProviderRegistry = __decorate([
2889
+ common.Injectable(),
2890
+ __metadata("design:paramtypes", [
2891
+ core.DiscoveryService,
2892
+ core.Reflector
2893
+ ])
2894
+ ], exports.SSOProviderRegistry);
2895
+
2868
2896
  const SANDBOX_SHELL_TIMEOUT_LIMITS_SEC = {
2869
2897
  min: 1,
2870
2898
  max: 3600
@@ -2916,14 +2944,14 @@ function resolveSandboxExecutionOptions(options, defaults = DEFAULT_SANDBOX_SHEL
2916
2944
  *
2917
2945
  * @param backend - Backend instance to check
2918
2946
  * @returns True if the backend implements SandboxBackendProtocol
2919
- */ function isObjectLike(value) {
2947
+ */ function isObjectLike$1(value) {
2920
2948
  return typeof value === 'object' && value !== null;
2921
2949
  }
2922
2950
  function isSandboxBackend(backend) {
2923
- return isObjectLike(backend) && typeof Reflect.get(backend, 'execute') === 'function' && typeof Reflect.get(backend, 'id') === 'string';
2951
+ return isObjectLike$1(backend) && typeof Reflect.get(backend, 'execute') === 'function' && typeof Reflect.get(backend, 'id') === 'string';
2924
2952
  }
2925
2953
  function resolveSandboxBackend(sandbox) {
2926
- if (!isObjectLike(sandbox)) {
2954
+ if (!isObjectLike$1(sandbox)) {
2927
2955
  return null;
2928
2956
  }
2929
2957
  const candidate = Reflect.has(sandbox, 'backend') ? Reflect.get(sandbox, 'backend') : sandbox;
@@ -3852,6 +3880,20 @@ exports.SandboxProviderRegistry = __decorate([
3852
3880
  ])
3853
3881
  ], exports.SandboxProviderRegistry);
3854
3882
 
3883
+ function isObjectLike(value) {
3884
+ return typeof value === 'object' && value !== null;
3885
+ }
3886
+ function isSandboxTerminalAdapter(value) {
3887
+ return isObjectLike(value) && typeof Reflect.get(value, 'open') === 'function';
3888
+ }
3889
+ function resolveSandboxTerminalAdapter(sandbox) {
3890
+ if (!isObjectLike(sandbox)) {
3891
+ return null;
3892
+ }
3893
+ const candidate = Reflect.has(sandbox, 'backend') ? Reflect.get(sandbox, 'backend') : sandbox;
3894
+ return isSandboxTerminalAdapter(candidate) ? candidate : null;
3895
+ }
3896
+
3855
3897
  const VIEW_EXTENSION_PROVIDER = 'VIEW_EXTENSION_PROVIDER';
3856
3898
  const ViewExtensionProvider = (providerKey)=>common.applyDecorators(common.SetMetadata(VIEW_EXTENSION_PROVIDER, providerKey), common.SetMetadata(STRATEGY_META_KEY, VIEW_EXTENSION_PROVIDER));
3857
3899
 
@@ -3892,6 +3934,7 @@ exports.ViewExtensionProviderRegistry = __decorate([
3892
3934
 
3893
3935
  const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
3894
3936
 
3937
+ exports.ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN = ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN;
3895
3938
  exports.AGENT_CHAT_DISPATCH_MESSAGE_TYPE = AGENT_CHAT_DISPATCH_MESSAGE_TYPE;
3896
3939
  exports.AGENT_MIDDLEWARE_STRATEGY = AGENT_MIDDLEWARE_STRATEGY;
3897
3940
  exports.AIModelProviderNotFoundException = AIModelProviderNotFoundException;
@@ -3901,6 +3944,7 @@ exports.ANALYTICS_PERMISSION_SERVICE_TOKEN = ANALYTICS_PERMISSION_SERVICE_TOKEN;
3901
3944
  exports.AdapterDataSourceStrategy = AdapterDataSourceStrategy;
3902
3945
  exports.AgentMiddlewareStrategy = AgentMiddlewareStrategy;
3903
3946
  exports.AiModelNotFoundException = AiModelNotFoundException;
3947
+ exports.BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN = BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN;
3904
3948
  exports.BaseHTTPQueryRunner = BaseHTTPQueryRunner;
3905
3949
  exports.BaseQueryRunner = BaseQueryRunner;
3906
3950
  exports.BaseSQLQueryRunner = BaseSQLQueryRunner;
@@ -3974,6 +4018,9 @@ exports.RetrieverStrategy = RetrieverStrategy;
3974
4018
  exports.SANDBOX_PROVIDER = SANDBOX_PROVIDER;
3975
4019
  exports.SANDBOX_SHELL_TIMEOUT_LIMITS_SEC = SANDBOX_SHELL_TIMEOUT_LIMITS_SEC;
3976
4020
  exports.SKILL_SOURCE_PROVIDER = SKILL_SOURCE_PROVIDER;
4021
+ exports.SSOProviderStrategyKey = SSOProviderStrategyKey;
4022
+ exports.SSO_BINDING_PERMISSION_SERVICE_TOKEN = SSO_BINDING_PERMISSION_SERVICE_TOKEN;
4023
+ exports.SSO_PROVIDER = SSO_PROVIDER;
3977
4024
  exports.STRATEGY_META_KEY = STRATEGY_META_KEY;
3978
4025
  exports.SandboxProviderStrategy = SandboxProviderStrategy;
3979
4026
  exports.SkillSourceProviderStrategy = SkillSourceProviderStrategy;
@@ -4019,6 +4066,7 @@ exports.getRequestContext = getRequestContext;
4019
4066
  exports.getRequiredPermissionOperation = getRequiredPermissionOperation;
4020
4067
  exports.isRemoteFile = isRemoteFile;
4021
4068
  exports.isSandboxBackend = isSandboxBackend;
4069
+ exports.isSandboxTerminalAdapter = isSandboxTerminalAdapter;
4022
4070
  exports.isStructuredMessageType = isStructuredMessageType;
4023
4071
  exports.loadYamlFile = loadYamlFile;
4024
4072
  exports.mergeCredentials = mergeCredentials;
@@ -4026,6 +4074,7 @@ exports.mergeParentChildChunks = mergeParentChildChunks;
4026
4074
  exports.normalizeContextSize = normalizeContextSize;
4027
4075
  exports.resolveSandboxBackend = resolveSandboxBackend;
4028
4076
  exports.resolveSandboxExecutionOptions = resolveSandboxExecutionOptions;
4077
+ exports.resolveSandboxTerminalAdapter = resolveSandboxTerminalAdapter;
4029
4078
  exports.runWithRequestContext = runWithRequestContext;
4030
4079
  exports.secondsToMilliseconds = secondsToMilliseconds;
4031
4080
  exports.sumTokenUsage = sumTokenUsage;
package/index.esm.js CHANGED
@@ -1069,6 +1069,18 @@ function getRequiredPermissionOperation(method, permissionType) {
1069
1069
  * Internal system token used by core to expose the handoff queue bridge.
1070
1070
  */ const HANDOFF_QUEUE_SERVICE_TOKEN = 'XPERT_HANDOFF_QUEUE_SERVICE';
1071
1071
 
1072
+ /**
1073
+ * System token for resolving account binding permission service from plugin context.
1074
+ */ const ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_ACCOUNT_BINDING_PERMISSION_SERVICE';
1075
+
1076
+ /**
1077
+ * System token for resolving bound identity login permission service from plugin context.
1078
+ */ const BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE';
1079
+
1080
+ /**
1081
+ * System token for resolving the pending SSO binding challenge service from plugin context.
1082
+ */ const SSO_BINDING_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_SSO_BINDING_PERMISSION_SERVICE';
1083
+
1072
1084
  /**
1073
1085
  * System token for resolving user permission service from plugin context.
1074
1086
  */ const USER_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_USER_PERMISSION_SERVICE';
@@ -2844,6 +2856,22 @@ FileUploadTargetRegistry = __decorate([
2844
2856
  ])
2845
2857
  ], FileUploadTargetRegistry);
2846
2858
 
2859
+ const SSO_PROVIDER = 'SSO_PROVIDER';
2860
+ const SSOProviderStrategyKey = (provider)=>applyDecorators(SetMetadata(SSO_PROVIDER, provider), SetMetadata(STRATEGY_META_KEY, SSO_PROVIDER));
2861
+
2862
+ let SSOProviderRegistry = class SSOProviderRegistry extends BaseStrategyRegistry {
2863
+ constructor(discoveryService, reflector){
2864
+ super(SSO_PROVIDER, discoveryService, reflector);
2865
+ }
2866
+ };
2867
+ SSOProviderRegistry = __decorate([
2868
+ Injectable(),
2869
+ __metadata("design:paramtypes", [
2870
+ DiscoveryService,
2871
+ Reflector
2872
+ ])
2873
+ ], SSOProviderRegistry);
2874
+
2847
2875
  const SANDBOX_SHELL_TIMEOUT_LIMITS_SEC = {
2848
2876
  min: 1,
2849
2877
  max: 3600
@@ -2895,14 +2923,14 @@ function resolveSandboxExecutionOptions(options, defaults = DEFAULT_SANDBOX_SHEL
2895
2923
  *
2896
2924
  * @param backend - Backend instance to check
2897
2925
  * @returns True if the backend implements SandboxBackendProtocol
2898
- */ function isObjectLike(value) {
2926
+ */ function isObjectLike$1(value) {
2899
2927
  return typeof value === 'object' && value !== null;
2900
2928
  }
2901
2929
  function isSandboxBackend(backend) {
2902
- return isObjectLike(backend) && typeof Reflect.get(backend, 'execute') === 'function' && typeof Reflect.get(backend, 'id') === 'string';
2930
+ return isObjectLike$1(backend) && typeof Reflect.get(backend, 'execute') === 'function' && typeof Reflect.get(backend, 'id') === 'string';
2903
2931
  }
2904
2932
  function resolveSandboxBackend(sandbox) {
2905
- if (!isObjectLike(sandbox)) {
2933
+ if (!isObjectLike$1(sandbox)) {
2906
2934
  return null;
2907
2935
  }
2908
2936
  const candidate = Reflect.has(sandbox, 'backend') ? Reflect.get(sandbox, 'backend') : sandbox;
@@ -3831,6 +3859,20 @@ SandboxProviderRegistry = __decorate([
3831
3859
  ])
3832
3860
  ], SandboxProviderRegistry);
3833
3861
 
3862
+ function isObjectLike(value) {
3863
+ return typeof value === 'object' && value !== null;
3864
+ }
3865
+ function isSandboxTerminalAdapter(value) {
3866
+ return isObjectLike(value) && typeof Reflect.get(value, 'open') === 'function';
3867
+ }
3868
+ function resolveSandboxTerminalAdapter(sandbox) {
3869
+ if (!isObjectLike(sandbox)) {
3870
+ return null;
3871
+ }
3872
+ const candidate = Reflect.has(sandbox, 'backend') ? Reflect.get(sandbox, 'backend') : sandbox;
3873
+ return isSandboxTerminalAdapter(candidate) ? candidate : null;
3874
+ }
3875
+
3834
3876
  const VIEW_EXTENSION_PROVIDER = 'VIEW_EXTENSION_PROVIDER';
3835
3877
  const ViewExtensionProvider = (providerKey)=>applyDecorators(SetMetadata(VIEW_EXTENSION_PROVIDER, providerKey), SetMetadata(STRATEGY_META_KEY, VIEW_EXTENSION_PROVIDER));
3836
3878
 
@@ -3871,4 +3913,4 @@ ViewExtensionProviderRegistry = __decorate([
3871
3913
 
3872
3914
  const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
3873
3915
 
3874
- export { AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PERMISSION_SERVICE_TOKEN, AdapterDataSourceStrategy, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AiModelNotFoundException, 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, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, 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, 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, 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, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, isRemoteFile, isSandboxBackend, isStructuredMessageType, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, resolveSandboxBackend, resolveSandboxExecutionOptions, runWithRequestContext, secondsToMilliseconds, sumTokenUsage };
3916
+ 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, 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, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, 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, 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, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, isRemoteFile, isSandboxBackend, isSandboxTerminalAdapter, isStructuredMessageType, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxTerminalAdapter, runWithRequestContext, secondsToMilliseconds, sumTokenUsage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/plugin-sdk",
3
- "version": "3.9.0-beta.2",
3
+ "version": "3.9.0",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.d.ts CHANGED
@@ -15,5 +15,6 @@ export * from './lib/agent/index';
15
15
  export * from './lib/channel/index';
16
16
  export * from './lib/file/index';
17
17
  export * from './lib/strategy';
18
+ export * from './lib/sso/index';
18
19
  export * from './lib/sandbox/index';
19
20
  export * from './lib/view-extension/index';
@@ -12,6 +12,7 @@ export interface IAgentMiddlewareContext {
12
12
  xpertId?: string;
13
13
  xpertFeatures?: TXpertFeatures | null;
14
14
  agentKey?: string;
15
+ knowledgebaseIds?: string[];
15
16
  node: IWFNMiddleware;
16
17
  tools: Map<string, StructuredToolInterface | RunnableToolLike>;
17
18
  }
@@ -0,0 +1,36 @@
1
+ import type { IUser } from '@xpert-ai/contracts';
2
+ import type { BasePermission } from './general';
3
+ export type AccountBindingPermissionOperation = 'read' | 'write' | 'delete';
4
+ /**
5
+ * Account Binding Permission
6
+ * Example: { type: 'account_binding', operations: ['write'], providers: ['feishu'] }
7
+ */
8
+ export interface AccountBindingPermission extends BasePermission {
9
+ type: 'account_binding';
10
+ operations?: AccountBindingPermissionOperation[];
11
+ providers?: string[];
12
+ scope?: string[];
13
+ }
14
+ /**
15
+ * System token for resolving account binding permission service from plugin context.
16
+ */
17
+ export declare const ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN = "XPERT_PLUGIN_ACCOUNT_BINDING_PERMISSION_SERVICE";
18
+ export interface BindCurrentUserInput {
19
+ provider: string;
20
+ subjectId: string;
21
+ profile?: Record<string, any>;
22
+ }
23
+ export interface ResolveBoundUserInput {
24
+ provider: string;
25
+ subjectId: string;
26
+ tenantId?: string;
27
+ }
28
+ export interface BoundIdentityRef {
29
+ provider: string;
30
+ subjectId: string;
31
+ }
32
+ export interface AccountBindingPermissionService {
33
+ bindCurrentUser(input: BindCurrentUserInput): Promise<BoundIdentityRef>;
34
+ resolveBoundUser<TUser = IUser>(input: ResolveBoundUserInput): Promise<TUser | null>;
35
+ unbindCurrentUser(provider: string): Promise<void>;
36
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shared auth token payload returned by host-controlled login flows.
3
+ */
4
+ export interface IssuedAuthTokens {
5
+ jwt: string;
6
+ refreshToken: string;
7
+ userId: string;
8
+ }
@@ -0,0 +1,25 @@
1
+ import type { IssuedAuthTokens } from './auth-login';
2
+ import type { BasePermission } from './general';
3
+ export type BoundIdentityLoginPermissionOperation = 'create';
4
+ /**
5
+ * Bound identity login permission
6
+ * Example: { type: 'bound_identity_login', operations: ['create'], providers: ['lark'] }
7
+ */
8
+ export interface BoundIdentityLoginPermission extends BasePermission {
9
+ type: 'bound_identity_login';
10
+ operations?: BoundIdentityLoginPermissionOperation[];
11
+ providers?: string[];
12
+ }
13
+ /**
14
+ * System token for resolving bound identity login permission service from plugin context.
15
+ */
16
+ export declare const BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN = "XPERT_PLUGIN_BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE";
17
+ export interface BoundIdentityLoginInput {
18
+ provider: string;
19
+ subjectId: string;
20
+ tenantId: string;
21
+ organizationId?: string | null;
22
+ }
23
+ export interface BoundIdentityLoginPermissionService {
24
+ loginWithBoundIdentity(input: BoundIdentityLoginInput): Promise<IssuedAuthTokens | null>;
25
+ }
@@ -9,15 +9,22 @@ export * from './general';
9
9
  export * from './analytics';
10
10
  export * from './operation';
11
11
  export * from './handoff';
12
+ export * from './account-binding';
13
+ export * from './auth-login';
14
+ export * from './bound-identity-login';
15
+ export * from './sso-binding';
12
16
  export * from './user';
13
17
  import type { FileSystemPermission, IntegrationPermission, KnowledgePermission, LLMPermission, VectorStorePermission } from './general';
14
18
  import type { AnalyticsPermission } from './analytics';
19
+ import type { AccountBindingPermission } from './account-binding';
20
+ import type { BoundIdentityLoginPermission } from './bound-identity-login';
15
21
  import type { HandoffPermission } from './handoff';
22
+ import type { SsoBindingPermission } from './sso-binding';
16
23
  import type { UserPermission } from './user';
17
24
  /**
18
25
  * Union type for all permissions
19
26
  */
20
- export type Permission = LLMPermission | VectorStorePermission | KnowledgePermission | FileSystemPermission | IntegrationPermission | AnalyticsPermission | UserPermission | HandoffPermission;
27
+ export type Permission = LLMPermission | VectorStorePermission | KnowledgePermission | FileSystemPermission | IntegrationPermission | AnalyticsPermission | AccountBindingPermission | BoundIdentityLoginPermission | SsoBindingPermission | UserPermission | HandoffPermission;
21
28
  /**
22
29
  * Permissions array type
23
30
  */
@@ -0,0 +1,33 @@
1
+ import type { BasePermission } from './general';
2
+ export type SsoBindingPermissionOperation = 'create';
3
+ /**
4
+ * SSO Binding Permission
5
+ * Example: { type: 'sso_binding', operations: ['create'], providers: ['lark'] }
6
+ */
7
+ export interface SsoBindingPermission extends BasePermission {
8
+ type: 'sso_binding';
9
+ operations?: SsoBindingPermissionOperation[];
10
+ providers?: string[];
11
+ }
12
+ /**
13
+ * System token for resolving the pending SSO binding challenge service from plugin context.
14
+ */
15
+ export declare const SSO_BINDING_PERMISSION_SERVICE_TOKEN = "XPERT_PLUGIN_SSO_BINDING_PERMISSION_SERVICE";
16
+ export type PendingSsoBindingFlow = 'anonymous_bind' | 'current_user_confirm';
17
+ export interface CreatePendingBindingInput {
18
+ provider: string;
19
+ subjectId: string;
20
+ tenantId: string;
21
+ organizationId?: string | null;
22
+ displayName?: string | null;
23
+ avatarUrl?: string | null;
24
+ profile?: Record<string, any> | null;
25
+ returnTo?: string | null;
26
+ flow?: PendingSsoBindingFlow;
27
+ }
28
+ export interface CreatedPendingBindingRef {
29
+ ticket: string;
30
+ }
31
+ export interface SsoBindingPermissionService {
32
+ createPendingBinding(input: CreatePendingBindingInput): Promise<CreatedPendingBindingRef>;
33
+ }
@@ -4,6 +4,7 @@ export * from './sandbox';
4
4
  export * from './sandbox.decorator';
5
5
  export * from './sandbox.interface';
6
6
  export * from './sandbox.registry';
7
+ export * from './terminal';
7
8
  export * from './sandbox.interface';
8
9
  export * from './sandbox.decorator';
9
10
  export * from './sandbox.registry';
@@ -1,10 +1,36 @@
1
1
  import { TSandboxProviderMeta, TSandboxWorkForType } from '@xpert-ai/contracts';
2
2
  import { SandboxBackendProtocol } from './protocol';
3
+ export type SandboxWorkspaceBinding = {
4
+ /**
5
+ * Host-side bind source used by containerized sandboxes.
6
+ */
7
+ bindSource?: string;
8
+ /**
9
+ * Mount target inside the sandbox container, such as `/workspace`.
10
+ */
11
+ containerMountPath?: string;
12
+ /**
13
+ * Server-visible canonical volume root.
14
+ */
15
+ volumeRoot: string;
16
+ /**
17
+ * Concrete sandbox-visible working path derived from the mapped workspace root.
18
+ */
19
+ workspacePath: string;
20
+ /**
21
+ * Sandbox-visible workspace root that corresponds to `volumeRoot`.
22
+ */
23
+ workspaceRoot: string;
24
+ };
3
25
  export type SandboxProviderCreateOptions = {
4
26
  /**
5
27
  * Working space directory for the sandbox instance
6
28
  */
7
29
  workingDirectory?: string;
30
+ /**
31
+ * Explicit mapping between the server-visible volume root and the sandbox-visible workspace root.
32
+ */
33
+ workspaceBinding?: SandboxWorkspaceBinding;
8
34
  /**
9
35
  * Canonical sandbox environment identifier that owns the container lifecycle.
10
36
  */
@@ -0,0 +1,22 @@
1
+ import type { TSandboxConfigurable } from '@xpert-ai/contracts';
2
+ import type { MaybePromise } from './protocol';
3
+ export type SandboxTerminalExit = {
4
+ exitCode: number | null;
5
+ signal?: number | null;
6
+ };
7
+ export type SandboxTerminalOpenOptions = {
8
+ cols: number;
9
+ rows: number;
10
+ onExit: (event: SandboxTerminalExit) => void;
11
+ onOutput: (data: string) => void;
12
+ };
13
+ export interface SandboxTerminalSession {
14
+ close(): MaybePromise<void>;
15
+ resize(cols: number, rows: number): MaybePromise<void>;
16
+ write(data: string): MaybePromise<void>;
17
+ }
18
+ export interface SandboxTerminalAdapter {
19
+ open(options: SandboxTerminalOpenOptions): MaybePromise<SandboxTerminalSession>;
20
+ }
21
+ export declare function isSandboxTerminalAdapter(value: unknown): value is SandboxTerminalAdapter;
22
+ export declare function resolveSandboxTerminalAdapter(sandbox: TSandboxConfigurable | SandboxTerminalAdapter | null | undefined | unknown): SandboxTerminalAdapter | null;
@@ -0,0 +1,3 @@
1
+ export * from './strategy.decorator';
2
+ export * from './strategy.interface';
3
+ export * from './strategy.registry';
@@ -0,0 +1,2 @@
1
+ export declare const SSO_PROVIDER = "SSO_PROVIDER";
2
+ export declare const SSOProviderStrategyKey: (provider: string) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,15 @@
1
+ export interface ISSOProviderDescriptor {
2
+ provider: string;
3
+ displayName: string;
4
+ icon: string;
5
+ order: number;
6
+ startUrl: string;
7
+ }
8
+ export interface ISSOProviderContext {
9
+ tenantId: string;
10
+ organizationId?: string | null;
11
+ requestBaseUrl: string;
12
+ }
13
+ export interface ISSOProviderStrategy {
14
+ describe(context: ISSOProviderContext): ISSOProviderDescriptor | null | Promise<ISSOProviderDescriptor | null>;
15
+ }
@@ -0,0 +1,6 @@
1
+ import { DiscoveryService, Reflector } from '@nestjs/core';
2
+ import { BaseStrategyRegistry } from '../strategy';
3
+ import { ISSOProviderStrategy } from './strategy.interface';
4
+ export declare class SSOProviderRegistry extends BaseStrategyRegistry<ISSOProviderStrategy> {
5
+ constructor(discoveryService: DiscoveryService, reflector: Reflector);
6
+ }