@xpert-ai/plugin-sdk 3.20.0 → 3.21.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,25 @@
1
1
  # @xpert-ai/plugin-sdk
2
2
 
3
+ ## 3.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c9f9379: Group Knowledge capabilities under `rag/capability` and expose resumable upload sessions through `Documents.uploads`. Support idempotent document imports without automatic processing, plus filename and folder-path search with MIME type filters so unprocessed images remain discoverable.
8
+
9
+ Allow organizations to read public tenant libraries while requiring super administrators to explicitly select tenant scope before managing them. Keep document processing behind write-access checks without switching the caller's request scope. Release the SDK and host implementation together for the new upload API.
10
+
11
+ ### Patch Changes
12
+
13
+ - f76a9c9: Let organization administrators import the official Agent plugins from one Git snapshot with a single button. Reuse existing package versions, isolate package failures, and display import results without granting workspace access. Expose the shared import command for system setup.
14
+ - 82b8db4: Preserve the ENOENT error code when scoped workspace file operations encounter missing files or an uninitialized root. Document the in-process runtime file contract so plugins can distinguish missing files from other failures without interpreting localized messages. Keep path boundaries and HTTP error responses unchanged.
15
+ - Updated dependencies [eecb9fa]
16
+ - Updated dependencies [f76a9c9]
17
+ - Updated dependencies [eecb9fa]
18
+ - Updated dependencies [c5e19d5]
19
+ - Updated dependencies [4b7a346]
20
+ - Updated dependencies [4fff330]
21
+ - @xpert-ai/contracts@3.21.0
22
+
3
23
  ## 3.20.0
4
24
 
5
25
  ### Minor Changes
package/index.cjs.js CHANGED
@@ -200,14 +200,15 @@ class RequestContext {
200
200
  const session = getRequestContext();
201
201
  return session;
202
202
  }
203
- static currentApiKey() {
203
+ /** @deprecated For resource authorization use currentApiPrincipal()?.resourceScope; retained for credential metadata. */ static currentApiKey() {
204
204
  var _RequestContext_currentApiPrincipal;
205
205
  var _RequestContext_currentApiPrincipal_apiKey;
206
206
  return (_RequestContext_currentApiPrincipal_apiKey = (_RequestContext_currentApiPrincipal = RequestContext.currentApiPrincipal()) == null ? void 0 : _RequestContext_currentApiPrincipal.apiKey) != null ? _RequestContext_currentApiPrincipal_apiKey : null;
207
207
  }
208
208
  static currentApiPrincipal() {
209
209
  const user = RequestContext.currentUser();
210
- return (user == null ? void 0 : user.apiKey) ? user : null;
210
+ // Conversation-scoped client secrets carry no synthetic API key.
211
+ return (user == null ? void 0 : user.apiKey) || (user == null ? void 0 : user.principalType) === 'client_secret' || (user == null ? void 0 : user.principalType) === 'api_key' ? user : null;
211
212
  }
212
213
  static currentRequest() {
213
214
  const requestContext = RequestContext.currentRequestContext();
@@ -1122,6 +1123,28 @@ exports.KeywordAnalyzerRegistry = __decorate([
1122
1123
  ])
1123
1124
  ], exports.KeywordAnalyzerRegistry);
1124
1125
 
1126
+ const KnowledgebaseRuntimeCapability = modelProvider.createRuntimeCapability('platform.knowledgebase', {
1127
+ description: 'List, search, and write chunks in platform knowledgebases.'
1128
+ });
1129
+ const KnowledgebaseProvisioningRuntimeCapability = modelProvider.createRuntimeCapability('platform.knowledgebase.provisioning', {
1130
+ description: 'Idempotently provision managed platform knowledgebases and connect them to an Agent.'
1131
+ });
1132
+
1133
+ const KnowledgeGraphRuntimeCapability = modelProvider.createRuntimeCapability('platform.knowledge-graph', {
1134
+ description: 'Publish, inspect, and retract source-owned structured knowledge graphs without model extraction.'
1135
+ });
1136
+
1137
+ const KnowledgebaseDocumentsRuntimeCapability = modelProvider.createRuntimeCapability('platform.knowledgebase.documents', {
1138
+ description: 'Upload, import, create, process, reprocess, inspect, and delete persistent knowledgebase documents.'
1139
+ });
1140
+
1141
+ const KnowledgeDocumentVisualAssetsRuntimeCapability = modelProvider.createRuntimeCapability('platform.knowledgebase.visual-assets', {
1142
+ description: 'Issue execution-scoped logical KnowledgeDocument image paths and inject validated images without exposing host storage paths.'
1143
+ });
1144
+ const KnowledgeDocumentVisualAssetsRuntimeFactoryCapability = modelProvider.createRuntimeCapability('platform.knowledge-document.visual-assets.factory', {
1145
+ description: 'Create a visual-assets API with an execution-local image allow-list and authorized workspace writer.'
1146
+ });
1147
+
1125
1148
  const TOOLSET_STRATEGY = 'TOOLSET_STRATEGY';
1126
1149
  /**
1127
1150
  * Decorator to mark a provider as a Toolset Strategy
@@ -10120,6 +10143,13 @@ const ProjectTasksRuntimeCapability = modelProvider.createRuntimeCapability('pla
10120
10143
  description: 'Read project task graphs, manage schedules, and resolve exact execution conversations.'
10121
10144
  });
10122
10145
 
10146
+ /** Import official resource packages for the authenticated organization administrator. Does not authorize workspaces. */ class ImportDefaultAgentPluginsCommand extends cqrs.Command {
10147
+ }
10148
+ ImportDefaultAgentPluginsCommand.type = '[Agent Plugins] Import defaults';
10149
+ Reflect.defineMetadata('__command__', {
10150
+ id: ImportDefaultAgentPluginsCommand.type
10151
+ }, ImportDefaultAgentPluginsCommand);
10152
+
10123
10153
  Object.defineProperty(exports, "ASSISTANT_CHAT_SEND_MESSAGE_COMMAND", {
10124
10154
  enumerable: true,
10125
10155
  get: function () { return contracts.ASSISTANT_CHAT_SEND_MESSAGE_COMMAND; }
@@ -10156,12 +10186,6 @@ exports.BaseToolset = modelProvider.BaseToolset;
10156
10186
  exports.BuiltinToolset = modelProvider.BuiltinToolset;
10157
10187
  exports.DefaultAgentMiddlewareRuntimeCapabilityRegistry = modelProvider.DefaultRuntimeCapabilityRegistry;
10158
10188
  exports.DefaultRuntimeCapabilityRegistry = modelProvider.DefaultRuntimeCapabilityRegistry;
10159
- exports.KnowledgeDocumentVisualAssetsRuntimeCapability = modelProvider.KnowledgeDocumentVisualAssetsRuntimeCapability;
10160
- exports.KnowledgeDocumentVisualAssetsRuntimeFactoryCapability = modelProvider.KnowledgeDocumentVisualAssetsRuntimeFactoryCapability;
10161
- exports.KnowledgeGraphRuntimeCapability = modelProvider.KnowledgeGraphRuntimeCapability;
10162
- exports.KnowledgebaseDocumentsRuntimeCapability = modelProvider.KnowledgebaseDocumentsRuntimeCapability;
10163
- exports.KnowledgebaseProvisioningRuntimeCapability = modelProvider.KnowledgebaseProvisioningRuntimeCapability;
10164
- exports.KnowledgebaseRuntimeCapability = modelProvider.KnowledgebaseRuntimeCapability;
10165
10189
  exports.ModelProviderBuiltinToolset = modelProvider.ModelProviderBuiltinToolset;
10166
10190
  exports.ProjectAccessRuntimeCapability = modelProvider.ProjectAccessRuntimeCapability;
10167
10191
  exports.ProjectProvisioningRuntimeCapability = modelProvider.ProjectProvisioningRuntimeCapability;
@@ -10283,13 +10307,20 @@ exports.INTEGRATION_PERMISSION_SERVICE_TOKEN = INTEGRATION_PERMISSION_SERVICE_TO
10283
10307
  exports.INTEGRATION_STRATEGY = INTEGRATION_STRATEGY;
10284
10308
  exports.ImageGenerationModel = ImageGenerationModel;
10285
10309
  exports.ImageUnderstandingStrategy = ImageUnderstandingStrategy;
10310
+ exports.ImportDefaultAgentPluginsCommand = ImportDefaultAgentPluginsCommand;
10286
10311
  exports.IntegrationStrategyKey = IntegrationStrategyKey;
10287
10312
  exports.JUMP_TO_TARGETS = JUMP_TO_TARGETS;
10288
10313
  exports.JsonSchemaValidator = JsonSchemaValidator;
10289
10314
  exports.KEYWORD_ANALYZER_STRATEGY = KEYWORD_ANALYZER_STRATEGY;
10290
10315
  exports.KNOWLEDGE_STRATEGY = KNOWLEDGE_STRATEGY;
10291
10316
  exports.KeywordAnalyzerStrategy = KeywordAnalyzerStrategy;
10317
+ exports.KnowledgeDocumentVisualAssetsRuntimeCapability = KnowledgeDocumentVisualAssetsRuntimeCapability;
10318
+ exports.KnowledgeDocumentVisualAssetsRuntimeFactoryCapability = KnowledgeDocumentVisualAssetsRuntimeFactoryCapability;
10319
+ exports.KnowledgeGraphRuntimeCapability = KnowledgeGraphRuntimeCapability;
10292
10320
  exports.KnowledgeStrategyKey = KnowledgeStrategyKey;
10321
+ exports.KnowledgebaseDocumentsRuntimeCapability = KnowledgebaseDocumentsRuntimeCapability;
10322
+ exports.KnowledgebaseProvisioningRuntimeCapability = KnowledgebaseProvisioningRuntimeCapability;
10323
+ exports.KnowledgebaseRuntimeCapability = KnowledgebaseRuntimeCapability;
10293
10324
  exports.LLMUsage = LLMUsage;
10294
10325
  exports.LargeLanguageModel = LargeLanguageModel;
10295
10326
  exports.MANAGED_CONNECTION_REGISTRY_TOKEN = MANAGED_CONNECTION_REGISTRY_TOKEN;
package/index.esm.js CHANGED
@@ -16,7 +16,7 @@ import fs__default from 'fs';
16
16
  import http from 'http';
17
17
  import https from 'https';
18
18
  import { c as createRuntimeCapability, B as BuiltinToolset, W as WorkspaceFilesRuntimeCapability } from './model-provider.esm.js';
19
- export { A as ActorTokenRuntimeCapability, a as ActorTokenRuntimeFactoryCapability, b as ArtifactsRuntimeCapability, d as BaseTool, e as BaseToolset, D as DefaultAgentMiddlewareRuntimeCapabilityRegistry, D as DefaultRuntimeCapabilityRegistry, K as KnowledgeDocumentVisualAssetsRuntimeCapability, f as KnowledgeDocumentVisualAssetsRuntimeFactoryCapability, g as KnowledgeGraphRuntimeCapability, h as KnowledgebaseDocumentsRuntimeCapability, i as KnowledgebaseProvisioningRuntimeCapability, j as KnowledgebaseRuntimeCapability, M as ModelProviderBuiltinToolset, P as ProjectAccessRuntimeCapability, k as ProjectProvisioningRuntimeCapability, R as RUNTIME_CAPABILITY_PROVIDER, l as RuntimeCapabilityProvider, S as SANDBOX_JOB_ERROR_CODES, m as SANDBOX_JOB_PROGRESS_PREFIX, n as SandboxJobRuntimeError, o as SandboxJobsRuntimeCapability, T as ToolImagesRuntimeCapability, p as WORKSPACE_FILES_SOURCE, X as XPERT_RUNTIME_CAPABILITIES_TOKEN, q as isSandboxJobRuntimeError } from './model-provider.esm.js';
19
+ export { A as ActorTokenRuntimeCapability, a as ActorTokenRuntimeFactoryCapability, b as ArtifactsRuntimeCapability, d as BaseTool, e as BaseToolset, D as DefaultAgentMiddlewareRuntimeCapabilityRegistry, D as DefaultRuntimeCapabilityRegistry, M as ModelProviderBuiltinToolset, P as ProjectAccessRuntimeCapability, f as ProjectProvisioningRuntimeCapability, R as RUNTIME_CAPABILITY_PROVIDER, g as RuntimeCapabilityProvider, S as SANDBOX_JOB_ERROR_CODES, h as SANDBOX_JOB_PROGRESS_PREFIX, i as SandboxJobRuntimeError, j as SandboxJobsRuntimeCapability, T as ToolImagesRuntimeCapability, k as WORKSPACE_FILES_SOURCE, X as XPERT_RUNTIME_CAPABILITIES_TOKEN, l as isSandboxJobRuntimeError } from './model-provider.esm.js';
20
20
  import fsPromises from 'fs/promises';
21
21
  import * as path from 'path';
22
22
  import path__default, { join } from 'path';
@@ -182,14 +182,15 @@ class RequestContext {
182
182
  const session = getRequestContext();
183
183
  return session;
184
184
  }
185
- static currentApiKey() {
185
+ /** @deprecated For resource authorization use currentApiPrincipal()?.resourceScope; retained for credential metadata. */ static currentApiKey() {
186
186
  var _RequestContext_currentApiPrincipal;
187
187
  var _RequestContext_currentApiPrincipal_apiKey;
188
188
  return (_RequestContext_currentApiPrincipal_apiKey = (_RequestContext_currentApiPrincipal = RequestContext.currentApiPrincipal()) == null ? void 0 : _RequestContext_currentApiPrincipal.apiKey) != null ? _RequestContext_currentApiPrincipal_apiKey : null;
189
189
  }
190
190
  static currentApiPrincipal() {
191
191
  const user = RequestContext.currentUser();
192
- return (user == null ? void 0 : user.apiKey) ? user : null;
192
+ // Conversation-scoped client secrets carry no synthetic API key.
193
+ return (user == null ? void 0 : user.apiKey) || (user == null ? void 0 : user.principalType) === 'client_secret' || (user == null ? void 0 : user.principalType) === 'api_key' ? user : null;
193
194
  }
194
195
  static currentRequest() {
195
196
  const requestContext = RequestContext.currentRequestContext();
@@ -1104,6 +1105,28 @@ KeywordAnalyzerRegistry = __decorate([
1104
1105
  ])
1105
1106
  ], KeywordAnalyzerRegistry);
1106
1107
 
1108
+ const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
1109
+ description: 'List, search, and write chunks in platform knowledgebases.'
1110
+ });
1111
+ const KnowledgebaseProvisioningRuntimeCapability = createRuntimeCapability('platform.knowledgebase.provisioning', {
1112
+ description: 'Idempotently provision managed platform knowledgebases and connect them to an Agent.'
1113
+ });
1114
+
1115
+ const KnowledgeGraphRuntimeCapability = createRuntimeCapability('platform.knowledge-graph', {
1116
+ description: 'Publish, inspect, and retract source-owned structured knowledge graphs without model extraction.'
1117
+ });
1118
+
1119
+ const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
1120
+ description: 'Upload, import, create, process, reprocess, inspect, and delete persistent knowledgebase documents.'
1121
+ });
1122
+
1123
+ const KnowledgeDocumentVisualAssetsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.visual-assets', {
1124
+ description: 'Issue execution-scoped logical KnowledgeDocument image paths and inject validated images without exposing host storage paths.'
1125
+ });
1126
+ const KnowledgeDocumentVisualAssetsRuntimeFactoryCapability = createRuntimeCapability('platform.knowledge-document.visual-assets.factory', {
1127
+ description: 'Create a visual-assets API with an execution-local image allow-list and authorized workspace writer.'
1128
+ });
1129
+
1107
1130
  const TOOLSET_STRATEGY = 'TOOLSET_STRATEGY';
1108
1131
  /**
1109
1132
  * Decorator to mark a provider as a Toolset Strategy
@@ -10102,4 +10125,11 @@ const ProjectTasksRuntimeCapability = createRuntimeCapability('platform.project.
10102
10125
  description: 'Read project task graphs, manage schedules, and resolve exact execution conversations.'
10103
10126
  });
10104
10127
 
10105
- export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AGENT_RUNTIME_EVENT_MESSAGE_TYPE, AGENT_RUNTIME_STRATEGY, AIModel, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ASSISTANT_CAPABILITY_PROVIDER, AdapterDataSourceStrategy, AgentExecutionRunnerCapability, AgentExecutionRunnerFactoryCapability, AgentInvocationRuntimeCapability, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AgentRuntimeFactoryCapability, AgentRuntimeRegistry, AgentRuntimeStrategy, AiModelNotFoundException, AssistantCapabilityProvider, AssistantCapabilityProviderRegistry, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CLI_MODEL_TOKEN_REFERENCE, COLLABORATION_DOCUMENT_PROVIDER, CONNECTION_COMMAND_ROUTER_TOKEN, CONNECTOR_STRATEGY, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CliModelProfilesCapability, CollaborationDocumentProvider, CollaborationDocumentProviderRegistry, CollaborationRuntimeCapability, CommonParameterRules, ConnectorRuntimeCapability, ConnectorRuntimeFactoryCapability, 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, DecoratedAgentMiddlewareStrategy, DecoratedToolsetStrategy, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, EVOLUTION_RUNTIME_SERVICE_TOKEN, EVOLUTION_TARGET_PROVIDER, EvolutionBaselineRuntimeCapability, EvolutionChangeRuntimeCapability, EvolutionRuntimeCapability, EvolutionTargetProviderRegistry, EvolutionTargetProviderStrategy, 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, ImageGenerationModel, ImageUnderstandingRegistry, ImageUnderstandingStrategy, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KEYWORD_ANALYZER_STRATEGY, KNOWLEDGE_STRATEGY, KeywordAnalyzerRegistry, KeywordAnalyzerStrategy, KnowledgeStrategyKey, KnowledgeStrategyRegistry, LLMUsage, LargeLanguageModel, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, MCP_CAPABILITY_CHANGE_EVENT_TYPES, MODEL_OUTPUT_VALIDATION_ERROR_CODE, ModelExecutionEnvironmentCapability, ModelOutputValidationError, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_VERSION_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, PROJECT_TASK_PROVIDER, PROJECT_TYPE_PROVIDER, 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, ProjectTaskProvider, ProjectTaskProviderRegistry, ProjectTasksRuntimeCapability, ProjectTypeProvider, ProjectTypeProviderRegistry, RESOURCE_CARD_EVENT, RESOURCE_CARD_PROVIDER, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, ResourceCardProvider, ResourceCardProviderRegistry, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_RUNTIME_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SANDBOX_WORKSPACE_MAPPER, 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, SandboxRuntimeProviderRegistry, SandboxRuntimeProviderStrategy, SandboxWorkspaceMapperRegistry, SandboxWorkspaceMapperStrategy, ShellModelExecutionSourceCapability, 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, VIDEO_GENERATION_PERMISSION_SERVICE_TOKEN, VIDEO_GENERATION_SERVICE_TOKEN, VIDEO_GENERATOR_FAMILIES, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, VideoGenerationModel, ViewExtensionProvider, ViewExtensionProviderRegistry, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_AGENT_MIDDLEWARE_RUNTIME_TOKEN, XPERT_TOOL_METHOD_METADATA, XPERT_TOOL_PROVIDER, XPERT_TOOL_PROVIDER_METADATA, XPERT_TOOL_RESULT_FORMAT_VERSION, XpFileSystem, XpertPrompt, XpertResource, XpertResourceTemplate, XpertServerPlugin, XpertTool, XpertToolProvider, XpertToolProviderCoordinator, XpertToolProviderRegistry, agentInvocationDispatchContextSchema, agentRuntimeConsumptionStateSchema, agentRuntimeDeliveryStateSchema, agentRuntimeEventMessageId, agentRuntimeEventSchema, agentRuntimeReplyTargetSchema, agentRuntimeResultClaimSchema, agentRuntimeResultConsumptionKey, als, appendSandboxMessage, assertConnectorDefinition, buildSandboxTimeoutMessage, calcTokenUsage, calculateLLMUsagePrice, calculateModelPrice, calculateModelUsageCharge, chunkText, countTextTokens, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, defineMcpApp, defineMcpCapabilities, defineMcpPrompt, defineMcpResource, defineMcpResourceTemplate, defineXpertTool, derivePluginArtifactNamespace, describeXpertToolProvider, downloadRemoteFile, emitResourceCard, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, getXpertToolMethod, isAgentInvocationTerminal, isDevelopmentSandboxRuntimeEnvironment, isModelOutputValidationError, isModelUsagePricingConfig, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStrategyInstance, isStructuredMessageType, isTenantGlobalScopeKey, loadYamlFile, mergeCredentials, mergeModelRequirements, mergeParentChildChunks, nativeModelTransport, normalizeContextSize, normalizeTokenUsage, pluginArtifactTableName, prepareToolResult, processAsyncAIGCManagedJob, renderRemoteModuleIframeHtml, renderRemoteReactIframeHtml, renderRemoteVueIframeHtml, resolveModelUsagePricingSnapshot, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveStrategyMetadataTarget, resolveTenantGlobalScopeKey, resolveTokenUsage, resolveTokenUsageCandidates, resolveXpertMcpExtensions, runWithRequestContext, runtimeToolProviderComponent, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage, taskWaitReason, textTokenBoundaries };
10128
+ /** Import official resource packages for the authenticated organization administrator. Does not authorize workspaces. */ class ImportDefaultAgentPluginsCommand extends Command {
10129
+ }
10130
+ ImportDefaultAgentPluginsCommand.type = '[Agent Plugins] Import defaults';
10131
+ Reflect.defineMetadata('__command__', {
10132
+ id: ImportDefaultAgentPluginsCommand.type
10133
+ }, ImportDefaultAgentPluginsCommand);
10134
+
10135
+ export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AGENT_RUNTIME_EVENT_MESSAGE_TYPE, AGENT_RUNTIME_STRATEGY, AIModel, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ASSISTANT_CAPABILITY_PROVIDER, AdapterDataSourceStrategy, AgentExecutionRunnerCapability, AgentExecutionRunnerFactoryCapability, AgentInvocationRuntimeCapability, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AgentRuntimeFactoryCapability, AgentRuntimeRegistry, AgentRuntimeStrategy, AiModelNotFoundException, AssistantCapabilityProvider, AssistantCapabilityProviderRegistry, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BUILTIN_GLOBAL_SCOPE, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CLI_MODEL_TOKEN_REFERENCE, COLLABORATION_DOCUMENT_PROVIDER, CONNECTION_COMMAND_ROUTER_TOKEN, CONNECTOR_STRATEGY, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CliModelProfilesCapability, CollaborationDocumentProvider, CollaborationDocumentProviderRegistry, CollaborationRuntimeCapability, CommonParameterRules, ConnectorRuntimeCapability, ConnectorRuntimeFactoryCapability, 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, DecoratedAgentMiddlewareStrategy, DecoratedToolsetStrategy, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, EVOLUTION_RUNTIME_SERVICE_TOKEN, EVOLUTION_TARGET_PROVIDER, EvolutionBaselineRuntimeCapability, EvolutionChangeRuntimeCapability, EvolutionRuntimeCapability, EvolutionTargetProviderRegistry, EvolutionTargetProviderStrategy, 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, ImageGenerationModel, ImageUnderstandingRegistry, ImageUnderstandingStrategy, ImportDefaultAgentPluginsCommand, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KEYWORD_ANALYZER_STRATEGY, KNOWLEDGE_STRATEGY, KeywordAnalyzerRegistry, KeywordAnalyzerStrategy, KnowledgeDocumentVisualAssetsRuntimeCapability, KnowledgeDocumentVisualAssetsRuntimeFactoryCapability, KnowledgeGraphRuntimeCapability, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseProvisioningRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, MANAGED_CONNECTION_REGISTRY_TOKEN, MANAGED_QUEUE_HANDLER_REGISTRY_TOKEN, MANAGED_QUEUE_SERVICE_TOKEN, MCP_CAPABILITY_CHANGE_EVENT_TYPES, MODEL_OUTPUT_VALIDATION_ERROR_CODE, ModelExecutionEnvironmentCapability, ModelOutputValidationError, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_JOB_PROCESSOR_METADATA, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PLUGIN_VERSION_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_METADATA_KEY, PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN, PROJECT_TASK_PROVIDER, PROJECT_TYPE_PROVIDER, 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, ProjectTaskProvider, ProjectTaskProviderRegistry, ProjectTasksRuntimeCapability, ProjectTypeProvider, ProjectTypeProviderRegistry, RESOURCE_CARD_EVENT, RESOURCE_CARD_PROVIDER, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, ResourceCardProvider, ResourceCardProviderRegistry, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_RUNTIME_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SANDBOX_WORKSPACE_MAPPER, 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, SandboxRuntimeProviderRegistry, SandboxRuntimeProviderStrategy, SandboxWorkspaceMapperRegistry, SandboxWorkspaceMapperStrategy, ShellModelExecutionSourceCapability, 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, VIDEO_GENERATION_PERMISSION_SERVICE_TOKEN, VIDEO_GENERATION_SERVICE_TOKEN, VIDEO_GENERATOR_FAMILIES, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, VideoGenerationModel, ViewExtensionProvider, ViewExtensionProviderRegistry, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_AGENT_MIDDLEWARE_RUNTIME_TOKEN, XPERT_TOOL_METHOD_METADATA, XPERT_TOOL_PROVIDER, XPERT_TOOL_PROVIDER_METADATA, XPERT_TOOL_RESULT_FORMAT_VERSION, XpFileSystem, XpertPrompt, XpertResource, XpertResourceTemplate, XpertServerPlugin, XpertTool, XpertToolProvider, XpertToolProviderCoordinator, XpertToolProviderRegistry, agentInvocationDispatchContextSchema, agentRuntimeConsumptionStateSchema, agentRuntimeDeliveryStateSchema, agentRuntimeEventMessageId, agentRuntimeEventSchema, agentRuntimeReplyTargetSchema, agentRuntimeResultClaimSchema, agentRuntimeResultConsumptionKey, als, appendSandboxMessage, assertConnectorDefinition, buildSandboxTimeoutMessage, calcTokenUsage, calculateLLMUsagePrice, calculateModelPrice, calculateModelUsageCharge, chunkText, countTextTokens, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, defineMcpApp, defineMcpCapabilities, defineMcpPrompt, defineMcpResource, defineMcpResourceTemplate, defineXpertTool, derivePluginArtifactNamespace, describeXpertToolProvider, downloadRemoteFile, emitResourceCard, formatSandboxTimeout, getDefaultTenantId, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, getTenantGlobalScopeKey, getXpertToolMethod, isAgentInvocationTerminal, isDevelopmentSandboxRuntimeEnvironment, isModelOutputValidationError, isModelUsagePricingConfig, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStrategyInstance, isStructuredMessageType, isTenantGlobalScopeKey, loadYamlFile, mergeCredentials, mergeModelRequirements, mergeParentChildChunks, nativeModelTransport, normalizeContextSize, normalizeTokenUsage, pluginArtifactTableName, prepareToolResult, processAsyncAIGCManagedJob, renderRemoteModuleIframeHtml, renderRemoteReactIframeHtml, renderRemoteVueIframeHtml, resolveModelUsagePricingSnapshot, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, resolveStrategyMetadataTarget, resolveTenantGlobalScopeKey, resolveTokenUsage, resolveTokenUsageCandidates, resolveXpertMcpExtensions, runWithRequestContext, runtimeToolProviderComponent, secondsToMilliseconds, setDefaultTenantId, sumTokenUsage, taskWaitReason, textTokenBoundaries };
@@ -6,6 +6,46 @@ var common = require('@nestjs/common');
6
6
  var tools = require('@langchain/core/tools');
7
7
  var v3 = require('zod/v3');
8
8
 
9
+ function createRuntimeCapability(id, options = {}) {
10
+ return Object.freeze({
11
+ id,
12
+ description: options.description
13
+ });
14
+ }
15
+ const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
16
+ /** Metadata key under which RuntimeCapabilityProviderExplorer discovers capability providers. */ const RUNTIME_CAPABILITY_PROVIDER = 'XPERT_RUNTIME_CAPABILITY_PROVIDER';
17
+ /** Tags a Nest provider as the platform implementation of a runtime capability. */ const RuntimeCapabilityProvider = (capability)=>common.SetMetadata(RUNTIME_CAPABILITY_PROVIDER, capability);
18
+ class DefaultRuntimeCapabilityRegistry {
19
+ register(key, implementation) {
20
+ this.capabilities.set(runtimeCapabilityId(key), implementation);
21
+ return this;
22
+ }
23
+ has(key) {
24
+ var _this_parent;
25
+ return this.capabilities.has(runtimeCapabilityId(key)) || ((_this_parent = this.parent) == null ? void 0 : _this_parent.get(key)) !== undefined;
26
+ }
27
+ get(key) {
28
+ var _this_parent;
29
+ const id = runtimeCapabilityId(key);
30
+ return this.capabilities.has(id) ? this.capabilities.get(id) : (_this_parent = this.parent) == null ? void 0 : _this_parent.get(key);
31
+ }
32
+ require(key) {
33
+ const implementation = this.get(key);
34
+ if (!implementation) {
35
+ throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
36
+ }
37
+ return implementation;
38
+ }
39
+ constructor(entries = [], parent){
40
+ this.capabilities = new Map();
41
+ this.parent = parent;
42
+ entries.forEach(([key, implementation])=>this.register(key, implementation));
43
+ }
44
+ }
45
+ function runtimeCapabilityId(key) {
46
+ return typeof key === 'string' ? key : key.id;
47
+ }
48
+
9
49
  /**
10
50
  * Base ability for all toolsets
11
51
  */ class BaseToolset extends tools.BaseToolkit {
@@ -147,68 +187,6 @@ class BuiltinToolset extends BaseToolset {
147
187
  }
148
188
  BuiltinToolset.provider = '';
149
189
 
150
- function createRuntimeCapability(id, options = {}) {
151
- return Object.freeze({
152
- id,
153
- description: options.description
154
- });
155
- }
156
- const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
157
- /** Metadata key under which RuntimeCapabilityProviderExplorer discovers capability providers. */ const RUNTIME_CAPABILITY_PROVIDER = 'XPERT_RUNTIME_CAPABILITY_PROVIDER';
158
- /** Tags a Nest provider as the platform implementation of a runtime capability. */ const RuntimeCapabilityProvider = (capability)=>common.SetMetadata(RUNTIME_CAPABILITY_PROVIDER, capability);
159
- class DefaultRuntimeCapabilityRegistry {
160
- register(key, implementation) {
161
- this.capabilities.set(runtimeCapabilityId(key), implementation);
162
- return this;
163
- }
164
- has(key) {
165
- var _this_parent;
166
- return this.capabilities.has(runtimeCapabilityId(key)) || ((_this_parent = this.parent) == null ? void 0 : _this_parent.get(key)) !== undefined;
167
- }
168
- get(key) {
169
- var _this_parent;
170
- const id = runtimeCapabilityId(key);
171
- return this.capabilities.has(id) ? this.capabilities.get(id) : (_this_parent = this.parent) == null ? void 0 : _this_parent.get(key);
172
- }
173
- require(key) {
174
- const implementation = this.get(key);
175
- if (!implementation) {
176
- throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
177
- }
178
- return implementation;
179
- }
180
- constructor(entries = [], parent){
181
- this.capabilities = new Map();
182
- this.parent = parent;
183
- entries.forEach(([key, implementation])=>this.register(key, implementation));
184
- }
185
- }
186
- function runtimeCapabilityId(key) {
187
- return typeof key === 'string' ? key : key.id;
188
- }
189
-
190
- const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
191
- description: 'List, search, and write chunks in platform knowledgebases.'
192
- });
193
- const KnowledgebaseProvisioningRuntimeCapability = createRuntimeCapability('platform.knowledgebase.provisioning', {
194
- description: 'Idempotently provision managed platform knowledgebases and connect them to an Agent.'
195
- });
196
-
197
- const KnowledgeGraphRuntimeCapability = createRuntimeCapability('platform.knowledge-graph', {
198
- description: 'Publish, inspect, and retract source-owned structured knowledge graphs without model extraction.'
199
- });
200
-
201
- const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
202
- description: 'Upload, import, create, process, reprocess, inspect, and delete persistent knowledgebase documents.'
203
- });
204
-
205
- const KnowledgeDocumentVisualAssetsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.visual-assets', {
206
- description: 'Issue execution-scoped logical KnowledgeDocument image paths and inject validated images without exposing host storage paths.'
207
- });
208
- const KnowledgeDocumentVisualAssetsRuntimeFactoryCapability = createRuntimeCapability('platform.knowledge-document.visual-assets.factory', {
209
- description: 'Create a visual-assets API with an execution-local image allow-list and authorized workspace writer.'
210
- });
211
-
212
190
  const ActorTokenRuntimeCapability = createRuntimeCapability('platform.actor-token', {
213
191
  description: 'Mint a short-lived host-issued actor bearer token for outbound API calls.'
214
192
  });
@@ -397,12 +375,6 @@ exports.BaseTool = BaseTool;
397
375
  exports.BaseToolset = BaseToolset;
398
376
  exports.BuiltinToolset = BuiltinToolset;
399
377
  exports.DefaultRuntimeCapabilityRegistry = DefaultRuntimeCapabilityRegistry;
400
- exports.KnowledgeDocumentVisualAssetsRuntimeCapability = KnowledgeDocumentVisualAssetsRuntimeCapability;
401
- exports.KnowledgeDocumentVisualAssetsRuntimeFactoryCapability = KnowledgeDocumentVisualAssetsRuntimeFactoryCapability;
402
- exports.KnowledgeGraphRuntimeCapability = KnowledgeGraphRuntimeCapability;
403
- exports.KnowledgebaseDocumentsRuntimeCapability = KnowledgebaseDocumentsRuntimeCapability;
404
- exports.KnowledgebaseProvisioningRuntimeCapability = KnowledgebaseProvisioningRuntimeCapability;
405
- exports.KnowledgebaseRuntimeCapability = KnowledgebaseRuntimeCapability;
406
378
  exports.ModelProviderBuiltinToolset = ModelProviderBuiltinToolset;
407
379
  exports.ProjectAccessRuntimeCapability = ProjectAccessRuntimeCapability;
408
380
  exports.ProjectProvisioningRuntimeCapability = ProjectProvisioningRuntimeCapability;
@@ -1,9 +1,49 @@
1
1
  import { _ as _extends } from './_extends.esm.js';
2
2
  import { AiModelTypeEnum } from '@xpert-ai/contracts';
3
- import { Logger, SetMetadata } from '@nestjs/common';
3
+ import { SetMetadata, Logger } from '@nestjs/common';
4
4
  import { BaseToolkit, StructuredTool } from '@langchain/core/tools';
5
5
  import { z } from 'zod/v3';
6
6
 
7
+ function createRuntimeCapability(id, options = {}) {
8
+ return Object.freeze({
9
+ id,
10
+ description: options.description
11
+ });
12
+ }
13
+ const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
14
+ /** Metadata key under which RuntimeCapabilityProviderExplorer discovers capability providers. */ const RUNTIME_CAPABILITY_PROVIDER = 'XPERT_RUNTIME_CAPABILITY_PROVIDER';
15
+ /** Tags a Nest provider as the platform implementation of a runtime capability. */ const RuntimeCapabilityProvider = (capability)=>SetMetadata(RUNTIME_CAPABILITY_PROVIDER, capability);
16
+ class DefaultRuntimeCapabilityRegistry {
17
+ register(key, implementation) {
18
+ this.capabilities.set(runtimeCapabilityId(key), implementation);
19
+ return this;
20
+ }
21
+ has(key) {
22
+ var _this_parent;
23
+ return this.capabilities.has(runtimeCapabilityId(key)) || ((_this_parent = this.parent) == null ? void 0 : _this_parent.get(key)) !== undefined;
24
+ }
25
+ get(key) {
26
+ var _this_parent;
27
+ const id = runtimeCapabilityId(key);
28
+ return this.capabilities.has(id) ? this.capabilities.get(id) : (_this_parent = this.parent) == null ? void 0 : _this_parent.get(key);
29
+ }
30
+ require(key) {
31
+ const implementation = this.get(key);
32
+ if (!implementation) {
33
+ throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
34
+ }
35
+ return implementation;
36
+ }
37
+ constructor(entries = [], parent){
38
+ this.capabilities = new Map();
39
+ this.parent = parent;
40
+ entries.forEach(([key, implementation])=>this.register(key, implementation));
41
+ }
42
+ }
43
+ function runtimeCapabilityId(key) {
44
+ return typeof key === 'string' ? key : key.id;
45
+ }
46
+
7
47
  /**
8
48
  * Base ability for all toolsets
9
49
  */ class BaseToolset extends BaseToolkit {
@@ -145,68 +185,6 @@ class BuiltinToolset extends BaseToolset {
145
185
  }
146
186
  BuiltinToolset.provider = '';
147
187
 
148
- function createRuntimeCapability(id, options = {}) {
149
- return Object.freeze({
150
- id,
151
- description: options.description
152
- });
153
- }
154
- const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
155
- /** Metadata key under which RuntimeCapabilityProviderExplorer discovers capability providers. */ const RUNTIME_CAPABILITY_PROVIDER = 'XPERT_RUNTIME_CAPABILITY_PROVIDER';
156
- /** Tags a Nest provider as the platform implementation of a runtime capability. */ const RuntimeCapabilityProvider = (capability)=>SetMetadata(RUNTIME_CAPABILITY_PROVIDER, capability);
157
- class DefaultRuntimeCapabilityRegistry {
158
- register(key, implementation) {
159
- this.capabilities.set(runtimeCapabilityId(key), implementation);
160
- return this;
161
- }
162
- has(key) {
163
- var _this_parent;
164
- return this.capabilities.has(runtimeCapabilityId(key)) || ((_this_parent = this.parent) == null ? void 0 : _this_parent.get(key)) !== undefined;
165
- }
166
- get(key) {
167
- var _this_parent;
168
- const id = runtimeCapabilityId(key);
169
- return this.capabilities.has(id) ? this.capabilities.get(id) : (_this_parent = this.parent) == null ? void 0 : _this_parent.get(key);
170
- }
171
- require(key) {
172
- const implementation = this.get(key);
173
- if (!implementation) {
174
- throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
175
- }
176
- return implementation;
177
- }
178
- constructor(entries = [], parent){
179
- this.capabilities = new Map();
180
- this.parent = parent;
181
- entries.forEach(([key, implementation])=>this.register(key, implementation));
182
- }
183
- }
184
- function runtimeCapabilityId(key) {
185
- return typeof key === 'string' ? key : key.id;
186
- }
187
-
188
- const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
189
- description: 'List, search, and write chunks in platform knowledgebases.'
190
- });
191
- const KnowledgebaseProvisioningRuntimeCapability = createRuntimeCapability('platform.knowledgebase.provisioning', {
192
- description: 'Idempotently provision managed platform knowledgebases and connect them to an Agent.'
193
- });
194
-
195
- const KnowledgeGraphRuntimeCapability = createRuntimeCapability('platform.knowledge-graph', {
196
- description: 'Publish, inspect, and retract source-owned structured knowledge graphs without model extraction.'
197
- });
198
-
199
- const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
200
- description: 'Upload, import, create, process, reprocess, inspect, and delete persistent knowledgebase documents.'
201
- });
202
-
203
- const KnowledgeDocumentVisualAssetsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.visual-assets', {
204
- description: 'Issue execution-scoped logical KnowledgeDocument image paths and inject validated images without exposing host storage paths.'
205
- });
206
- const KnowledgeDocumentVisualAssetsRuntimeFactoryCapability = createRuntimeCapability('platform.knowledge-document.visual-assets.factory', {
207
- description: 'Create a visual-assets API with an execution-local image allow-list and authorized workspace writer.'
208
- });
209
-
210
188
  const ActorTokenRuntimeCapability = createRuntimeCapability('platform.actor-token', {
211
189
  description: 'Mint a short-lived host-issued actor bearer token for outbound API calls.'
212
190
  });
@@ -388,4 +366,4 @@ function normalizeWorkspaceScope(scope) {
388
366
  } : {});
389
367
  }
390
368
 
391
- export { ActorTokenRuntimeCapability as A, BuiltinToolset as B, DefaultRuntimeCapabilityRegistry as D, KnowledgeDocumentVisualAssetsRuntimeCapability as K, ModelProviderBuiltinToolset as M, ProjectAccessRuntimeCapability as P, RUNTIME_CAPABILITY_PROVIDER as R, SANDBOX_JOB_ERROR_CODES as S, ToolImagesRuntimeCapability as T, WorkspaceFilesRuntimeCapability as W, XPERT_RUNTIME_CAPABILITIES_TOKEN as X, ActorTokenRuntimeFactoryCapability as a, ArtifactsRuntimeCapability as b, createRuntimeCapability as c, BaseTool as d, BaseToolset as e, KnowledgeDocumentVisualAssetsRuntimeFactoryCapability as f, KnowledgeGraphRuntimeCapability as g, KnowledgebaseDocumentsRuntimeCapability as h, KnowledgebaseProvisioningRuntimeCapability as i, KnowledgebaseRuntimeCapability as j, ProjectProvisioningRuntimeCapability as k, RuntimeCapabilityProvider as l, SANDBOX_JOB_PROGRESS_PREFIX as m, SandboxJobRuntimeError as n, SandboxJobsRuntimeCapability as o, WORKSPACE_FILES_SOURCE as p, isSandboxJobRuntimeError as q };
369
+ export { ActorTokenRuntimeCapability as A, BuiltinToolset as B, DefaultRuntimeCapabilityRegistry as D, ModelProviderBuiltinToolset as M, ProjectAccessRuntimeCapability as P, RUNTIME_CAPABILITY_PROVIDER as R, SANDBOX_JOB_ERROR_CODES as S, ToolImagesRuntimeCapability as T, WorkspaceFilesRuntimeCapability as W, XPERT_RUNTIME_CAPABILITIES_TOKEN as X, ActorTokenRuntimeFactoryCapability as a, ArtifactsRuntimeCapability as b, createRuntimeCapability as c, BaseTool as d, BaseToolset as e, ProjectProvisioningRuntimeCapability as f, RuntimeCapabilityProvider as g, SANDBOX_JOB_PROGRESS_PREFIX as h, SandboxJobRuntimeError as i, SandboxJobsRuntimeCapability as j, WORKSPACE_FILES_SOURCE as k, isSandboxJobRuntimeError as l };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/plugin-sdk",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "dependencies": {
64
64
  "@langchain/openai": "0.6.9",
65
- "@xpert-ai/contracts": "3.20.0",
65
+ "@xpert-ai/contracts": "3.21.0",
66
66
  "express": "^4.22.1",
67
67
  "js-tiktoken": "^1.0.21"
68
68
  },
package/src/index.d.ts CHANGED
@@ -32,3 +32,4 @@ export * from './lib/mcp/index';
32
32
  export * from './lib/tool-provider/index';
33
33
  export * from './lib/project-type/index';
34
34
  export * from './lib/project-task/index';
35
+ export * from './lib/agent-plugin/import-default-agent-plugins.command';
@@ -3,6 +3,8 @@ export declare const AGENT_CHAT_DISPATCH_MESSAGE_TYPE: import("./message-type").
3
3
  export declare const AGENT_CHAT_DISPATCH_ERROR_STEER_TARGET_NOT_RUNNING = "steer_target_not_running";
4
4
  export interface AgentChatHandoffMessageCallbackTarget {
5
5
  transport?: 'handoff-message';
6
+ /** Defaults to all events; lifecycle emits only terminal callbacks, leaving tokens in the run stream. */
7
+ events?: 'all' | 'lifecycle';
6
8
  messageType: string;
7
9
  headers?: Record<string, string>;
8
10
  context?: Record<string, unknown>;
@@ -16,6 +18,8 @@ export type AgentChatRuntimePrincipal = TChatRuntimePrincipal;
16
18
  export interface AgentChatDispatchPayload extends Record<string, unknown> {
17
19
  request: TChatRequest;
18
20
  options: TChatOptions & TChatSourceAuditOptions & {
21
+ /** Host-created group recipient receipt; the runtime must reauthorize it before execution. */
22
+ groupDeliveryId?: string;
19
23
  /** Host-resolved runtime branch, independent of the conversation root. */
20
24
  threadId?: string;
21
25
  isDerivedThread?: boolean;
@@ -0,0 +1,6 @@
1
+ import { Command } from '@nestjs/cqrs';
2
+ import type { DefaultAgentPluginsImportResult } from '@xpert-ai/contracts';
3
+ /** Import official resource packages for the authenticated organization administrator. Does not authorize workspaces. */
4
+ export declare class ImportDefaultAgentPluginsCommand extends Command<DefaultAgentPluginsImportResult> {
5
+ static readonly type = "[Agent Plugins] Import defaults";
6
+ }
@@ -10,6 +10,7 @@ export declare class RequestContext {
10
10
  readonly extras: Record<string, any>;
11
11
  constructor(request: IncomingMessage, response: ServerResponse, reqId: string, userId?: string, extras?: Record<string, any>);
12
12
  static currentRequestContext(): RequestContext;
13
+ /** @deprecated For resource authorization use currentApiPrincipal()?.resourceScope; retained for credential metadata. */
13
14
  static currentApiKey(): IApiKey | null;
14
15
  static currentApiPrincipal(): IApiPrincipal | null;
15
16
  static currentRequest(): IncomingMessage;
@@ -0,0 +1,5 @@
1
+ export * from './knowledgebase';
2
+ export * from './knowledge-graph';
3
+ export * from './knowledgebase-documents';
4
+ export * from './knowledge-upload-sessions';
5
+ export * from './knowledge-document-visual-assets';
@@ -1,5 +1,5 @@
1
- import type { RuntimeIdentityScope } from '../runtime-scope';
2
- import type { WorkspaceFilesApi, WorkspacePortableFileReference } from './workspace-files';
1
+ import type { RuntimeIdentityScope } from '../../runtime/runtime-scope';
2
+ import type { WorkspaceFilesApi, WorkspacePortableFileReference } from '../../runtime/capabilities/workspace-files';
3
3
  export type KnowledgeDocumentVisualCandidateReason = 'same_block' | 'same_chunk' | 'same_page' | 'adjacent_page' | 'visual_summary_match' | 'visual_only_fallback';
4
4
  export type KnowledgeDocumentVisualTextAnchor = {
5
5
  page?: number;
@@ -0,0 +1,71 @@
1
+ /** Persisted upload progress within one knowledgebase; completion does not imply document import or processing. */
2
+ export type KnowledgeUploadSession = {
3
+ /** Host-generated session UUID, used together with the owning knowledgebaseId. */
4
+ id: string;
5
+ /** Display file name; not a storage path. */
6
+ name: string;
7
+ /** Expected total file size in bytes. */
8
+ size: number;
9
+ /** Host-selected part size in bytes; only the final part may be shorter. */
10
+ chunkSize: number;
11
+ /** Persisted zero-based part indexes, sorted in ascending order; gaps identify missing parts. */
12
+ received: number[];
13
+ /** Lowercase hexadecimal SHA-256 of each received part, keyed by its decimal index. */
14
+ partHashes: Record<string, string>;
15
+ /** True after complete() verifies all expected parts and records the whole-file hash. */
16
+ complete: boolean;
17
+ /** Lowercase hexadecimal SHA-256 of the whole file, available after successful completion. */
18
+ sha256?: string;
19
+ };
20
+ /** Server-only staged uploads exposed through Documents.uploads. Every operation revalidates Knowledge write access. */
21
+ export interface KnowledgeUploadSessionsApi {
22
+ /**
23
+ * Create a new upload session without creating or processing a document.
24
+ * size is the total byte count (positive, currently at most 2 GiB); use the returned chunkSize for part boundaries.
25
+ */
26
+ create(input: {
27
+ knowledgebaseId: string;
28
+ name: string;
29
+ size: number;
30
+ }): Promise<KnowledgeUploadSession>;
31
+ /** Read persisted progress and part hashes to resume an existing session, including after a server restart. */
32
+ status(input: {
33
+ knowledgebaseId: string;
34
+ sessionId: string;
35
+ }): Promise<KnowledgeUploadSession>;
36
+ /**
37
+ * Persist one zero-based part; parts may arrive out of order.
38
+ * buffer must match the expected part length and sha256 must be its lowercase hexadecimal SHA-256.
39
+ * Retrying identical bytes is safe; conflicting bytes for an existing index are rejected.
40
+ */
41
+ append(input: {
42
+ knowledgebaseId: string;
43
+ sessionId: string;
44
+ index: number;
45
+ buffer: Buffer;
46
+ sha256: string;
47
+ }): Promise<void>;
48
+ /**
49
+ * Verify all parts and their lengths, then record the whole-file SHA-256 and mark the session complete.
50
+ * Incomplete uploads fail; repeated completion is safe. Does not import documents or start processing.
51
+ */
52
+ complete(input: {
53
+ knowledgebaseId: string;
54
+ sessionId: string;
55
+ }): Promise<KnowledgeUploadSession>;
56
+ /**
57
+ * Read bytes from a completed upload, including ranges that cross part boundaries, for streaming ZIP readers.
58
+ * offset is zero-based; length is nonnegative, at most chunkSize, and offset + length must not exceed size.
59
+ */
60
+ read(input: {
61
+ knowledgebaseId: string;
62
+ sessionId: string;
63
+ offset: number;
64
+ length: number;
65
+ }): Promise<Buffer>;
66
+ /** Delete an existing session and its staged bytes; previously imported documents are unaffected. */
67
+ remove(input: {
68
+ knowledgebaseId: string;
69
+ sessionId: string;
70
+ }): Promise<void>;
71
+ }
@@ -1,5 +1,6 @@
1
1
  import { type I18nObject, type DocumentTextParserConfig, type DocumentSheetParserConfig, JSONValue } from '@xpert-ai/contracts';
2
- import type { WorkspacePortableFileReference } from './workspace-files';
2
+ import type { WorkspacePortableFileReference } from '../../runtime/capabilities/workspace-files';
3
+ import type { KnowledgeUploadSessionsApi } from './knowledge-upload-sessions';
3
4
  export type KnowledgebaseDocumentFile = {
4
5
  buffer: Buffer;
5
6
  originalname?: string;
@@ -60,6 +61,9 @@ export type KnowledgebaseListDocumentsInput = {
60
61
  page?: number;
61
62
  pageSize?: number;
62
63
  search?: string;
64
+ /** Literal substring search; paths include the logical folder and imported originalRelativePath. */
65
+ searchFields?: Array<'name' | 'path'>;
66
+ mimeTypes?: string[];
63
67
  includeFolders?: boolean;
64
68
  /** List direct children of this folder. Use null for the knowledgebase root. */
65
69
  parentId?: string | null;
@@ -110,6 +114,8 @@ export type KnowledgebaseUploadedFile = {
110
114
  };
111
115
  export type KnowledgebaseCreateDocumentsInput = {
112
116
  knowledgebaseId: string;
117
+ /** Retry key, scoped to this Knowledge base. Repeated creation returns the original documents. */
118
+ idempotencyKey?: string;
113
119
  documents: KnowledgebaseDocumentDraft[];
114
120
  parserConfig?: KnowledgebaseDocumentParserConfig;
115
121
  metadata?: KnowledgebaseDocumentMetadata;
@@ -266,6 +272,8 @@ export type KnowledgebaseProcessingOptionsResult = {
266
272
  parserConfig: DocumentTextParserConfig & Partial<DocumentSheetParserConfig>;
267
273
  };
268
274
  export interface KnowledgebaseDocumentsApi {
275
+ /** Stage resumable uploads without starting document processing. */
276
+ readonly uploads: KnowledgeUploadSessionsApi;
269
277
  getProcessingOptions(input: KnowledgebaseProcessingOptionsInput): Promise<KnowledgebaseProcessingOptionsResult>;
270
278
  readText(input: KnowledgebaseReadTextInput): Promise<KnowledgebaseReadTextResult>;
271
279
  /** Missing/stale conversion snapshots fail explicitly; this never falls back to indexed chunks. */
@@ -31,6 +31,8 @@ export type KnowledgebaseSearchResult = {
31
31
  diagnostics: KnowledgeFilterDiagnostics[];
32
32
  };
33
33
  export type KnowledgebaseListInput = {
34
+ /** Tenant-owned public libraries, readable by tenant members. */
35
+ scope?: 'workspace' | 'tenant';
34
36
  workspaceId?: string | null;
35
37
  published?: boolean;
36
38
  limit?: number;
@@ -135,6 +137,8 @@ export type KnowledgebaseProvisioningSpec = {
135
137
  };
136
138
  };
137
139
  export type KnowledgebaseEnsureInput = {
140
+ /** Tenant provisioning requires SUPER_ADMIN already in tenant request scope; workspaceId supplies model discovery only. */
141
+ scope?: 'workspace' | 'tenant';
138
142
  workspaceId: string;
139
143
  namespace: string;
140
144
  /**
@@ -6,3 +6,4 @@ export * from './types';
6
6
  export * from './image/index';
7
7
  export * from './knowledge/index';
8
8
  export * from './analyzer/index';
9
+ export * from './capability/index';
@@ -1,7 +1,3 @@
1
- export * from './knowledgebase';
2
- export * from './knowledge-graph';
3
- export * from './knowledgebase-documents';
4
- export * from './knowledge-document-visual-assets';
5
1
  export * from './actor-token';
6
2
  export * from './artifacts';
7
3
  export * from './workspace-files';
@@ -253,9 +253,13 @@ export interface WorkspaceFilesApi {
253
253
  * file without reading its bytes into the API process.
254
254
  */
255
255
  resolveFile(input: WorkspaceFileReference): Promise<WorkspaceFile>;
256
- /** Read raw bytes from an explicitly scoped workspace file reference. */
256
+ /**
257
+ * Read raw bytes from an explicitly scoped workspace file reference.
258
+ * Missing paths or an uninitialized volume root reject with `error.code === 'ENOENT'`
259
+ * in-process; other validation/access failures must not be treated as missing files.
260
+ */
257
261
  readBuffer(input: WorkspaceFileReference): Promise<WorkspaceFileBuffer>;
258
- /** Delete an explicitly scoped workspace file. */
262
+ /** Delete an explicitly scoped workspace file; missing paths/roots reject with code ENOENT in-process. */
259
263
  deleteFile(input: WorkspaceFileReference): Promise<void>;
260
264
  /**
261
265
  * Normalize a runtime locator into a portable, scope-aware reference without
@@ -267,6 +271,8 @@ export interface WorkspaceFilesApi {
267
271
  *
268
272
  * This is the preferred API for plugin tools that receive `/workspace/...`
269
273
  * paths from sandbox commands.
274
+ * After resolving the locator, missing paths/roots reject with code ENOENT in-process.
275
+ * Callers must not infer missing files from localized validation or access errors.
270
276
  */
271
277
  readRuntimeBuffer(input: WorkspaceFileLocator): Promise<WorkspaceRuntimeFileBuffer>;
272
278
  /**