@xpert-ai/plugin-sdk 3.11.2 → 3.12.1

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,24 @@
1
1
  # @xpert-ai/plugin-sdk
2
2
 
3
+ ## 3.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 6a17eca: plugin sdk and mcp toolset close
8
+ - Updated dependencies [6a17eca]
9
+ - @xpert-ai/contracts@3.12.1
10
+
11
+ ## 3.12.0
12
+
13
+ ### Minor Changes
14
+
15
+ - d017897: plugin integration guard
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [d017897]
20
+ - @xpert-ai/contracts@3.12.0
21
+
3
22
  ## 3.11.2
4
23
 
5
24
  ### Patch Changes
package/index.cjs.js CHANGED
@@ -132,6 +132,11 @@ function __decorate(decorators, target, key, desc) {
132
132
  else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
133
133
  return c > 3 && r && Object.defineProperty(target, key, r), r;
134
134
  }
135
+ function __param(paramIndex, decorator) {
136
+ return function(target, key) {
137
+ decorator(target, key, paramIndex);
138
+ };
139
+ }
135
140
  function __metadata(metadataKey, metadataValue) {
136
141
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
137
142
  }
@@ -1123,6 +1128,13 @@ function getRequiredPermissionOperation(method, permissionType) {
1123
1128
  * System token for resolving user permission service from plugin context.
1124
1129
  */ const USER_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_USER_PERMISSION_SERVICE';
1125
1130
 
1131
+ /**
1132
+ * System token for resolving speech-to-text service from plugin context.
1133
+ */ const SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_SPEECH_TO_TEXT_PERMISSION_SERVICE';
1134
+ /**
1135
+ * Internal system token used by core to expose the speech-to-text bridge.
1136
+ */ const SPEECH_TO_TEXT_SERVICE_TOKEN = 'XPERT_SPEECH_TO_TEXT_SERVICE';
1137
+
1126
1138
  async function createI18nInstance(pluginDir, language) {
1127
1139
  const instance = i18next.createInstance();
1128
1140
  const i18nDir = path.join(pluginDir, 'i18n');
@@ -1225,6 +1237,103 @@ class JsonSchemaValidator {
1225
1237
  }
1226
1238
  }
1227
1239
 
1240
+ const PLUGIN_WEBHOOK_AUTH_METADATA_KEY = 'xpert:plugin:webhook-auth';
1241
+ const PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN = 'XPERT_PLUGIN_WEBHOOK_AUTH_SERVICE';
1242
+ function PluginWebhookAuth(metadata = {}) {
1243
+ return common.SetMetadata(PLUGIN_WEBHOOK_AUTH_METADATA_KEY, _extends({
1244
+ integrationParam: 'id',
1245
+ secretQueryParam: 'secret'
1246
+ }, metadata));
1247
+ }
1248
+ exports.PluginWebhookAuthGuard = class PluginWebhookAuthGuard {
1249
+ async canActivate(context) {
1250
+ var _request_params, _request_query;
1251
+ const metadata = this.resolveMetadata(context);
1252
+ if (!metadata) {
1253
+ return true;
1254
+ }
1255
+ const request = context.switchToHttp().getRequest();
1256
+ const integrationParam = metadata.integrationParam || 'id';
1257
+ const secretQueryParam = metadata.secretQueryParam || 'secret';
1258
+ const integrationId = this.getString((_request_params = request.params) == null ? void 0 : _request_params[integrationParam]);
1259
+ const secret = this.getString((_request_query = request.query) == null ? void 0 : _request_query[secretQueryParam]);
1260
+ if (!integrationId || !secret) {
1261
+ throw new common.UnauthorizedException('Plugin webhook secret is required');
1262
+ }
1263
+ const authService = this.authService;
1264
+ if (!authService) {
1265
+ throw new common.UnauthorizedException('Plugin webhook auth service is not available');
1266
+ }
1267
+ const principalContext = await authService.validateWebhookSecret({
1268
+ integrationId,
1269
+ secret,
1270
+ provider: metadata.provider
1271
+ });
1272
+ if (!(principalContext == null ? void 0 : principalContext.user) || !principalContext.headers) {
1273
+ throw new common.UnauthorizedException('Plugin webhook secret is invalid');
1274
+ }
1275
+ request.user = principalContext.user;
1276
+ var _request_headers;
1277
+ request.headers = _extends({}, (_request_headers = request.headers) != null ? _request_headers : {}, principalContext.headers);
1278
+ return true;
1279
+ }
1280
+ resolveMetadata(context) {
1281
+ var _Reflect_getMetadata, _ref;
1282
+ return (_ref = (_Reflect_getMetadata = Reflect.getMetadata(PLUGIN_WEBHOOK_AUTH_METADATA_KEY, context.getHandler())) != null ? _Reflect_getMetadata : Reflect.getMetadata(PLUGIN_WEBHOOK_AUTH_METADATA_KEY, context.getClass())) != null ? _ref : null;
1283
+ }
1284
+ getString(value) {
1285
+ if (typeof value !== 'string') {
1286
+ return '';
1287
+ }
1288
+ return value.trim();
1289
+ }
1290
+ constructor(authService){
1291
+ this.authService = authService;
1292
+ }
1293
+ };
1294
+ exports.PluginWebhookAuthGuard = __decorate([
1295
+ common.Injectable(),
1296
+ __param(0, common.Optional()),
1297
+ __param(0, common.Inject(PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN)),
1298
+ __metadata("design:paramtypes", [
1299
+ Object
1300
+ ])
1301
+ ], exports.PluginWebhookAuthGuard);
1302
+
1303
+ function createRuntimeCapability(id, options = {}) {
1304
+ return Object.freeze({
1305
+ id,
1306
+ description: options.description
1307
+ });
1308
+ }
1309
+ const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
1310
+ class DefaultRuntimeCapabilityRegistry {
1311
+ register(key, implementation) {
1312
+ this.capabilities.set(runtimeCapabilityId(key), implementation);
1313
+ return this;
1314
+ }
1315
+ has(key) {
1316
+ return this.capabilities.has(runtimeCapabilityId(key));
1317
+ }
1318
+ get(key) {
1319
+ return this.capabilities.get(runtimeCapabilityId(key));
1320
+ }
1321
+ require(key) {
1322
+ const implementation = this.get(key);
1323
+ if (!implementation) {
1324
+ throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
1325
+ }
1326
+ return implementation;
1327
+ }
1328
+ constructor(entries = []){
1329
+ this.capabilities = new Map();
1330
+ entries.forEach(([key, implementation])=>this.register(key, implementation));
1331
+ }
1332
+ }
1333
+ function runtimeCapabilityId(key) {
1334
+ return typeof key === 'string' ? key : key.id;
1335
+ }
1336
+
1228
1337
  const DATASOURCE_STRATEGY = 'DATASOURCE_STRATEGY';
1229
1338
  const DataSourceStrategy = (provider)=>common.applyDecorators(common.SetMetadata(DATASOURCE_STRATEGY, provider), common.SetMetadata(STRATEGY_META_KEY, DATASOURCE_STRATEGY));
1230
1339
 
@@ -2600,6 +2709,18 @@ Reflect.defineMetadata(COMMAND_METADATA$1, {
2600
2709
  id: CreateModelClientCommand.type
2601
2710
  }, CreateModelClientCommand);
2602
2711
 
2712
+ const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
2713
+ description: 'List, search, and write chunks in platform knowledgebases.'
2714
+ });
2715
+
2716
+ const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
2717
+ description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2718
+ });
2719
+
2720
+ const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
2721
+ description: 'Upload, read, and delete raw files in Xpert workspace volumes.'
2722
+ });
2723
+
2603
2724
  const SKILL_SOURCE_PROVIDER = 'SKILL_SOURCE_PROVIDER';
2604
2725
  const SkillSourceProviderStrategy = (provider)=>common.applyDecorators(common.SetMetadata(SKILL_SOURCE_PROVIDER, provider), common.SetMetadata(STRATEGY_META_KEY, SKILL_SOURCE_PROVIDER));
2605
2726
 
@@ -2640,48 +2761,6 @@ exports.AgentMiddlewareRegistry = __decorate([
2640
2761
  "end"
2641
2762
  ];
2642
2763
 
2643
- function createRuntimeCapability(id, options = {}) {
2644
- return Object.freeze({
2645
- id,
2646
- description: options.description
2647
- });
2648
- }
2649
- const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
2650
- class DefaultAgentMiddlewareRuntimeCapabilityRegistry {
2651
- register(key, implementation) {
2652
- this.capabilities.set(runtimeCapabilityId(key), implementation);
2653
- return this;
2654
- }
2655
- has(key) {
2656
- return this.capabilities.has(runtimeCapabilityId(key));
2657
- }
2658
- get(key) {
2659
- return this.capabilities.get(runtimeCapabilityId(key));
2660
- }
2661
- require(key) {
2662
- const implementation = this.get(key);
2663
- if (!implementation) {
2664
- throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
2665
- }
2666
- return implementation;
2667
- }
2668
- constructor(entries = []){
2669
- this.capabilities = new Map();
2670
- entries.forEach(([key, implementation])=>this.register(key, implementation));
2671
- }
2672
- }
2673
- function runtimeCapabilityId(key) {
2674
- return typeof key === 'string' ? key : key.id;
2675
- }
2676
-
2677
- const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
2678
- description: 'List, search, and write chunks in platform knowledgebases.'
2679
- });
2680
-
2681
- const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
2682
- description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2683
- });
2684
-
2685
2764
  const AssistantTaskRuntimeCapability = createRuntimeCapability('platform.assistant_task', {
2686
2765
  description: 'Start asynchronous tasks on the current platform assistant.'
2687
2766
  });
@@ -4484,7 +4563,8 @@ exports.DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC = DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC;
4484
4563
  exports.DOCUMENT_SOURCE_STRATEGY = DOCUMENT_SOURCE_STRATEGY;
4485
4564
  exports.DOCUMENT_TRANSFORMER_STRATEGY = DOCUMENT_TRANSFORMER_STRATEGY;
4486
4565
  exports.DataSourceStrategy = DataSourceStrategy;
4487
- exports.DefaultAgentMiddlewareRuntimeCapabilityRegistry = DefaultAgentMiddlewareRuntimeCapabilityRegistry;
4566
+ exports.DefaultAgentMiddlewareRuntimeCapabilityRegistry = DefaultRuntimeCapabilityRegistry;
4567
+ exports.DefaultRuntimeCapabilityRegistry = DefaultRuntimeCapabilityRegistry;
4488
4568
  exports.DocumentSourceStrategy = DocumentSourceStrategy;
4489
4569
  exports.DocumentTransformerStrategy = DocumentTransformerStrategy;
4490
4570
  exports.FILE_STORAGE_PROVIDER = FILE_STORAGE_PROVIDER;
@@ -4516,12 +4596,15 @@ exports.PERMISSION_OPERATION_METADATA_KEY = PERMISSION_OPERATION_METADATA_KEY;
4516
4596
  exports.PLUGIN_CONFIG_RESOLVER_TOKEN = PLUGIN_CONFIG_RESOLVER_TOKEN;
4517
4597
  exports.PLUGIN_METADATA = PLUGIN_METADATA;
4518
4598
  exports.PLUGIN_METADATA_KEY = PLUGIN_METADATA_KEY;
4599
+ exports.PLUGIN_WEBHOOK_AUTH_METADATA_KEY = PLUGIN_WEBHOOK_AUTH_METADATA_KEY;
4600
+ exports.PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN = PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN;
4519
4601
  exports.PROVIDE_AI_MODEL_LLM = PROVIDE_AI_MODEL_LLM;
4520
4602
  exports.PROVIDE_AI_MODEL_MODERATION = PROVIDE_AI_MODEL_MODERATION;
4521
4603
  exports.PROVIDE_AI_MODEL_RERANK = PROVIDE_AI_MODEL_RERANK;
4522
4604
  exports.PROVIDE_AI_MODEL_SPEECH2TEXT = PROVIDE_AI_MODEL_SPEECH2TEXT;
4523
4605
  exports.PROVIDE_AI_MODEL_TEXT_EMBEDDING = PROVIDE_AI_MODEL_TEXT_EMBEDDING;
4524
4606
  exports.PROVIDE_AI_MODEL_TTS = PROVIDE_AI_MODEL_TTS;
4607
+ exports.PluginWebhookAuth = PluginWebhookAuth;
4525
4608
  exports.RETRIEVER_STRATEGY = RETRIEVER_STRATEGY;
4526
4609
  exports.RequestContext = RequestContext;
4527
4610
  exports.RequirePermissionOperation = RequirePermissionOperation;
@@ -4530,6 +4613,8 @@ exports.RetrieverStrategy = RetrieverStrategy;
4530
4613
  exports.SANDBOX_PROVIDER = SANDBOX_PROVIDER;
4531
4614
  exports.SANDBOX_SHELL_TIMEOUT_LIMITS_SEC = SANDBOX_SHELL_TIMEOUT_LIMITS_SEC;
4532
4615
  exports.SKILL_SOURCE_PROVIDER = SKILL_SOURCE_PROVIDER;
4616
+ exports.SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN = SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN;
4617
+ exports.SPEECH_TO_TEXT_SERVICE_TOKEN = SPEECH_TO_TEXT_SERVICE_TOKEN;
4533
4618
  exports.SSOProviderStrategyKey = SSOProviderStrategyKey;
4534
4619
  exports.SSO_BINDING_PERMISSION_SERVICE_TOKEN = SSO_BINDING_PERMISSION_SERVICE_TOKEN;
4535
4620
  exports.SSO_PROVIDER = SSO_PROVIDER;
@@ -4554,6 +4639,7 @@ exports.WORKFLOW_NODE_STRATEGY = WORKFLOW_NODE_STRATEGY;
4554
4639
  exports.WORKFLOW_TRIGGER_STRATEGY = WORKFLOW_TRIGGER_STRATEGY;
4555
4640
  exports.WorkflowNodeStrategy = WorkflowNodeStrategy;
4556
4641
  exports.WorkflowTriggerStrategy = WorkflowTriggerStrategy;
4642
+ exports.WorkspaceFilesRuntimeCapability = WorkspaceFilesRuntimeCapability;
4557
4643
  exports.WrapWorkflowNodeExecutionCommand = WrapWorkflowNodeExecutionCommand;
4558
4644
  exports.XPERT_RUNTIME_CAPABILITIES_TOKEN = XPERT_RUNTIME_CAPABILITIES_TOKEN;
4559
4645
  exports.XpFileSystem = XpFileSystem;
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Module, Logger, applyDecorators, SetMetadata, HttpException, HttpStatus, BadRequestException, Injectable, Inject, NotFoundException, ForbiddenException } from '@nestjs/common';
1
+ import { Module, Logger, applyDecorators, SetMetadata, HttpException, HttpStatus, BadRequestException, Injectable, Inject, Optional, UnauthorizedException, NotFoundException, ForbiddenException } from '@nestjs/common';
2
2
  import { MODULE_METADATA } from '@nestjs/common/constants';
3
3
  import { pick } from 'lodash-es';
4
4
  import { DiscoveryService, Reflector } from '@nestjs/core';
@@ -111,6 +111,11 @@ function __decorate(decorators, target, key, desc) {
111
111
  else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
112
112
  return c > 3 && r && Object.defineProperty(target, key, r), r;
113
113
  }
114
+ function __param(paramIndex, decorator) {
115
+ return function(target, key) {
116
+ decorator(target, key, paramIndex);
117
+ };
118
+ }
114
119
  function __metadata(metadataKey, metadataValue) {
115
120
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
116
121
  }
@@ -1102,6 +1107,13 @@ function getRequiredPermissionOperation(method, permissionType) {
1102
1107
  * System token for resolving user permission service from plugin context.
1103
1108
  */ const USER_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_USER_PERMISSION_SERVICE';
1104
1109
 
1110
+ /**
1111
+ * System token for resolving speech-to-text service from plugin context.
1112
+ */ const SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN = 'XPERT_PLUGIN_SPEECH_TO_TEXT_PERMISSION_SERVICE';
1113
+ /**
1114
+ * Internal system token used by core to expose the speech-to-text bridge.
1115
+ */ const SPEECH_TO_TEXT_SERVICE_TOKEN = 'XPERT_SPEECH_TO_TEXT_SERVICE';
1116
+
1105
1117
  async function createI18nInstance(pluginDir, language) {
1106
1118
  const instance = createInstance();
1107
1119
  const i18nDir = path__default.join(pluginDir, 'i18n');
@@ -1204,6 +1216,103 @@ class JsonSchemaValidator {
1204
1216
  }
1205
1217
  }
1206
1218
 
1219
+ const PLUGIN_WEBHOOK_AUTH_METADATA_KEY = 'xpert:plugin:webhook-auth';
1220
+ const PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN = 'XPERT_PLUGIN_WEBHOOK_AUTH_SERVICE';
1221
+ function PluginWebhookAuth(metadata = {}) {
1222
+ return SetMetadata(PLUGIN_WEBHOOK_AUTH_METADATA_KEY, _extends({
1223
+ integrationParam: 'id',
1224
+ secretQueryParam: 'secret'
1225
+ }, metadata));
1226
+ }
1227
+ let PluginWebhookAuthGuard = class PluginWebhookAuthGuard {
1228
+ async canActivate(context) {
1229
+ var _request_params, _request_query;
1230
+ const metadata = this.resolveMetadata(context);
1231
+ if (!metadata) {
1232
+ return true;
1233
+ }
1234
+ const request = context.switchToHttp().getRequest();
1235
+ const integrationParam = metadata.integrationParam || 'id';
1236
+ const secretQueryParam = metadata.secretQueryParam || 'secret';
1237
+ const integrationId = this.getString((_request_params = request.params) == null ? void 0 : _request_params[integrationParam]);
1238
+ const secret = this.getString((_request_query = request.query) == null ? void 0 : _request_query[secretQueryParam]);
1239
+ if (!integrationId || !secret) {
1240
+ throw new UnauthorizedException('Plugin webhook secret is required');
1241
+ }
1242
+ const authService = this.authService;
1243
+ if (!authService) {
1244
+ throw new UnauthorizedException('Plugin webhook auth service is not available');
1245
+ }
1246
+ const principalContext = await authService.validateWebhookSecret({
1247
+ integrationId,
1248
+ secret,
1249
+ provider: metadata.provider
1250
+ });
1251
+ if (!(principalContext == null ? void 0 : principalContext.user) || !principalContext.headers) {
1252
+ throw new UnauthorizedException('Plugin webhook secret is invalid');
1253
+ }
1254
+ request.user = principalContext.user;
1255
+ var _request_headers;
1256
+ request.headers = _extends({}, (_request_headers = request.headers) != null ? _request_headers : {}, principalContext.headers);
1257
+ return true;
1258
+ }
1259
+ resolveMetadata(context) {
1260
+ var _Reflect_getMetadata, _ref;
1261
+ return (_ref = (_Reflect_getMetadata = Reflect.getMetadata(PLUGIN_WEBHOOK_AUTH_METADATA_KEY, context.getHandler())) != null ? _Reflect_getMetadata : Reflect.getMetadata(PLUGIN_WEBHOOK_AUTH_METADATA_KEY, context.getClass())) != null ? _ref : null;
1262
+ }
1263
+ getString(value) {
1264
+ if (typeof value !== 'string') {
1265
+ return '';
1266
+ }
1267
+ return value.trim();
1268
+ }
1269
+ constructor(authService){
1270
+ this.authService = authService;
1271
+ }
1272
+ };
1273
+ PluginWebhookAuthGuard = __decorate([
1274
+ Injectable(),
1275
+ __param(0, Optional()),
1276
+ __param(0, Inject(PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN)),
1277
+ __metadata("design:paramtypes", [
1278
+ Object
1279
+ ])
1280
+ ], PluginWebhookAuthGuard);
1281
+
1282
+ function createRuntimeCapability(id, options = {}) {
1283
+ return Object.freeze({
1284
+ id,
1285
+ description: options.description
1286
+ });
1287
+ }
1288
+ const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
1289
+ class DefaultRuntimeCapabilityRegistry {
1290
+ register(key, implementation) {
1291
+ this.capabilities.set(runtimeCapabilityId(key), implementation);
1292
+ return this;
1293
+ }
1294
+ has(key) {
1295
+ return this.capabilities.has(runtimeCapabilityId(key));
1296
+ }
1297
+ get(key) {
1298
+ return this.capabilities.get(runtimeCapabilityId(key));
1299
+ }
1300
+ require(key) {
1301
+ const implementation = this.get(key);
1302
+ if (!implementation) {
1303
+ throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
1304
+ }
1305
+ return implementation;
1306
+ }
1307
+ constructor(entries = []){
1308
+ this.capabilities = new Map();
1309
+ entries.forEach(([key, implementation])=>this.register(key, implementation));
1310
+ }
1311
+ }
1312
+ function runtimeCapabilityId(key) {
1313
+ return typeof key === 'string' ? key : key.id;
1314
+ }
1315
+
1207
1316
  const DATASOURCE_STRATEGY = 'DATASOURCE_STRATEGY';
1208
1317
  const DataSourceStrategy = (provider)=>applyDecorators(SetMetadata(DATASOURCE_STRATEGY, provider), SetMetadata(STRATEGY_META_KEY, DATASOURCE_STRATEGY));
1209
1318
 
@@ -2579,6 +2688,18 @@ Reflect.defineMetadata(COMMAND_METADATA$1, {
2579
2688
  id: CreateModelClientCommand.type
2580
2689
  }, CreateModelClientCommand);
2581
2690
 
2691
+ const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
2692
+ description: 'List, search, and write chunks in platform knowledgebases.'
2693
+ });
2694
+
2695
+ const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
2696
+ description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2697
+ });
2698
+
2699
+ const WorkspaceFilesRuntimeCapability = createRuntimeCapability('platform.workspace.files', {
2700
+ description: 'Upload, read, and delete raw files in Xpert workspace volumes.'
2701
+ });
2702
+
2582
2703
  const SKILL_SOURCE_PROVIDER = 'SKILL_SOURCE_PROVIDER';
2583
2704
  const SkillSourceProviderStrategy = (provider)=>applyDecorators(SetMetadata(SKILL_SOURCE_PROVIDER, provider), SetMetadata(STRATEGY_META_KEY, SKILL_SOURCE_PROVIDER));
2584
2705
 
@@ -2619,48 +2740,6 @@ AgentMiddlewareRegistry = __decorate([
2619
2740
  "end"
2620
2741
  ];
2621
2742
 
2622
- function createRuntimeCapability(id, options = {}) {
2623
- return Object.freeze({
2624
- id,
2625
- description: options.description
2626
- });
2627
- }
2628
- const XPERT_RUNTIME_CAPABILITIES_TOKEN = 'XPERT_RUNTIME_CAPABILITIES';
2629
- class DefaultAgentMiddlewareRuntimeCapabilityRegistry {
2630
- register(key, implementation) {
2631
- this.capabilities.set(runtimeCapabilityId(key), implementation);
2632
- return this;
2633
- }
2634
- has(key) {
2635
- return this.capabilities.has(runtimeCapabilityId(key));
2636
- }
2637
- get(key) {
2638
- return this.capabilities.get(runtimeCapabilityId(key));
2639
- }
2640
- require(key) {
2641
- const implementation = this.get(key);
2642
- if (!implementation) {
2643
- throw new Error(`Runtime capability '${runtimeCapabilityId(key)}' is not available`);
2644
- }
2645
- return implementation;
2646
- }
2647
- constructor(entries = []){
2648
- this.capabilities = new Map();
2649
- entries.forEach(([key, implementation])=>this.register(key, implementation));
2650
- }
2651
- }
2652
- function runtimeCapabilityId(key) {
2653
- return typeof key === 'string' ? key : key.id;
2654
- }
2655
-
2656
- const KnowledgebaseRuntimeCapability = createRuntimeCapability('platform.knowledgebase', {
2657
- description: 'List, search, and write chunks in platform knowledgebases.'
2658
- });
2659
-
2660
- const KnowledgebaseDocumentsRuntimeCapability = createRuntimeCapability('platform.knowledgebase.documents', {
2661
- description: 'Upload, import, create, process, inspect, and delete persistent knowledgebase documents.'
2662
- });
2663
-
2664
2743
  const AssistantTaskRuntimeCapability = createRuntimeCapability('platform.assistant_task', {
2665
2744
  description: 'Start asynchronous tasks on the current platform assistant.'
2666
2745
  });
@@ -4420,4 +4499,4 @@ function escapeHtmlAttribute(value) {
4420
4499
 
4421
4500
  const VIEW_EXTENSION_CACHE_SERVICE_TOKEN = 'XPERT_PLUGIN_VIEW_EXTENSION_CACHE_SERVICE';
4422
4501
 
4423
- export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PERMISSION_SERVICE_TOKEN, AdapterDataSourceStrategy, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AiModelNotFoundException, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CommonParameterRules, CreateModelClientCommand, CredentialsValidateFailedError, DATASOURCE_STRATEGY, DBCreateTableMode, DBProtocolEnum, DBSyntaxEnum, DBTableAction, DBTableDataAction, DEFAULT_EXECUTION_CONFIG, DEFAULT_SANDBOX_EXECUTION_MAX_OUTPUT_BYTES, DEFAULT_SANDBOX_FILE_OPERATION_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_SEC, DEFAULT_SANDBOX_FILE_SEARCH_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_SEC, DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS, DEFAULT_SANDBOX_SHELL_TIMEOUT_MS, DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC, DOCUMENT_SOURCE_STRATEGY, DOCUMENT_TRANSFORMER_STRATEGY, DataSourceStrategy, DataSourceStrategyRegistry, DefaultAgentMiddlewareRuntimeCapabilityRegistry, DocumentSourceRegistry, DocumentSourceStrategy, DocumentTransformerRegistry, DocumentTransformerStrategy, FILE_STORAGE_PROVIDER, FILE_UPLOAD_TARGET_STRATEGY, FileRuntimeCapability, FileStorageProvider, FileStorageProviderRegistry, FileUploadTargetRegistry, FileUploadTargetStrategy, GLOBAL_ORGANIZATION_SCOPE, HANDOFF_PERMISSION_SERVICE_TOKEN, HANDOFF_PROCESSOR_STRATEGY, HANDOFF_QUEUE_SERVICE_TOKEN, HandoffProcessorRegistry, HandoffProcessorStrategy, IMAGE_UNDERSTANDING_STRATEGY, INTEGRATION_PERMISSION_SERVICE_TOKEN, INTEGRATION_STRATEGY, ImageUnderstandingRegistry, ImageUnderstandingStrategy, IntegrationStrategyKey, IntegrationStrategyRegistry, JUMP_TO_TARGETS, JsonSchemaValidator, KNOWLEDGE_STRATEGY, KnowledgeStrategyKey, KnowledgeStrategyRegistry, KnowledgebaseDocumentsRuntimeCapability, KnowledgebaseRuntimeCapability, LLMUsage, LargeLanguageModel, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, PLUGIN_METADATA, PLUGIN_METADATA_KEY, PROVIDE_AI_MODEL_LLM, PROVIDE_AI_MODEL_MODERATION, PROVIDE_AI_MODEL_RERANK, PROVIDE_AI_MODEL_SPEECH2TEXT, PROVIDE_AI_MODEL_TEXT_EMBEDDING, PROVIDE_AI_MODEL_TTS, RETRIEVER_STRATEGY, RequestContext, RequestContextMiddleware, RequirePermissionOperation, RerankModel, RetrieverRegistry, RetrieverStrategy, SANDBOX_PROVIDER, SANDBOX_SHELL_TIMEOUT_LIMITS_SEC, SKILL_SOURCE_PROVIDER, SSOProviderRegistry, SSOProviderStrategyKey, SSO_BINDING_PERMISSION_SERVICE_TOKEN, SSO_PROVIDER, STRATEGY_META_KEY, SandboxProviderRegistry, SandboxProviderStrategy, SkillSourceProviderRegistry, SkillSourceProviderStrategy, Speech2TextChatModel, SpeechToTextModel, StrategyBus, TEXT_SPLITTER_STRATEGY, TOOLSET_STRATEGY, TextEmbeddingModelManager, TextSplitterRegistry, TextSplitterStrategy, TextToSpeechModel, ToolsetRegistry, ToolsetStrategy, USER_PERMISSION_SERVICE_TOKEN, VECTOR_STORE_STRATEGY, VIEW_EXTENSION_CACHE_SERVICE_TOKEN, VIEW_EXTENSION_PROVIDER, VectorStoreRegistry, VectorStoreStrategy, ViewExtensionProvider, ViewExtensionProviderRegistry, WORKFLOW_NODE_STRATEGY, WORKFLOW_TRIGGER_STRATEGY, WorkflowNodeRegistry, WorkflowNodeStrategy, WorkflowTriggerRegistry, WorkflowTriggerStrategy, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, renderRemoteReactIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, runWithRequestContext, secondsToMilliseconds, sumTokenUsage };
4502
+ export { ACCOUNT_BINDING_PERMISSION_SERVICE_TOKEN, AGENT_CHAT_DISPATCH_MESSAGE_TYPE, AGENT_MIDDLEWARE_STRATEGY, AIModelProviderNotFoundException, AIModelProviderRegistry, AIModelProviderStrategy, AI_MODEL_PROVIDER, ANALYTICS_PERMISSION_SERVICE_TOKEN, AdapterDataSourceStrategy, AgentMiddlewareRegistry, AgentMiddlewareStrategy, AiModelNotFoundException, AssistantTaskRuntimeCapability, BOUND_IDENTITY_LOGIN_PERMISSION_SERVICE_TOKEN, BaseHTTPQueryRunner, BaseQueryRunner, BaseSQLQueryRunner, BaseSandbox, BaseStrategyRegistry, BaseTool, BaseToolset, BuiltinToolset, CHAT_CHANNEL, CHAT_CHANNEL_TEXT_LIMITS, CancelConversationCommand, ChatChannel, ChatChannelRegistry, ChatOAICompatReasoningModel, CommonParameterRules, CreateModelClientCommand, CredentialsValidateFailedError, DATASOURCE_STRATEGY, DBCreateTableMode, DBProtocolEnum, DBSyntaxEnum, DBTableAction, DBTableDataAction, DEFAULT_EXECUTION_CONFIG, DEFAULT_SANDBOX_EXECUTION_MAX_OUTPUT_BYTES, DEFAULT_SANDBOX_FILE_OPERATION_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_OPERATION_TIMEOUT_SEC, DEFAULT_SANDBOX_FILE_SEARCH_EXECUTION_OPTIONS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_MS, DEFAULT_SANDBOX_FILE_SEARCH_TIMEOUT_SEC, DEFAULT_SANDBOX_SHELL_EXECUTION_OPTIONS, DEFAULT_SANDBOX_SHELL_TIMEOUT_MS, DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC, DOCUMENT_SOURCE_STRATEGY, DOCUMENT_TRANSFORMER_STRATEGY, DataSourceStrategy, DataSourceStrategyRegistry, 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, ModelProvider, ORGANIZATION_METADATA_KEY, OpenAICompatibleReranker, PERMISSION_OPERATION_METADATA_KEY, PLUGIN_CONFIG_RESOLVER_TOKEN, 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, 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, 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, WorkspaceFilesRuntimeCapability, WrapWorkflowNodeExecutionCommand, XPERT_RUNTIME_CAPABILITIES_TOKEN, XpFileSystem, XpertServerPlugin, als, appendSandboxMessage, buildSandboxTimeoutMessage, calcTokenUsage, chunkText, countTokensSafe, createI18nInstance, createPluginLogger, createRuntimeCapability, defineAgentMessageType, defineChannelMessageType, downloadRemoteFile, formatSandboxTimeout, getErrorMessage, getModelContextSize, getPermissionOperationMetadata, getPositionList, getPositionMap, getRequestContext, getRequiredPermissionOperation, isRemoteFile, isSandboxBackend, isSandboxManagedServiceAdapter, isSandboxServiceProxyAdapter, isSandboxTerminalAdapter, isStructuredMessageType, loadYamlFile, mergeCredentials, mergeParentChildChunks, normalizeContextSize, renderRemoteReactIframeHtml, resolveSandboxBackend, resolveSandboxExecutionOptions, resolveSandboxManagedServiceAdapter, resolveSandboxServiceProxyAdapter, resolveSandboxTerminalAdapter, runWithRequestContext, secondsToMilliseconds, sumTokenUsage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/plugin-sdk",
3
- "version": "3.11.2",
3
+ "version": "3.12.1",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './lib/toolset/index';
11
11
  export * from './lib/core/index';
12
12
  export * from './lib/data/index';
13
13
  export * from './lib/ai-model/index';
14
+ export * from './lib/runtime/index';
14
15
  export * from './lib/agent/index';
15
16
  export * from './lib/channel/index';
16
17
  export * from './lib/file/index';
@@ -42,4 +42,4 @@ export interface AgentMiddlewareAssistantTaskApi {
42
42
  startTask(input: AgentMiddlewareAssistantTaskInput): Promise<AgentMiddlewareAssistantTaskResult>;
43
43
  getTaskStatus?(input: AgentMiddlewareAssistantTaskStatusInput): Promise<AgentMiddlewareAssistantTaskResult | null>;
44
44
  }
45
- export declare const AssistantTaskRuntimeCapability: import("../runtime-capability").RuntimeCapabilityKey<AgentMiddlewareAssistantTaskApi>;
45
+ export declare const AssistantTaskRuntimeCapability: import("../../../core/runtime-capability").RuntimeCapabilityKey<AgentMiddlewareAssistantTaskApi>;
@@ -26,4 +26,4 @@ export type AgentMiddlewareResolvedFile = {
26
26
  export interface AgentMiddlewareFileApi {
27
27
  resolveFile(input: AgentMiddlewareFileReference): Promise<AgentMiddlewareResolvedFile | null>;
28
28
  }
29
- export declare const FileRuntimeCapability: import("../runtime-capability").RuntimeCapabilityKey<AgentMiddlewareFileApi>;
29
+ export declare const FileRuntimeCapability: import("../../../core/runtime-capability").RuntimeCapabilityKey<AgentMiddlewareFileApi>;
@@ -1,4 +1,2 @@
1
- export * from './knowledgebase';
2
- export * from './knowledgebase-documents';
3
1
  export * from './assistant-task';
4
2
  export * from './file';
@@ -1,22 +1,2 @@
1
- export type RuntimeCapabilityKey<T> = {
2
- readonly id: string;
3
- readonly description?: string;
4
- readonly __type?: T;
5
- };
6
- export declare function createRuntimeCapability<T>(id: string, options?: {
7
- description?: string;
8
- }): RuntimeCapabilityKey<T>;
9
- export interface AgentMiddlewareRuntimeCapabilityRegistry {
10
- has<T>(key: RuntimeCapabilityKey<T> | string): boolean;
11
- get<T>(key: RuntimeCapabilityKey<T> | string): T | undefined;
12
- require<T>(key: RuntimeCapabilityKey<T> | string): T;
13
- }
14
- export declare const XPERT_RUNTIME_CAPABILITIES_TOKEN = "XPERT_RUNTIME_CAPABILITIES";
15
- export declare class DefaultAgentMiddlewareRuntimeCapabilityRegistry implements AgentMiddlewareRuntimeCapabilityRegistry {
16
- private readonly capabilities;
17
- constructor(entries?: Array<[RuntimeCapabilityKey<unknown> | string, unknown]>);
18
- register<T>(key: RuntimeCapabilityKey<T> | string, implementation: T): this;
19
- has<T>(key: RuntimeCapabilityKey<T> | string): boolean;
20
- get<T>(key: RuntimeCapabilityKey<T> | string): T | undefined;
21
- require<T>(key: RuntimeCapabilityKey<T> | string): T;
22
- }
1
+ export { createRuntimeCapability, DefaultRuntimeCapabilityRegistry, DefaultRuntimeCapabilityRegistry as DefaultAgentMiddlewareRuntimeCapabilityRegistry, XPERT_RUNTIME_CAPABILITIES_TOKEN } from '../../core/runtime-capability';
2
+ export type { RuntimeCapabilityKey, RuntimeCapabilityRegistry, RuntimeCapabilityRegistry as AgentMiddlewareRuntimeCapabilityRegistry } from '../../core/runtime-capability';
@@ -6,7 +6,7 @@ import type { BaseMessage } from '@langchain/core/messages';
6
6
  import { ICopilotModel, ILLMUsage, IXpertAgentExecution, JSONValue, TSandboxConfigurable } from '@xpert-ai/contracts';
7
7
  import { Subscriber } from 'rxjs';
8
8
  import { IRerank } from '../../ai-model/types';
9
- import type { AgentMiddlewareRuntimeCapabilityRegistry } from './runtime-capability';
9
+ import type { RuntimeCapabilityRegistry } from '../../core';
10
10
  export * from './runtime-capability';
11
11
  export * from './capabilities';
12
12
  /**
@@ -99,5 +99,5 @@ export interface AgentMiddlewareRuntimeApi {
99
99
  createModelClient<T = AgentMiddlewareModelClient>(copilotModel: ICopilotModel, options: AgentMiddlewareCreateModelClientOptions): Promise<T>;
100
100
  wrapWorkflowNodeExecution<T>(run: (execution: Partial<IXpertAgentExecution>) => Promise<AgentMiddlewareWrapWorkflowNodeExecutionResult<T>>, params: AgentMiddlewareWrapWorkflowNodeExecutionParams): Promise<T>;
101
101
  emitMiddlewareEvent?(event: AgentMiddlewareEvent): Promise<void> | void;
102
- capabilities?: AgentMiddlewareRuntimeCapabilityRegistry;
102
+ capabilities?: RuntimeCapabilityRegistry;
103
103
  }
@@ -7,3 +7,5 @@ export * from './utils';
7
7
  export * from './context/index';
8
8
  export * from './types';
9
9
  export * from './strategy-bus';
10
+ export * from './webhook';
11
+ export * from './runtime-capability';
@@ -1,4 +1,5 @@
1
1
  import type { IIntegration, IPagination } from '@xpert-ai/contracts';
2
+ import type { PluginWebhookCredentialResult } from '../webhook';
2
3
  /**
3
4
  * Base Permission type
4
5
  */
@@ -69,4 +70,14 @@ export declare const INTEGRATION_PERMISSION_SERVICE_TOKEN = "XPERT_PLUGIN_INTEGR
69
70
  export interface IntegrationPermissionService {
70
71
  read<TIntegration = IIntegration>(id: string, options?: Record<string, any>): Promise<TIntegration | null>;
71
72
  findAll<TIntegration = IIntegration>(options?: Record<string, any>): Promise<IPagination<TIntegration>>;
73
+ ensureWebhookCredential?(id: string, options?: {
74
+ provider?: string | null;
75
+ rotateIfRevoked?: boolean;
76
+ }): Promise<PluginWebhookCredentialResult | null>;
77
+ rotateWebhookCredential?(id: string, options?: {
78
+ provider?: string | null;
79
+ }): Promise<PluginWebhookCredentialResult | null>;
80
+ revokeWebhookCredential?(id: string, options?: {
81
+ provider?: string | null;
82
+ }): Promise<boolean>;
72
83
  }
@@ -14,17 +14,19 @@ export * from './auth-login';
14
14
  export * from './bound-identity-login';
15
15
  export * from './sso-binding';
16
16
  export * from './user';
17
+ export * from './speech-to-text';
17
18
  import type { FileSystemPermission, IntegrationPermission, KnowledgePermission, LLMPermission, VectorStorePermission } from './general';
18
19
  import type { AnalyticsPermission } from './analytics';
19
20
  import type { AccountBindingPermission } from './account-binding';
20
21
  import type { BoundIdentityLoginPermission } from './bound-identity-login';
21
22
  import type { HandoffPermission } from './handoff';
23
+ import type { SpeechToTextPermission } from './speech-to-text';
22
24
  import type { SsoBindingPermission } from './sso-binding';
23
25
  import type { UserPermission } from './user';
24
26
  /**
25
27
  * Union type for all permissions
26
28
  */
27
- export type Permission = LLMPermission | VectorStorePermission | KnowledgePermission | FileSystemPermission | IntegrationPermission | AnalyticsPermission | AccountBindingPermission | BoundIdentityLoginPermission | SsoBindingPermission | UserPermission | HandoffPermission;
29
+ export type Permission = LLMPermission | VectorStorePermission | KnowledgePermission | FileSystemPermission | IntegrationPermission | AnalyticsPermission | AccountBindingPermission | BoundIdentityLoginPermission | SsoBindingPermission | UserPermission | HandoffPermission | SpeechToTextPermission;
28
30
  /**
29
31
  * Permissions array type
30
32
  */
@@ -0,0 +1,41 @@
1
+ export type SpeechToTextPermissionOperation = 'transcribe';
2
+ /**
3
+ * Speech-to-text Permission
4
+ * Example: { type: 'speech_to_text', operations: ['transcribe'] }
5
+ */
6
+ export interface SpeechToTextPermission {
7
+ type: 'speech_to_text';
8
+ operations?: SpeechToTextPermissionOperation[];
9
+ scope?: string[];
10
+ description?: string;
11
+ }
12
+ /**
13
+ * System token for resolving speech-to-text service from plugin context.
14
+ */
15
+ export declare const SPEECH_TO_TEXT_PERMISSION_SERVICE_TOKEN = "XPERT_PLUGIN_SPEECH_TO_TEXT_PERMISSION_SERVICE";
16
+ /**
17
+ * Internal system token used by core to expose the speech-to-text bridge.
18
+ */
19
+ export declare const SPEECH_TO_TEXT_SERVICE_TOKEN = "XPERT_SPEECH_TO_TEXT_SERVICE";
20
+ export interface SpeechToTextTranscribeFileInput {
21
+ data: Uint8Array;
22
+ originalName: string;
23
+ mimeType?: string;
24
+ size?: number;
25
+ }
26
+ export interface SpeechToTextTranscribeInput {
27
+ xpertId: string;
28
+ isDraft?: boolean;
29
+ tenantId?: string | null;
30
+ organizationId?: string | null;
31
+ file: SpeechToTextTranscribeFileInput;
32
+ }
33
+ export interface SpeechToTextTranscribeResult {
34
+ text: string;
35
+ }
36
+ /**
37
+ * Speech-to-text service exposed to plugins under permission control.
38
+ */
39
+ export interface SpeechToTextPermissionService {
40
+ transcribe(input: SpeechToTextTranscribeInput): Promise<SpeechToTextTranscribeResult>;
41
+ }
@@ -0,0 +1,22 @@
1
+ export type RuntimeCapabilityKey<T> = {
2
+ readonly id: string;
3
+ readonly description?: string;
4
+ readonly __type?: T;
5
+ };
6
+ export declare function createRuntimeCapability<T>(id: string, options?: {
7
+ description?: string;
8
+ }): RuntimeCapabilityKey<T>;
9
+ export interface RuntimeCapabilityRegistry {
10
+ has<T>(key: RuntimeCapabilityKey<T> | string): boolean;
11
+ get<T>(key: RuntimeCapabilityKey<T> | string): T | undefined;
12
+ require<T>(key: RuntimeCapabilityKey<T> | string): T;
13
+ }
14
+ export declare const XPERT_RUNTIME_CAPABILITIES_TOKEN = "XPERT_RUNTIME_CAPABILITIES";
15
+ export declare class DefaultRuntimeCapabilityRegistry implements RuntimeCapabilityRegistry {
16
+ private readonly capabilities;
17
+ constructor(entries?: Array<[RuntimeCapabilityKey<unknown> | string, unknown]>);
18
+ register<T>(key: RuntimeCapabilityKey<T> | string, implementation: T): this;
19
+ has<T>(key: RuntimeCapabilityKey<T> | string): boolean;
20
+ get<T>(key: RuntimeCapabilityKey<T> | string): T | undefined;
21
+ require<T>(key: RuntimeCapabilityKey<T> | string): T;
22
+ }
@@ -0,0 +1,41 @@
1
+ import type { IApiPrincipal } from '@xpert-ai/contracts';
2
+ import { CanActivate, ExecutionContext } from '@nestjs/common';
3
+ export declare const PLUGIN_WEBHOOK_AUTH_METADATA_KEY = "xpert:plugin:webhook-auth";
4
+ export declare const PLUGIN_WEBHOOK_AUTH_SERVICE_TOKEN = "XPERT_PLUGIN_WEBHOOK_AUTH_SERVICE";
5
+ export type PluginWebhookAuthMetadata = {
6
+ provider?: string;
7
+ integrationParam?: string;
8
+ secretQueryParam?: string;
9
+ };
10
+ export type PluginWebhookCredentialRecord = {
11
+ id: string;
12
+ tokenHash: string;
13
+ tokenPrefix?: string;
14
+ createdAt: string;
15
+ rotatedAt?: string | null;
16
+ revokedAt?: string | null;
17
+ };
18
+ export type PluginWebhookCredentialResult = {
19
+ token: string;
20
+ credential: PluginWebhookCredentialRecord;
21
+ };
22
+ export type PluginWebhookAuthRequest = {
23
+ integrationId: string;
24
+ secret: string;
25
+ provider?: string | null;
26
+ };
27
+ export type PluginWebhookAuthResult = {
28
+ user: IApiPrincipal;
29
+ headers: Record<string, string>;
30
+ };
31
+ export interface PluginWebhookAuthService {
32
+ validateWebhookSecret(input: PluginWebhookAuthRequest): Promise<PluginWebhookAuthResult | null>;
33
+ }
34
+ export declare function PluginWebhookAuth(metadata?: PluginWebhookAuthMetadata): import("@nestjs/common").CustomDecorator<string>;
35
+ export declare class PluginWebhookAuthGuard implements CanActivate {
36
+ private readonly authService?;
37
+ constructor(authService?: PluginWebhookAuthService | null);
38
+ canActivate(context: ExecutionContext): Promise<boolean>;
39
+ private resolveMetadata;
40
+ private getString;
41
+ }
@@ -0,0 +1,3 @@
1
+ export * from './knowledgebase';
2
+ export * from './knowledgebase-documents';
3
+ export * from './workspace-files';
@@ -0,0 +1,121 @@
1
+ import { JSONValue } from '@xpert-ai/contracts';
2
+ export type KnowledgebaseDocumentFile = {
3
+ buffer: Buffer;
4
+ originalname?: string;
5
+ mimetype?: string;
6
+ size?: number;
7
+ };
8
+ export type KnowledgebaseDocumentMetadata = Record<string, JSONValue>;
9
+ export type KnowledgebaseDocumentParserConfig = Record<string, JSONValue>;
10
+ export type KnowledgebaseDocumentDraft = {
11
+ id?: string;
12
+ name?: string;
13
+ type?: string;
14
+ category?: string;
15
+ sourceType?: string;
16
+ sourceConfig?: Record<string, JSONValue>;
17
+ filePath?: string;
18
+ fileUrl?: string;
19
+ mimeType?: string;
20
+ size?: string | number;
21
+ parentId?: string;
22
+ parserConfig?: KnowledgebaseDocumentParserConfig;
23
+ metadata?: KnowledgebaseDocumentMetadata;
24
+ };
25
+ export type KnowledgebaseDocumentRecord = {
26
+ id: string;
27
+ name?: string;
28
+ type?: string;
29
+ category?: string | null;
30
+ sourceType?: string | null;
31
+ filePath?: string;
32
+ fileUrl?: string;
33
+ mimeType?: string;
34
+ size?: string | number;
35
+ status?: string | null;
36
+ progress?: number | null;
37
+ processMsg?: string | null;
38
+ knowledgebaseId?: string;
39
+ metadata?: KnowledgebaseDocumentMetadata;
40
+ };
41
+ export type KnowledgebaseUploadFileInput = {
42
+ knowledgebaseId: string;
43
+ file: KnowledgebaseDocumentFile;
44
+ path?: string;
45
+ parentId?: string;
46
+ };
47
+ export type KnowledgebaseUploadedFile = {
48
+ name: string;
49
+ filePath: string;
50
+ fileUrl: string;
51
+ mimeType?: string;
52
+ size?: number;
53
+ sourceHash?: string;
54
+ };
55
+ export type KnowledgebaseCreateDocumentsInput = {
56
+ knowledgebaseId: string;
57
+ documents: KnowledgebaseDocumentDraft[];
58
+ parserConfig?: KnowledgebaseDocumentParserConfig;
59
+ metadata?: KnowledgebaseDocumentMetadata;
60
+ process?: boolean;
61
+ };
62
+ export type KnowledgebaseCreateDocumentsResult = {
63
+ documents: KnowledgebaseDocumentRecord[];
64
+ processingStarted?: boolean;
65
+ };
66
+ export type KnowledgebaseImportArchiveInput = {
67
+ knowledgebaseId: string;
68
+ file: KnowledgebaseDocumentFile;
69
+ path?: string;
70
+ parentId?: string;
71
+ packageId?: string;
72
+ packageCode?: string;
73
+ parserConfig?: KnowledgebaseDocumentParserConfig;
74
+ metadata?: KnowledgebaseDocumentMetadata;
75
+ process?: boolean;
76
+ maxEntries?: number;
77
+ maxEntrySizeBytes?: number;
78
+ maxDepth?: number;
79
+ supportedExtensions?: string[];
80
+ };
81
+ export type KnowledgebaseImportArchiveResult = {
82
+ archive: KnowledgebaseUploadedFile;
83
+ documents: KnowledgebaseDocumentRecord[];
84
+ skipped: Array<{
85
+ path: string;
86
+ reason: string;
87
+ }>;
88
+ warnings: string[];
89
+ processingStarted?: boolean;
90
+ unsupported?: boolean;
91
+ };
92
+ export type KnowledgebaseStartProcessingInput = {
93
+ knowledgebaseId?: string;
94
+ documentIds: string[];
95
+ };
96
+ export type KnowledgebaseDocumentStatusInput = {
97
+ knowledgebaseId?: string;
98
+ documentIds: string[];
99
+ };
100
+ export type KnowledgebaseDocumentStatusResult = {
101
+ documents: KnowledgebaseDocumentRecord[];
102
+ };
103
+ export type KnowledgebaseDeleteDocumentsInput = {
104
+ knowledgebaseId?: string;
105
+ documentIds: string[];
106
+ };
107
+ export type KnowledgebaseDeleteDocumentsResult = {
108
+ knowledgebaseId?: string;
109
+ documentIds: string[];
110
+ deletedDocumentCount: number;
111
+ missingDocumentIds?: string[];
112
+ };
113
+ export interface KnowledgebaseDocumentsApi {
114
+ uploadFile(input: KnowledgebaseUploadFileInput): Promise<KnowledgebaseUploadedFile>;
115
+ importArchive(input: KnowledgebaseImportArchiveInput): Promise<KnowledgebaseImportArchiveResult>;
116
+ createDocuments(input: KnowledgebaseCreateDocumentsInput): Promise<KnowledgebaseCreateDocumentsResult>;
117
+ startProcessing(input: KnowledgebaseStartProcessingInput): Promise<KnowledgebaseDocumentStatusResult>;
118
+ getDocumentStatus(input: KnowledgebaseDocumentStatusInput): Promise<KnowledgebaseDocumentStatusResult>;
119
+ deleteDocuments(input: KnowledgebaseDeleteDocumentsInput): Promise<KnowledgebaseDeleteDocumentsResult>;
120
+ }
121
+ export declare const KnowledgebaseDocumentsRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<KnowledgebaseDocumentsApi>;
@@ -1,36 +1,36 @@
1
1
  import { JSONValue } from '@xpert-ai/contracts';
2
- export type AgentMiddlewareKnowledgebaseRetrievalMode = 'vector' | 'graph' | 'hybrid';
3
- export type AgentMiddlewareKnowledgebaseMetadata = Record<string, JSONValue>;
4
- export type AgentMiddlewareKnowledgebaseRetrievalSettings = {
5
- mode?: AgentMiddlewareKnowledgebaseRetrievalMode;
2
+ export type KnowledgebaseRetrievalMode = 'vector' | 'graph' | 'hybrid';
3
+ export type KnowledgebaseMetadata = Record<string, JSONValue>;
4
+ export type KnowledgebaseRetrievalSettings = {
5
+ mode?: KnowledgebaseRetrievalMode;
6
6
  neighborHops?: number;
7
7
  entityTopK?: number;
8
8
  communityTopK?: number;
9
9
  graphWeight?: number;
10
10
  };
11
- export type AgentMiddlewareKnowledgebaseSearchInput = {
11
+ export type KnowledgebaseSearchInput = {
12
12
  tenantId?: string;
13
13
  organizationId?: string;
14
14
  knowledgebaseIds: string[];
15
15
  query: string;
16
16
  k?: number;
17
17
  score?: number;
18
- filter?: AgentMiddlewareKnowledgebaseMetadata;
19
- retrieval?: AgentMiddlewareKnowledgebaseRetrievalSettings;
18
+ filter?: KnowledgebaseMetadata;
19
+ retrieval?: KnowledgebaseRetrievalSettings;
20
20
  source: string;
21
21
  requestId?: string;
22
22
  };
23
- export type AgentMiddlewareKnowledgebaseDocument = {
23
+ export type KnowledgebaseDocument = {
24
24
  id?: string;
25
25
  pageContent: string;
26
26
  metadata?: Record<string, unknown>;
27
27
  };
28
- export type AgentMiddlewareKnowledgebaseListInput = {
28
+ export type KnowledgebaseListInput = {
29
29
  workspaceId?: string | null;
30
30
  published?: boolean;
31
31
  limit?: number;
32
32
  };
33
- export type AgentMiddlewareKnowledgebaseListItem = {
33
+ export type KnowledgebaseListItem = {
34
34
  id: string;
35
35
  name?: string;
36
36
  description?: string | null;
@@ -46,24 +46,24 @@ export type AgentMiddlewareKnowledgebaseListItem = {
46
46
  } | null;
47
47
  graphStatus?: string | null;
48
48
  };
49
- export type AgentMiddlewareKnowledgebaseWriteChunkInput = {
49
+ export type KnowledgebaseWriteChunkInput = {
50
50
  xpertId: string;
51
51
  agentKey: string;
52
52
  knowledgebaseIds: string[];
53
53
  knowledgebaseId: string;
54
54
  text: string;
55
55
  title?: string;
56
- metadata?: AgentMiddlewareKnowledgebaseMetadata;
56
+ metadata?: KnowledgebaseMetadata;
57
57
  writeKey: string;
58
58
  executionId?: string;
59
59
  threadId?: string;
60
60
  };
61
- export type AgentMiddlewareKnowledgebaseWriteChunkResult = {
61
+ export type KnowledgebaseWriteChunkResult = {
62
62
  status?: 'created' | 'skipped';
63
63
  chunkId?: string;
64
64
  message?: string;
65
65
  };
66
- export type AgentMiddlewareKnowledgebaseDeleteChunksInput = {
66
+ export type KnowledgebaseDeleteChunksInput = {
67
67
  xpertId: string;
68
68
  agentKey: string;
69
69
  knowledgebaseIds: string[];
@@ -71,17 +71,17 @@ export type AgentMiddlewareKnowledgebaseDeleteChunksInput = {
71
71
  writeKeys?: string[];
72
72
  writeKeyPrefix?: string;
73
73
  };
74
- export type AgentMiddlewareKnowledgebaseDeleteChunksResult = {
74
+ export type KnowledgebaseDeleteChunksResult = {
75
75
  deletedCount: number;
76
76
  knowledgebaseId: string;
77
77
  documentId?: string;
78
78
  writeKeys?: string[];
79
79
  writeKeyPrefix?: string;
80
80
  };
81
- export interface AgentMiddlewareKnowledgebaseApi {
82
- list(input: AgentMiddlewareKnowledgebaseListInput): Promise<AgentMiddlewareKnowledgebaseListItem[]>;
83
- search(input: AgentMiddlewareKnowledgebaseSearchInput): Promise<AgentMiddlewareKnowledgebaseDocument[]>;
84
- writeChunk(input: AgentMiddlewareKnowledgebaseWriteChunkInput): Promise<AgentMiddlewareKnowledgebaseWriteChunkResult>;
85
- deleteChunks(input: AgentMiddlewareKnowledgebaseDeleteChunksInput): Promise<AgentMiddlewareKnowledgebaseDeleteChunksResult>;
81
+ export interface KnowledgebaseApi {
82
+ list(input: KnowledgebaseListInput): Promise<KnowledgebaseListItem[]>;
83
+ search(input: KnowledgebaseSearchInput): Promise<KnowledgebaseDocument[]>;
84
+ writeChunk(input: KnowledgebaseWriteChunkInput): Promise<KnowledgebaseWriteChunkResult>;
85
+ deleteChunks(input: KnowledgebaseDeleteChunksInput): Promise<KnowledgebaseDeleteChunksResult>;
86
86
  }
87
- export declare const KnowledgebaseRuntimeCapability: import("../runtime-capability").RuntimeCapabilityKey<AgentMiddlewareKnowledgebaseApi>;
87
+ export declare const KnowledgebaseRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<KnowledgebaseApi>;
@@ -0,0 +1,45 @@
1
+ export type WorkspaceFileCatalog = 'projects' | 'users' | 'knowledges' | 'skills' | 'xperts';
2
+ export type WorkspaceFileScope = {
3
+ tenantId?: string | null;
4
+ userId?: string | null;
5
+ catalog?: WorkspaceFileCatalog | null;
6
+ scopeId?: string | null;
7
+ projectId?: string | null;
8
+ knowledgeId?: string | null;
9
+ rootId?: string | null;
10
+ xpertId?: string | null;
11
+ isolateByUser?: boolean | null;
12
+ };
13
+ export type WorkspaceUploadBufferInput = WorkspaceFileScope & {
14
+ buffer: Buffer;
15
+ originalName: string;
16
+ mimeType?: string | null;
17
+ size?: number | null;
18
+ folder?: string | null;
19
+ fileName?: string | null;
20
+ metadata?: Record<string, unknown>;
21
+ };
22
+ export type WorkspaceFileReference = WorkspaceFileScope & {
23
+ filePath: string;
24
+ };
25
+ export type WorkspaceFile = {
26
+ name: string;
27
+ filePath: string;
28
+ workspacePath: string;
29
+ fileUrl?: string;
30
+ url?: string;
31
+ mimeType?: string;
32
+ size?: number;
33
+ catalog: WorkspaceFileCatalog;
34
+ scopeId?: string;
35
+ metadata?: Record<string, unknown>;
36
+ };
37
+ export type WorkspaceFileBuffer = WorkspaceFile & {
38
+ buffer: Buffer;
39
+ };
40
+ export interface WorkspaceFilesApi {
41
+ uploadBuffer(input: WorkspaceUploadBufferInput): Promise<WorkspaceFile>;
42
+ readBuffer(input: WorkspaceFileReference): Promise<WorkspaceFileBuffer>;
43
+ deleteFile(input: WorkspaceFileReference): Promise<void>;
44
+ }
45
+ export declare const WorkspaceFilesRuntimeCapability: import("../../core/runtime-capability").RuntimeCapabilityKey<WorkspaceFilesApi>;
@@ -0,0 +1,2 @@
1
+ export * from './runtime-capability';
2
+ export * from './capabilities';
@@ -0,0 +1 @@
1
+ export * from '../core/runtime-capability';
@@ -1,121 +0,0 @@
1
- import { JSONValue } from '@xpert-ai/contracts';
2
- export type AgentMiddlewareKnowledgebaseDocumentFile = {
3
- buffer: Buffer;
4
- originalname?: string;
5
- mimetype?: string;
6
- size?: number;
7
- };
8
- export type AgentMiddlewareKnowledgebaseDocumentMetadata = Record<string, JSONValue>;
9
- export type AgentMiddlewareKnowledgebaseDocumentParserConfig = Record<string, JSONValue>;
10
- export type AgentMiddlewareKnowledgebaseDocumentDraft = {
11
- id?: string;
12
- name?: string;
13
- type?: string;
14
- category?: string;
15
- sourceType?: string;
16
- sourceConfig?: Record<string, JSONValue>;
17
- filePath?: string;
18
- fileUrl?: string;
19
- mimeType?: string;
20
- size?: string | number;
21
- parentId?: string;
22
- parserConfig?: AgentMiddlewareKnowledgebaseDocumentParserConfig;
23
- metadata?: AgentMiddlewareKnowledgebaseDocumentMetadata;
24
- };
25
- export type AgentMiddlewareKnowledgebaseDocumentRecord = {
26
- id: string;
27
- name?: string;
28
- type?: string;
29
- category?: string | null;
30
- sourceType?: string | null;
31
- filePath?: string;
32
- fileUrl?: string;
33
- mimeType?: string;
34
- size?: string | number;
35
- status?: string | null;
36
- progress?: number | null;
37
- processMsg?: string | null;
38
- knowledgebaseId?: string;
39
- metadata?: AgentMiddlewareKnowledgebaseDocumentMetadata;
40
- };
41
- export type AgentMiddlewareKnowledgebaseUploadFileInput = {
42
- knowledgebaseId: string;
43
- file: AgentMiddlewareKnowledgebaseDocumentFile;
44
- path?: string;
45
- parentId?: string;
46
- };
47
- export type AgentMiddlewareKnowledgebaseUploadedFile = {
48
- name: string;
49
- filePath: string;
50
- fileUrl: string;
51
- mimeType?: string;
52
- size?: number;
53
- sourceHash?: string;
54
- };
55
- export type AgentMiddlewareKnowledgebaseCreateDocumentsInput = {
56
- knowledgebaseId: string;
57
- documents: AgentMiddlewareKnowledgebaseDocumentDraft[];
58
- parserConfig?: AgentMiddlewareKnowledgebaseDocumentParserConfig;
59
- metadata?: AgentMiddlewareKnowledgebaseDocumentMetadata;
60
- process?: boolean;
61
- };
62
- export type AgentMiddlewareKnowledgebaseCreateDocumentsResult = {
63
- documents: AgentMiddlewareKnowledgebaseDocumentRecord[];
64
- processingStarted?: boolean;
65
- };
66
- export type AgentMiddlewareKnowledgebaseImportArchiveInput = {
67
- knowledgebaseId: string;
68
- file: AgentMiddlewareKnowledgebaseDocumentFile;
69
- path?: string;
70
- parentId?: string;
71
- packageId?: string;
72
- packageCode?: string;
73
- parserConfig?: AgentMiddlewareKnowledgebaseDocumentParserConfig;
74
- metadata?: AgentMiddlewareKnowledgebaseDocumentMetadata;
75
- process?: boolean;
76
- maxEntries?: number;
77
- maxEntrySizeBytes?: number;
78
- maxDepth?: number;
79
- supportedExtensions?: string[];
80
- };
81
- export type AgentMiddlewareKnowledgebaseImportArchiveResult = {
82
- archive: AgentMiddlewareKnowledgebaseUploadedFile;
83
- documents: AgentMiddlewareKnowledgebaseDocumentRecord[];
84
- skipped: Array<{
85
- path: string;
86
- reason: string;
87
- }>;
88
- warnings: string[];
89
- processingStarted?: boolean;
90
- unsupported?: boolean;
91
- };
92
- export type AgentMiddlewareKnowledgebaseStartProcessingInput = {
93
- knowledgebaseId?: string;
94
- documentIds: string[];
95
- };
96
- export type AgentMiddlewareKnowledgebaseDocumentStatusInput = {
97
- knowledgebaseId?: string;
98
- documentIds: string[];
99
- };
100
- export type AgentMiddlewareKnowledgebaseDocumentStatusResult = {
101
- documents: AgentMiddlewareKnowledgebaseDocumentRecord[];
102
- };
103
- export type AgentMiddlewareKnowledgebaseDeleteDocumentsInput = {
104
- knowledgebaseId?: string;
105
- documentIds: string[];
106
- };
107
- export type AgentMiddlewareKnowledgebaseDeleteDocumentsResult = {
108
- knowledgebaseId?: string;
109
- documentIds: string[];
110
- deletedDocumentCount: number;
111
- missingDocumentIds?: string[];
112
- };
113
- export interface AgentMiddlewareKnowledgebaseDocumentsApi {
114
- uploadFile(input: AgentMiddlewareKnowledgebaseUploadFileInput): Promise<AgentMiddlewareKnowledgebaseUploadedFile>;
115
- importArchive(input: AgentMiddlewareKnowledgebaseImportArchiveInput): Promise<AgentMiddlewareKnowledgebaseImportArchiveResult>;
116
- createDocuments(input: AgentMiddlewareKnowledgebaseCreateDocumentsInput): Promise<AgentMiddlewareKnowledgebaseCreateDocumentsResult>;
117
- startProcessing(input: AgentMiddlewareKnowledgebaseStartProcessingInput): Promise<AgentMiddlewareKnowledgebaseDocumentStatusResult>;
118
- getDocumentStatus(input: AgentMiddlewareKnowledgebaseDocumentStatusInput): Promise<AgentMiddlewareKnowledgebaseDocumentStatusResult>;
119
- deleteDocuments(input: AgentMiddlewareKnowledgebaseDeleteDocumentsInput): Promise<AgentMiddlewareKnowledgebaseDeleteDocumentsResult>;
120
- }
121
- export declare const KnowledgebaseDocumentsRuntimeCapability: import("../runtime-capability").RuntimeCapabilityKey<AgentMiddlewareKnowledgebaseDocumentsApi>;