@xpert-ai/plugin-sdk 3.18.1 → 3.18.3

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/index.cjs.js CHANGED
@@ -36,7 +36,7 @@ var jsTiktoken = require('js-tiktoken');
36
36
  var base$1 = require('@langchain/core/language_models/base');
37
37
  var connector = require('./connector.cjs.js');
38
38
  var collaborationClient = require('./collaboration-client.cjs.js');
39
- require('@langchain/core/tools');
39
+ var tools = require('@langchain/core/tools');
40
40
  require('zod/v3');
41
41
 
42
42
  function _interopNamespaceDefault(e) {
@@ -521,12 +521,14 @@ exports.StrategyBus = class StrategyBus {
521
521
  entry
522
522
  });
523
523
  }
524
- remove(orgId, pluginName) {
525
- this.subject.next({
524
+ remove(orgId, pluginName, cause) {
525
+ this.subject.next(_extends._extends({
526
526
  type: 'REMOVE',
527
527
  orgId,
528
528
  pluginName
529
- });
529
+ }, cause ? {
530
+ cause
531
+ } : {}));
530
532
  }
531
533
  constructor(){
532
534
  this.subject = new rxjs.Subject();
@@ -561,22 +563,39 @@ class BaseStrategyRegistry {
561
563
  const type = this.reflector.get(this.strategyKey, target);
562
564
  if (type) {
563
565
  const source = this.getSource(instance);
564
- const pluginName = source.kind === 'plugin' ? source.pluginName : undefined;
565
- const organizationId = source.scopeKey;
566
- var _this_strategies_get;
567
- const orgMap = (_this_strategies_get = this.strategies.get(organizationId)) != null ? _this_strategies_get : new Map();
568
- orgMap.set(type, instance);
569
- this.strategies.set(organizationId, orgMap);
570
- this.logger.debug(`Registered strategy of type ${type} for scope ${organizationId} from plugin ${pluginName}`);
571
- if (pluginName) {
572
- var _this_pluginStrategies_get;
573
- const pluginStrategies = (_this_pluginStrategies_get = this.pluginStrategies.get(pluginName)) != null ? _this_pluginStrategies_get : new Set();
574
- pluginStrategies.add(type);
575
- this.pluginStrategies.set(pluginName, pluginStrategies);
576
- }
566
+ this.store(type, instance, source, false);
577
567
  }
578
568
  }
569
+ /** Registers a host-generated adapter without mutating shared class metadata. */ register(type, instance, source) {
570
+ if ((typeof instance !== 'object' || instance === null) && typeof instance !== 'function') {
571
+ throw new Error(`Cannot register non-object strategy '${type}'.`);
572
+ }
573
+ this.assertCanRegister(type, instance, source);
574
+ this.explicitSources.set(instance, source);
575
+ return this.store(type, instance, source, false);
576
+ }
577
+ /** Preflights adapter batches so a provider is expanded atomically across registries. */ assertCanRegister(type, instance, source) {
578
+ var _this_strategies_get;
579
+ const existing = (_this_strategies_get = this.strategies.get(source.scopeKey)) == null ? void 0 : _this_strategies_get.get(type);
580
+ if (!existing || existing === instance) return;
581
+ const existingSource = this.getSource(existing);
582
+ const samePlugin = existingSource.kind === 'plugin' && source.kind === 'plugin' && existingSource.pluginName === source.pluginName;
583
+ if (!samePlugin) {
584
+ throw new Error(`Strategy '${type}' is already registered for scope '${source.scopeKey}'.`);
585
+ }
586
+ }
587
+ /** Removes one exact programmatic registration without affecting fallback scopes. */ unregister(type, source, expected) {
588
+ const orgMap = this.strategies.get(source.scopeKey);
589
+ const current = orgMap == null ? void 0 : orgMap.get(type);
590
+ if (expected !== undefined && current !== expected) return false;
591
+ var _orgMap_delete;
592
+ return (_orgMap_delete = orgMap == null ? void 0 : orgMap.delete(type)) != null ? _orgMap_delete : false;
593
+ }
579
594
  /** Returns the explicit registry provenance attached by the plugin loader. */ getSource(instance) {
595
+ if (typeof instance === 'object' && instance !== null || typeof instance === 'function') {
596
+ const explicit = this.explicitSources.get(instance);
597
+ if (explicit) return explicit;
598
+ }
580
599
  const target = resolveStrategyMetadataTarget(instance);
581
600
  if (!target) {
582
601
  return {
@@ -680,11 +699,68 @@ class BaseStrategyRegistry {
680
699
  }
681
700
  return Array.from(effective.values());
682
701
  }
702
+ listRegistrations(organizationId) {
703
+ organizationId != null ? organizationId : organizationId = RequestContext.getOrganizationId();
704
+ const effective = new Map();
705
+ for (const scopeKey of this.resolveStrategyScopeKeys(organizationId)){
706
+ var _this_strategies_get;
707
+ var _this_strategies_get_entries;
708
+ for (const [type, strategy] of (_this_strategies_get_entries = (_this_strategies_get = this.strategies.get(scopeKey)) == null ? void 0 : _this_strategies_get.entries()) != null ? _this_strategies_get_entries : []){
709
+ if (!effective.has(type)) effective.set(type, strategy);
710
+ }
711
+ }
712
+ return Array.from(effective, ([type, strategy])=>({
713
+ type,
714
+ strategy,
715
+ source: this.getSource(strategy)
716
+ }));
717
+ }
718
+ /** Returns every direct registration without applying request-scope fallback rules. */ listAllRegistrations() {
719
+ const registrations = [];
720
+ for (const [scopeKey, strategies] of this.strategies){
721
+ for (const [type, strategy] of strategies){
722
+ const source = this.getSource(strategy);
723
+ registrations.push({
724
+ type,
725
+ strategy,
726
+ source: source.scopeKey === scopeKey ? source : _extends._extends({}, source, {
727
+ scopeKey
728
+ })
729
+ });
730
+ }
731
+ }
732
+ return registrations;
733
+ }
734
+ store(type, instance, source, rejectCrossPluginConflict) {
735
+ const pluginName = source.kind === 'plugin' ? source.pluginName : undefined;
736
+ const organizationId = source.scopeKey;
737
+ var _this_strategies_get;
738
+ const orgMap = (_this_strategies_get = this.strategies.get(organizationId)) != null ? _this_strategies_get : new Map();
739
+ const existing = orgMap.get(type);
740
+ if (rejectCrossPluginConflict && existing && existing !== instance) {
741
+ const existingSource = this.getSource(existing);
742
+ const samePlugin = existingSource.kind === 'plugin' && source.kind === 'plugin' && existingSource.pluginName === source.pluginName;
743
+ if (!samePlugin) {
744
+ throw new Error(`Strategy '${type}' is already registered for scope '${organizationId}'.`);
745
+ }
746
+ }
747
+ orgMap.set(type, instance);
748
+ this.strategies.set(organizationId, orgMap);
749
+ this.logger.debug(`Registered strategy of type ${type} for scope ${organizationId} from plugin ${pluginName}`);
750
+ if (pluginName) {
751
+ var _this_pluginStrategies_get;
752
+ const pluginStrategies = (_this_pluginStrategies_get = this.pluginStrategies.get(pluginName)) != null ? _this_pluginStrategies_get : new Set();
753
+ pluginStrategies.add(type);
754
+ this.pluginStrategies.set(pluginName, pluginStrategies);
755
+ }
756
+ return existing;
757
+ }
683
758
  constructor(strategyKey, discoveryService, reflector){
684
759
  this.logger = new common.Logger(BaseStrategyRegistry.name);
685
760
  // Map<scopeKey, Map<type, strategy>>
686
761
  this.strategies = new Map();
687
762
  this.pluginStrategies = new Map();
763
+ this.explicitSources = new WeakMap();
688
764
  this.strategyKey = strategyKey;
689
765
  this.discoveryService = discoveryService;
690
766
  this.reflector = reflector;
@@ -1521,7 +1597,7 @@ class BaseSQLQueryRunner extends BaseQueryRunner {
1521
1597
  return;
1522
1598
  }
1523
1599
  // --- MODE: UPGRADE → auto upgrade (simple implementation: only add new columns) ---
1524
- // Note: This default implementation does not support modifying column types,
1600
+ // Note: This default implementation does not support modifying column types,
1525
1601
  // recommend each database to implement its own version
1526
1602
  if (exists && createMode === exports.DBCreateTableMode.UPGRADE) {
1527
1603
  console.warn(`[BaseSQLQueryRunner] UPGRADE mode uses basic implementation. Consider implementing tableOp for better support.`);
@@ -1700,13 +1776,13 @@ var DefaultParameterName;
1700
1776
  const PARAMETER_RULE_TEMPLATE = {
1701
1777
  [DefaultParameterName.TEMPERATURE]: {
1702
1778
  label: {
1703
- en_US: "Temperature",
1704
- zh_Hans: "温度"
1779
+ en_US: 'Temperature',
1780
+ zh_Hans: '温度'
1705
1781
  },
1706
1782
  type: contracts.ParameterType.FLOAT,
1707
1783
  help: {
1708
- en_US: "Controls randomness. Lower temperature results in less random completions." + " As the temperature approaches zero, the model will become deterministic and repetitive." + " Higher temperature results in more random completions.",
1709
- zh_Hans: "温度控制随机性。较低的温度会导致较少的随机完成。随着温度接近零,模型将变得确定性和重复性。" + "较高的温度会导致更多的随机完成。"
1784
+ en_US: 'Controls randomness. Lower temperature results in less random completions.' + ' As the temperature approaches zero, the model will become deterministic and repetitive.' + ' Higher temperature results in more random completions.',
1785
+ zh_Hans: '温度控制随机性。较低的温度会导致较少的随机完成。随着温度接近零,模型将变得确定性和重复性。' + '较高的温度会导致更多的随机完成。'
1710
1786
  },
1711
1787
  required: false,
1712
1788
  default: 0.0,
@@ -1716,13 +1792,13 @@ const PARAMETER_RULE_TEMPLATE = {
1716
1792
  },
1717
1793
  [DefaultParameterName.TOP_P]: {
1718
1794
  label: {
1719
- en_US: "Top P",
1720
- zh_Hans: "Top P"
1795
+ en_US: 'Top P',
1796
+ zh_Hans: 'Top P'
1721
1797
  },
1722
1798
  type: contracts.ParameterType.FLOAT,
1723
1799
  help: {
1724
- en_US: "Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options" + " are considered.",
1725
- zh_Hans: "通过核心采样控制多样性:0.5表示考虑了一半的所有可能性加权选项。"
1800
+ en_US: 'Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options' + ' are considered.',
1801
+ zh_Hans: '通过核心采样控制多样性:0.5表示考虑了一半的所有可能性加权选项。'
1726
1802
  },
1727
1803
  required: false,
1728
1804
  default: 1.0,
@@ -1732,13 +1808,13 @@ const PARAMETER_RULE_TEMPLATE = {
1732
1808
  },
1733
1809
  [DefaultParameterName.TOP_K]: {
1734
1810
  label: {
1735
- en_US: "Top K",
1736
- zh_Hans: "Top K"
1811
+ en_US: 'Top K',
1812
+ zh_Hans: 'Top K'
1737
1813
  },
1738
1814
  type: contracts.ParameterType.INT,
1739
1815
  help: {
1740
- en_US: "Limits the number of tokens to consider for each step by keeping only the k most likely tokens.",
1741
- zh_Hans: "通过只保留每一步中最可能的 k 个标记来限制要考虑的标记数量。"
1816
+ en_US: 'Limits the number of tokens to consider for each step by keeping only the k most likely tokens.',
1817
+ zh_Hans: '通过只保留每一步中最可能的 k 个标记来限制要考虑的标记数量。'
1742
1818
  },
1743
1819
  required: false,
1744
1820
  default: 50,
@@ -1748,13 +1824,13 @@ const PARAMETER_RULE_TEMPLATE = {
1748
1824
  },
1749
1825
  [DefaultParameterName.PRESENCE_PENALTY]: {
1750
1826
  label: {
1751
- en_US: "Presence Penalty",
1752
- zh_Hans: "存在惩罚"
1827
+ en_US: 'Presence Penalty',
1828
+ zh_Hans: '存在惩罚'
1753
1829
  },
1754
1830
  type: contracts.ParameterType.FLOAT,
1755
1831
  help: {
1756
- en_US: "Applies a penalty to the log-probability of tokens already in the text.",
1757
- zh_Hans: "对文本中已有的标记的对数概率施加惩罚。"
1832
+ en_US: 'Applies a penalty to the log-probability of tokens already in the text.',
1833
+ zh_Hans: '对文本中已有的标记的对数概率施加惩罚。'
1758
1834
  },
1759
1835
  required: false,
1760
1836
  default: 0.0,
@@ -1764,13 +1840,13 @@ const PARAMETER_RULE_TEMPLATE = {
1764
1840
  },
1765
1841
  [DefaultParameterName.FREQUENCY_PENALTY]: {
1766
1842
  label: {
1767
- en_US: "Frequency Penalty",
1768
- zh_Hans: "频率惩罚"
1843
+ en_US: 'Frequency Penalty',
1844
+ zh_Hans: '频率惩罚'
1769
1845
  },
1770
1846
  type: contracts.ParameterType.FLOAT,
1771
1847
  help: {
1772
- en_US: "Applies a penalty to the log-probability of tokens that appear in the text.",
1773
- zh_Hans: "对文本中出现的标记的对数概率施加惩罚。"
1848
+ en_US: 'Applies a penalty to the log-probability of tokens that appear in the text.',
1849
+ zh_Hans: '对文本中出现的标记的对数概率施加惩罚。'
1774
1850
  },
1775
1851
  required: false,
1776
1852
  default: 0.0,
@@ -1780,13 +1856,13 @@ const PARAMETER_RULE_TEMPLATE = {
1780
1856
  },
1781
1857
  [DefaultParameterName.MAX_TOKENS]: {
1782
1858
  label: {
1783
- en_US: "Max Tokens",
1784
- zh_Hans: "最大标记"
1859
+ en_US: 'Max Tokens',
1860
+ zh_Hans: '最大标记'
1785
1861
  },
1786
1862
  type: contracts.ParameterType.INT,
1787
1863
  help: {
1788
- en_US: "Specifies the upper limit on the length of generated results." + " If the generated results are truncated, you can increase this parameter.",
1789
- zh_Hans: "指定生成结果长度的上限。如果生成结果截断,可以调大该参数。"
1864
+ en_US: 'Specifies the upper limit on the length of generated results.' + ' If the generated results are truncated, you can increase this parameter.',
1865
+ zh_Hans: '指定生成结果长度的上限。如果生成结果截断,可以调大该参数。'
1790
1866
  },
1791
1867
  required: false,
1792
1868
  default: 2048,
@@ -1796,28 +1872,28 @@ const PARAMETER_RULE_TEMPLATE = {
1796
1872
  },
1797
1873
  [DefaultParameterName.RESPONSE_FORMAT]: {
1798
1874
  label: {
1799
- en_US: "Response Format",
1800
- zh_Hans: "回复格式"
1875
+ en_US: 'Response Format',
1876
+ zh_Hans: '回复格式'
1801
1877
  },
1802
1878
  type: contracts.ParameterType.STRING,
1803
1879
  help: {
1804
- en_US: "Set a response format, ensure the output from llm is a valid code block as possible," + " such as JSON, XML, etc.",
1805
- zh_Hans: "设置一个返回格式,确保llm的输出尽可能是有效的代码块,如JSON、XML等"
1880
+ en_US: 'Set a response format, ensure the output from llm is a valid code block as possible,' + ' such as JSON, XML, etc.',
1881
+ zh_Hans: '设置一个返回格式,确保llm的输出尽可能是有效的代码块,如JSON、XML等'
1806
1882
  },
1807
1883
  required: false,
1808
1884
  options: [
1809
- "JSON",
1810
- "XML"
1885
+ 'JSON',
1886
+ 'XML'
1811
1887
  ]
1812
1888
  },
1813
1889
  [DefaultParameterName.JSON_SCHEMA]: {
1814
1890
  label: {
1815
- en_US: "JSON Schema"
1891
+ en_US: 'JSON Schema'
1816
1892
  },
1817
1893
  type: contracts.ParameterType.TEXT,
1818
1894
  help: {
1819
- en_US: "Set a response json schema will ensure LLM to adhere it.",
1820
- zh_Hans: "设置返回的json schema,llm将按照它返回"
1895
+ en_US: 'Set a response json schema will ensure LLM to adhere it.',
1896
+ zh_Hans: '设置返回的json schema,llm将按照它返回'
1821
1897
  },
1822
1898
  required: false
1823
1899
  }
@@ -5849,6 +5925,554 @@ function freezeItems(items) {
5849
5925
  ]) : undefined;
5850
5926
  }
5851
5927
 
5928
+ const XPERT_TOOL_PROVIDER = 'XPERT_TOOL_PROVIDER';
5929
+ const XPERT_TOOL_PROVIDER_METADATA = 'XPERT_TOOL_PROVIDER_METADATA';
5930
+ const XPERT_TOOL_METHOD_METADATA = 'XPERT_TOOL_METHOD_METADATA';
5931
+ /** Marks one injectable business service as a reusable Tool provider and one native MCP service. */ const XpertToolProvider = (options)=>common.applyDecorators(common.Injectable(), common.SetMetadata(XPERT_TOOL_PROVIDER, options.provider), common.SetMetadata(XPERT_TOOL_PROVIDER_METADATA, Object.freeze(_extends._extends({}, options))), common.SetMetadata(STRATEGY_META_KEY, XPERT_TOOL_PROVIDER));
5932
+ /** Exposes one business method through an Agent Middleware, native MCP, or both. */ const XpertTool = (options)=>common.SetMetadata(XPERT_TOOL_METHOD_METADATA, Object.freeze(_extends._extends({}, options)));
5933
+
5934
+ const PROVIDER_PATTERN = /^[a-z][a-z0-9_]*$/;
5935
+ const MIDDLEWARE_PROVIDER_PATTERN = /^[A-Za-z][A-Za-z0-9_]*$/;
5936
+ const COMPONENT_KEY_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
5937
+ const SLUG_PATTERN = COMPONENT_KEY_PATTERN;
5938
+ const TOOL_NAME_PATTERN = /^[A-Za-z0-9_-]+$/;
5939
+ function describeXpertToolProvider(instance) {
5940
+ const target = instance.constructor;
5941
+ const options = Reflect.getMetadata(XPERT_TOOL_PROVIDER_METADATA, target);
5942
+ if (!options) {
5943
+ throw new Error(`Provider '${target.name}' is missing @XpertToolProvider metadata.`);
5944
+ }
5945
+ validateProviderOptions(options);
5946
+ const methods = collectDecoratedMethods(instance);
5947
+ const names = new Set();
5948
+ var _options_middlewares;
5949
+ const middlewareProviders = new Set(((_options_middlewares = options.middlewares) != null ? _options_middlewares : []).map(({ provider })=>provider));
5950
+ var _options_apps;
5951
+ const appKeys = new Set(((_options_apps = options.apps) != null ? _options_apps : []).map(({ key })=>key));
5952
+ const tools = methods.map(({ methodName, options: toolOptions })=>{
5953
+ var _toolOptions_mcp_app;
5954
+ validateToolOptions(toolOptions, methodName);
5955
+ if (names.has(toolOptions.name)) {
5956
+ throw new Error(`Tool '${toolOptions.name}' is declared more than once by provider '${options.provider}'.`);
5957
+ }
5958
+ names.add(toolOptions.name);
5959
+ const middlewareProvider = resolveMiddlewareProvider(toolOptions, options);
5960
+ if (!middlewareProvider && !toolOptions.mcp) {
5961
+ throw new Error(`Tool '${toolOptions.name}' is not exposed through Middleware or MCP.`);
5962
+ }
5963
+ if (middlewareProvider && !middlewareProviders.has(middlewareProvider)) {
5964
+ throw new Error(`Tool '${toolOptions.name}' references undeclared Middleware provider '${middlewareProvider}'.`);
5965
+ }
5966
+ const appKey = toolOptions.mcp && ((_toolOptions_mcp_app = toolOptions.mcp.app) == null ? void 0 : _toolOptions_mcp_app.resourceKey);
5967
+ if (appKey && !appKeys.has(appKey)) {
5968
+ throw new Error(`MCP Tool '${toolOptions.name}' references undeclared App '${appKey}'.`);
5969
+ }
5970
+ return Object.freeze({
5971
+ methodName,
5972
+ middlewareProvider,
5973
+ options: toolOptions
5974
+ });
5975
+ });
5976
+ if (!tools.length) {
5977
+ throw new Error(`Provider '${options.provider}' does not declare any @XpertTool methods.`);
5978
+ }
5979
+ return Object.freeze({
5980
+ options: Object.freeze(_extends._extends({}, options)),
5981
+ tools: Object.freeze(tools)
5982
+ });
5983
+ }
5984
+ function collectDecoratedMethods(instance) {
5985
+ const result = [];
5986
+ const seen = new Set();
5987
+ let prototype = Object.getPrototypeOf(instance);
5988
+ while(prototype && prototype !== Object.prototype){
5989
+ for (const methodName of Object.getOwnPropertyNames(prototype)){
5990
+ if (methodName === 'constructor' || seen.has(methodName)) continue;
5991
+ seen.add(methodName);
5992
+ const method = Reflect.get(prototype, methodName);
5993
+ if (typeof method !== 'function') continue;
5994
+ const options = Reflect.getMetadata(XPERT_TOOL_METHOD_METADATA, method);
5995
+ if (options) result.push({
5996
+ methodName,
5997
+ options
5998
+ });
5999
+ }
6000
+ prototype = Object.getPrototypeOf(prototype);
6001
+ }
6002
+ return result;
6003
+ }
6004
+ function validateProviderOptions(options) {
6005
+ var _options_name;
6006
+ if (!PROVIDER_PATTERN.test(options.provider)) {
6007
+ throw new Error(`Xpert Tool provider '${options.provider}' must use lowercase snake_case.`);
6008
+ }
6009
+ if (!COMPONENT_KEY_PATTERN.test(options.componentKey)) {
6010
+ throw new Error(`Xpert Tool component key '${options.componentKey}' must use lowercase kebab-case.`);
6011
+ }
6012
+ if (!((_options_name = options.name) == null ? void 0 : _options_name.trim())) throw new Error(`Xpert Tool provider '${options.provider}' requires a name.`);
6013
+ if (options.slug && !SLUG_PATTERN.test(options.slug)) {
6014
+ throw new Error(`Xpert Tool provider slug '${options.slug}' must use lowercase kebab-case.`);
6015
+ }
6016
+ const middlewareProviders = new Set();
6017
+ var _options_middlewares;
6018
+ for (const definition of (_options_middlewares = options.middlewares) != null ? _options_middlewares : []){
6019
+ if (!MIDDLEWARE_PROVIDER_PATTERN.test(definition.provider)) {
6020
+ throw new Error(`Middleware provider '${definition.provider}' must be a stable identifier.`);
6021
+ }
6022
+ if (middlewareProviders.has(definition.provider)) {
6023
+ throw new Error(`Middleware provider '${definition.provider}' is declared more than once.`);
6024
+ }
6025
+ if (definition.meta.name !== definition.provider) {
6026
+ throw new Error(`Middleware metadata name must match provider '${definition.provider}'.`);
6027
+ }
6028
+ middlewareProviders.add(definition.provider);
6029
+ }
6030
+ if (options.defaultMiddleware && !middlewareProviders.has(options.defaultMiddleware)) {
6031
+ throw new Error(`Default Middleware provider '${options.defaultMiddleware}' is not declared.`);
6032
+ }
6033
+ const appKeys = new Set();
6034
+ var _options_apps;
6035
+ for (const app of (_options_apps = options.apps) != null ? _options_apps : []){
6036
+ if (!TOOL_NAME_PATTERN.test(app.key) || app.key.length > 191) {
6037
+ throw new Error(`MCP App key '${app.key}' is invalid.`);
6038
+ }
6039
+ if (appKeys.has(app.key)) {
6040
+ throw new Error(`MCP App '${app.key}' is declared more than once.`);
6041
+ }
6042
+ if (!isRelativeHtmlEntry(app.entry)) {
6043
+ throw new Error(`MCP App '${app.key}' entry must be a relative HTML path inside the plugin bundle.`);
6044
+ }
6045
+ appKeys.add(app.key);
6046
+ }
6047
+ }
6048
+ function validateToolOptions(options, methodName) {
6049
+ var _options_description;
6050
+ if (!TOOL_NAME_PATTERN.test(options.name) || options.name.length > 191) {
6051
+ throw new Error(`Method '${methodName}' declares invalid Tool name '${options.name}'.`);
6052
+ }
6053
+ if (!((_options_description = options.description) == null ? void 0 : _options_description.trim())) throw new Error(`Tool '${options.name}' requires a description.`);
6054
+ assertStrictObjectSchema(options.inputSchema, options.name, 'input');
6055
+ if (options.mcp && !options.outputSchema) {
6056
+ throw new Error(`MCP Tool '${options.name}' requires an outputSchema.`);
6057
+ }
6058
+ if (options.mcp && options.outputSchema) {
6059
+ assertStrictObjectSchema(options.outputSchema, options.name, 'output');
6060
+ }
6061
+ if (options.mcp && !options.mcp.requiredContext.length) {
6062
+ throw new Error(`MCP Tool '${options.name}' requires at least one execution context.`);
6063
+ }
6064
+ if (options.mcp) {
6065
+ const behavior = options.mcp.behavior;
6066
+ if (!includesValue(contracts.MCP_TOOL_RISKS, behavior == null ? void 0 : behavior.risk) || !includesValue(contracts.MCP_TOOL_SIDE_EFFECTS, behavior == null ? void 0 : behavior.sideEffect) || !includesValue(contracts.MCP_TOOL_IDEMPOTENCY, behavior == null ? void 0 : behavior.idempotency)) {
6067
+ throw new Error(`MCP Tool '${options.name}' requires valid behavior annotations.`);
6068
+ }
6069
+ const contexts = new Set(options.mcp.requiredContext);
6070
+ if (contexts.size !== options.mcp.requiredContext.length || [
6071
+ ...contexts
6072
+ ].some((context)=>!includesValue(contracts.MCP_REQUIRED_CONTEXTS, context))) {
6073
+ throw new Error(`MCP Tool '${options.name}' declares invalid or duplicate execution context requirements.`);
6074
+ }
6075
+ if (options.mcp.visibility && (!options.mcp.visibility.length || new Set(options.mcp.visibility).size !== options.mcp.visibility.length || options.mcp.visibility.some((visibility)=>!includesValue(contracts.MCP_CAPABILITY_VISIBILITIES, visibility)))) {
6076
+ throw new Error(`MCP Tool '${options.name}' declares invalid visibility.`);
6077
+ }
6078
+ if (options.mcp.app && options.mcp.visibility && !options.mcp.visibility.includes('app')) {
6079
+ throw new Error(`MCP Tool '${options.name}' with an App binding must include app visibility.`);
6080
+ }
6081
+ }
6082
+ }
6083
+ function isRelativeHtmlEntry(entry) {
6084
+ if (!entry || !entry.endsWith('.html') || entry.startsWith('/') || entry.includes('\\')) return false;
6085
+ return entry.split('/').every((segment)=>segment !== '.' && segment !== '..' && segment.length > 0);
6086
+ }
6087
+ function assertStrictObjectSchema(schema, toolName, role) {
6088
+ if (!schema || typeof Reflect.get(schema, 'parseAsync') !== 'function') {
6089
+ throw new Error(`Tool '${toolName}' requires a Zod ${role} schema.`);
6090
+ }
6091
+ const definition = Reflect.get(schema, '_def');
6092
+ if (!definition || Reflect.get(definition, 'unknownKeys') !== 'strict') {
6093
+ throw new Error(`Tool '${toolName}' ${role} schema must be a strict Zod object.`);
6094
+ }
6095
+ }
6096
+ function resolveMiddlewareProvider(tool, provider) {
6097
+ if (tool.middleware === false) return undefined;
6098
+ if (typeof tool.middleware === 'string') return tool.middleware;
6099
+ if (tool.middleware === true || tool.middleware === undefined) return provider.defaultMiddleware;
6100
+ return undefined;
6101
+ }
6102
+ function getXpertToolMethod(instance, descriptor) {
6103
+ const method = Reflect.get(instance, descriptor.methodName);
6104
+ if (typeof method !== 'function') {
6105
+ throw new Error(`Decorated Tool method '${descriptor.methodName}' is not callable.`);
6106
+ }
6107
+ return method.bind(instance);
6108
+ }
6109
+ function includesValue(values, value) {
6110
+ return values.some((candidate)=>candidate === value);
6111
+ }
6112
+
6113
+ exports.XpertToolProviderRegistry = class XpertToolProviderRegistry extends BaseStrategyRegistry {
6114
+ upsert(candidate) {
6115
+ const target = resolveStrategyMetadataTarget(candidate);
6116
+ if (!target || !Reflect.getMetadata(XPERT_TOOL_PROVIDER_METADATA, target)) return;
6117
+ const instance = candidate;
6118
+ const descriptor = describeXpertToolProvider(instance);
6119
+ const source = this.getSource(instance);
6120
+ this.assertUniqueClaims(instance, descriptor, source.scopeKey);
6121
+ const previous = this.register(descriptor.options.provider, instance, source);
6122
+ this.replacements.set(instance, previous != null ? previous : null);
6123
+ }
6124
+ rollback(instance) {
6125
+ const descriptor = describeXpertToolProvider(instance);
6126
+ const source = this.getSource(instance);
6127
+ const previous = this.replacements.get(instance);
6128
+ if (previous) {
6129
+ this.register(descriptor.options.provider, previous, this.getSource(previous));
6130
+ } else {
6131
+ this.unregister(descriptor.options.provider, source, instance);
6132
+ }
6133
+ this.replacements.delete(instance);
6134
+ }
6135
+ assertUniqueClaims(instance, descriptor, scopeKey) {
6136
+ var _this_strategies_get;
6137
+ const toolNames = new Set(descriptor.tools.map(({ options })=>options.name));
6138
+ var _this_strategies_get_entries;
6139
+ for (const [providerKey, existing] of (_this_strategies_get_entries = (_this_strategies_get = this.strategies.get(scopeKey)) == null ? void 0 : _this_strategies_get.entries()) != null ? _this_strategies_get_entries : []){
6140
+ if (existing === instance || providerKey === descriptor.options.provider) continue;
6141
+ const existingDescriptor = describeXpertToolProvider(existing);
6142
+ if (existingDescriptor.options.componentKey === descriptor.options.componentKey) {
6143
+ throw new Error(`Component key '${descriptor.options.componentKey}' is already registered for scope '${scopeKey}'.`);
6144
+ }
6145
+ const duplicateTool = existingDescriptor.tools.find(({ options })=>toolNames.has(options.name));
6146
+ if (duplicateTool) {
6147
+ throw new Error(`Tool '${duplicateTool.options.name}' is already registered for scope '${scopeKey}'.`);
6148
+ }
6149
+ }
6150
+ }
6151
+ constructor(discoveryService, reflector){
6152
+ super(XPERT_TOOL_PROVIDER, discoveryService, reflector);
6153
+ this.replacements = new WeakMap();
6154
+ }
6155
+ };
6156
+ exports.XpertToolProviderRegistry = __decorate([
6157
+ common.Injectable(),
6158
+ __metadata("design:paramtypes", [
6159
+ core.DiscoveryService,
6160
+ core.Reflector
6161
+ ])
6162
+ ], exports.XpertToolProviderRegistry);
6163
+
6164
+ class DecoratedToolsetStrategy {
6165
+ validateConfig() {
6166
+ return Promise.resolve();
6167
+ }
6168
+ async create(toolset, params) {
6169
+ return new DecoratedBuiltinToolset(this.instance, this.descriptor, toolset, params, this.pluginName, this.pluginVersion);
6170
+ }
6171
+ createTools() {
6172
+ return [];
6173
+ }
6174
+ constructor(instance, pluginName, pluginVersion){
6175
+ this.instance = instance;
6176
+ this.pluginName = pluginName;
6177
+ this.pluginVersion = pluginVersion;
6178
+ this.descriptor = describeXpertToolProvider(instance);
6179
+ const options = this.descriptor.options;
6180
+ var _options_author, _options_tags, _options_label, _options_configSchema;
6181
+ this.meta = _extends._extends({
6182
+ author: (_options_author = options.author) != null ? _options_author : 'Plugin',
6183
+ tags: [
6184
+ ...(_options_tags = options.tags) != null ? _options_tags : [
6185
+ 'mcp'
6186
+ ]
6187
+ ],
6188
+ name: options.provider,
6189
+ label: (_options_label = options.label) != null ? _options_label : asI18n(options.name)
6190
+ }, options.description ? {
6191
+ description: asI18n(options.description)
6192
+ } : {}, {
6193
+ configSchema: (_options_configSchema = options.configSchema) != null ? _options_configSchema : {
6194
+ type: 'object',
6195
+ properties: {},
6196
+ required: []
6197
+ }
6198
+ }, options.icon ? {
6199
+ icon: options.icon
6200
+ } : {});
6201
+ }
6202
+ }
6203
+ class DecoratedAgentMiddlewareStrategy {
6204
+ getToolNames() {
6205
+ return this.descriptor.tools.filter((item)=>item.middlewareProvider === this.provider).map((item)=>item.options.name);
6206
+ }
6207
+ async createMiddleware(options, context) {
6208
+ const tools = this.descriptor.tools.filter((item)=>item.middlewareProvider === this.provider).map((item)=>createAgentTool(this.instance, item, context, options));
6209
+ const extensions = await (this.instance.getMiddlewareExtensions == null ? void 0 : this.instance.getMiddlewareExtensions.call(this.instance, this.provider, options, context));
6210
+ return _extends._extends({}, extensions != null ? extensions : {}, {
6211
+ name: this.provider,
6212
+ tools
6213
+ });
6214
+ }
6215
+ constructor(instance, descriptor, provider){
6216
+ var _descriptor_options_middlewares;
6217
+ this.instance = instance;
6218
+ this.descriptor = descriptor;
6219
+ this.provider = provider;
6220
+ const definition = (_descriptor_options_middlewares = descriptor.options.middlewares) == null ? void 0 : _descriptor_options_middlewares.find((item)=>item.provider === provider);
6221
+ if (!definition) throw new Error(`Middleware provider '${provider}' is not declared.`);
6222
+ this.meta = definition.meta;
6223
+ }
6224
+ }
6225
+ var _definitions = /*#__PURE__*/ _class_private_field_loose_key("_definitions");
6226
+ let DecoratedBuiltinToolset = class DecoratedBuiltinToolset extends modelProvider.BuiltinToolset {
6227
+ _validateCredentials() {
6228
+ return Promise.resolve();
6229
+ }
6230
+ async initTools() {
6231
+ return this.tools;
6232
+ }
6233
+ getMcpCapabilityDefinitions() {
6234
+ return _class_private_field_loose_base(this, _definitions)[_definitions];
6235
+ }
6236
+ getMcpCapabilitySource() {
6237
+ return _extends._extends({}, this.pluginName ? {
6238
+ pluginName: this.pluginName
6239
+ } : {}, this.pluginVersion ? {
6240
+ pluginVersion: this.pluginVersion
6241
+ } : {});
6242
+ }
6243
+ constructor(instance, descriptor, toolset, params, pluginName, pluginVersion){
6244
+ var _descriptor_options_apps;
6245
+ super(descriptor.options.provider, toolset, params);
6246
+ Object.defineProperty(this, _definitions, {
6247
+ writable: true,
6248
+ value: void 0
6249
+ });
6250
+ this.pluginName = pluginName;
6251
+ this.pluginVersion = pluginVersion;
6252
+ this.tools = [];
6253
+ _class_private_field_loose_base(this, _definitions)[_definitions] = _extends._extends({
6254
+ instructions: descriptor.options.instructions,
6255
+ tools: descriptor.tools.filter((item)=>!!item.options.mcp).map((item)=>createMcpTool(instance, item))
6256
+ }, ((_descriptor_options_apps = descriptor.options.apps) == null ? void 0 : _descriptor_options_apps.length) ? {
6257
+ apps: [
6258
+ ...descriptor.options.apps
6259
+ ]
6260
+ } : {});
6261
+ }
6262
+ };
6263
+ function createAgentTool(instance, descriptor, middlewareContext, middlewareOptions) {
6264
+ const invoke = getXpertToolMethod(instance, descriptor);
6265
+ return tools.tool(async (input, config)=>{
6266
+ const parsedInput = await descriptor.options.inputSchema.parseAsync(input);
6267
+ const output = await invoke(parsedInput, agentExecutionContext(middlewareContext, middlewareOptions, config));
6268
+ const parsedOutput = descriptor.options.outputSchema ? await descriptor.options.outputSchema.parseAsync(output) : output;
6269
+ return stringifyDto(parsedOutput, descriptor.options.name);
6270
+ }, _extends._extends({
6271
+ name: descriptor.options.name,
6272
+ description: descriptor.options.description,
6273
+ schema: descriptor.options.inputSchema,
6274
+ verboseParsingErrors: true
6275
+ }, descriptor.options.metadata ? {
6276
+ metadata: descriptor.options.metadata
6277
+ } : {}));
6278
+ }
6279
+ function createMcpTool(instance, descriptor) {
6280
+ const mcp = descriptor.options.mcp;
6281
+ const outputSchema = descriptor.options.outputSchema;
6282
+ if (!mcp || !outputSchema) throw new Error(`MCP Tool '${descriptor.options.name}' is incomplete.`);
6283
+ const invoke = getXpertToolMethod(instance, descriptor);
6284
+ var _mcp_visibility;
6285
+ return _extends._extends({
6286
+ name: descriptor.options.name
6287
+ }, descriptor.options.title ? {
6288
+ title: descriptor.options.title
6289
+ } : {}, {
6290
+ description: descriptor.options.description,
6291
+ inputSchema: descriptor.options.inputSchema,
6292
+ outputSchema,
6293
+ exposure: {
6294
+ mcp: {
6295
+ eligible: true
6296
+ }
6297
+ },
6298
+ behavior: mcp.behavior,
6299
+ requiredContext: [
6300
+ ...mcp.requiredContext
6301
+ ],
6302
+ visibility: [
6303
+ ...(_mcp_visibility = mcp.visibility) != null ? _mcp_visibility : mcp.app ? [
6304
+ 'model',
6305
+ 'app'
6306
+ ] : [
6307
+ 'model'
6308
+ ]
6309
+ ]
6310
+ }, mcp.app ? {
6311
+ app: {
6312
+ resourceKey: mcp.app.resourceKey
6313
+ }
6314
+ } : {}, {
6315
+ execute: async (input, context)=>{
6316
+ const parsedInput = await descriptor.options.inputSchema.parseAsync(input);
6317
+ const output = await invoke(parsedInput, mcpExecutionContext(context));
6318
+ const parsedOutput = await outputSchema.parseAsync(output);
6319
+ const dto = jsonDto(parsedOutput, descriptor.options.name);
6320
+ var _descriptor_options_title;
6321
+ return {
6322
+ content: [
6323
+ {
6324
+ type: 'text',
6325
+ text: `${(_descriptor_options_title = descriptor.options.title) != null ? _descriptor_options_title : descriptor.options.name} completed. See structuredContent for the result.`
6326
+ }
6327
+ ],
6328
+ structuredContent: dto
6329
+ };
6330
+ }
6331
+ });
6332
+ }
6333
+ function agentExecutionContext(context, middlewareOptions, config) {
6334
+ const configurable = config.configurable;
6335
+ const requestId = readString(configurable, 'tool_call_id');
6336
+ const executionId = readString(configurable, 'executionId');
6337
+ const traceId = readString(configurable, 'traceId');
6338
+ return _extends._extends({
6339
+ surface: 'middleware',
6340
+ tenantId: context.tenantId,
6341
+ organizationId: context.organizationId,
6342
+ principal: {
6343
+ type: 'user',
6344
+ id: context.userId,
6345
+ userId: context.userId
6346
+ },
6347
+ workspaceId: context.workspaceId,
6348
+ projectId: context.projectId,
6349
+ conversationId: context.conversationId,
6350
+ threadId: context.threadId,
6351
+ xpertId: context.xpertId,
6352
+ agentKey: context.agentKey
6353
+ }, executionId ? {
6354
+ executionId
6355
+ } : {}, requestId ? {
6356
+ requestId
6357
+ } : {}, traceId ? {
6358
+ traceId
6359
+ } : {}, {
6360
+ signal: config.signal,
6361
+ host: {
6362
+ models: {
6363
+ createModelClient: context.runtime.createModelClient,
6364
+ getModelProvider: context.runtime.getModelProvider
6365
+ }
6366
+ },
6367
+ middlewareOptions
6368
+ });
6369
+ }
6370
+ function mcpExecutionContext(context) {
6371
+ return {
6372
+ surface: 'mcp',
6373
+ tenantId: context.tenantId,
6374
+ organizationId: context.organizationId,
6375
+ principal: context.principal,
6376
+ workspaceId: context.workspaceId,
6377
+ projectId: context.projectId,
6378
+ conversationId: context.conversationId,
6379
+ threadId: readString(context, 'threadId'),
6380
+ xpertId: context.xpertId,
6381
+ agentKey: context.agentKey,
6382
+ executionId: context.executionId,
6383
+ requestId: context.requestId,
6384
+ traceId: context.traceId,
6385
+ signal: context.signal,
6386
+ host: context.host
6387
+ };
6388
+ }
6389
+ function stringifyDto(value, toolName) {
6390
+ const result = JSON.stringify(value);
6391
+ if (result === undefined) throw new Error(`Tool '${toolName}' returned a non-JSON value.`);
6392
+ return result;
6393
+ }
6394
+ function jsonDto(value, toolName) {
6395
+ return JSON.parse(stringifyDto(value, toolName));
6396
+ }
6397
+ function asI18n(value) {
6398
+ return {
6399
+ en_US: value,
6400
+ zh_Hans: value
6401
+ };
6402
+ }
6403
+ function readString(value, key) {
6404
+ if (!value || typeof value !== 'object') return undefined;
6405
+ const field = Reflect.get(value, key);
6406
+ return typeof field === 'string' && field ? field : undefined;
6407
+ }
6408
+
6409
+ /** Expands one decorated business provider into the existing Toolset and Middleware registries. */ exports.XpertToolProviderCoordinator = class XpertToolProviderCoordinator {
6410
+ onModuleInit() {
6411
+ this.subscription = this.bus.events$.subscribe((event)=>{
6412
+ if (event.type === 'UPSERT' && event.strategyType === XPERT_TOOL_PROVIDER) {
6413
+ this.expand(event.entry.instance);
6414
+ }
6415
+ });
6416
+ for (const wrapper of this.discovery.getProviders()){
6417
+ if (wrapper.instance) this.expand(wrapper.instance);
6418
+ }
6419
+ }
6420
+ onModuleDestroy() {
6421
+ var _this_subscription;
6422
+ (_this_subscription = this.subscription) == null ? void 0 : _this_subscription.unsubscribe();
6423
+ }
6424
+ expand(candidate) {
6425
+ if (!candidate || typeof candidate !== 'object' && typeof candidate !== 'function') return;
6426
+ const instance = candidate;
6427
+ if (this.processed.has(instance)) return;
6428
+ const target = resolveStrategyMetadataTarget(instance);
6429
+ if (!target || !Reflect.getMetadata(XPERT_TOOL_PROVIDER_METADATA, target)) return;
6430
+ const provider = instance;
6431
+ const descriptor = describeXpertToolProvider(provider);
6432
+ const source = this.providerRegistry.getSource(provider);
6433
+ const pluginName = source.kind === 'plugin' ? source.pluginName : undefined;
6434
+ const pluginVersion = source.kind === 'plugin' ? source.pluginVersion : undefined;
6435
+ const toolsetAdapter = new DecoratedToolsetStrategy(provider, pluginName, pluginVersion);
6436
+ var _descriptor_options_middlewares;
6437
+ const middlewareAdapters = ((_descriptor_options_middlewares = descriptor.options.middlewares) != null ? _descriptor_options_middlewares : []).filter((definition)=>descriptor.tools.some((item)=>item.middlewareProvider === definition.provider)).map((definition)=>({
6438
+ provider: definition.provider,
6439
+ strategy: new DecoratedAgentMiddlewareStrategy(provider, descriptor, definition.provider)
6440
+ }));
6441
+ try {
6442
+ this.toolsetRegistry.assertCanRegister(descriptor.options.provider, toolsetAdapter, source);
6443
+ for (const adapter of middlewareAdapters){
6444
+ this.middlewareRegistry.assertCanRegister(adapter.provider, adapter.strategy, source);
6445
+ }
6446
+ } catch (error) {
6447
+ this.providerRegistry.rollback(provider);
6448
+ throw error;
6449
+ }
6450
+ this.toolsetRegistry.register(descriptor.options.provider, toolsetAdapter, source);
6451
+ for (const adapter of middlewareAdapters){
6452
+ this.middlewareRegistry.register(adapter.provider, adapter.strategy, source);
6453
+ }
6454
+ this.processed.add(instance);
6455
+ }
6456
+ constructor(discovery, bus, providerRegistry, toolsetRegistry, middlewareRegistry){
6457
+ this.processed = new WeakSet();
6458
+ this.discovery = discovery;
6459
+ this.bus = bus;
6460
+ this.providerRegistry = providerRegistry;
6461
+ this.toolsetRegistry = toolsetRegistry;
6462
+ this.middlewareRegistry = middlewareRegistry;
6463
+ }
6464
+ };
6465
+ exports.XpertToolProviderCoordinator = __decorate([
6466
+ common.Injectable(),
6467
+ __metadata("design:paramtypes", [
6468
+ core.DiscoveryService,
6469
+ exports.StrategyBus,
6470
+ exports.XpertToolProviderRegistry,
6471
+ exports.ToolsetRegistry,
6472
+ exports.AgentMiddlewareRegistry
6473
+ ])
6474
+ ], exports.XpertToolProviderCoordinator);
6475
+
5852
6476
  Object.defineProperty(exports, "ASSISTANT_CHAT_SEND_MESSAGE_COMMAND", {
5853
6477
  enumerable: true,
5854
6478
  get: function () { return contracts.ASSISTANT_CHAT_SEND_MESSAGE_COMMAND; }
@@ -5869,6 +6493,7 @@ exports.KnowledgebaseDocumentsRuntimeCapability = modelProvider.KnowledgebaseDoc
5869
6493
  exports.KnowledgebaseProvisioningRuntimeCapability = modelProvider.KnowledgebaseProvisioningRuntimeCapability;
5870
6494
  exports.KnowledgebaseRuntimeCapability = modelProvider.KnowledgebaseRuntimeCapability;
5871
6495
  exports.ModelProviderBuiltinToolset = modelProvider.ModelProviderBuiltinToolset;
6496
+ exports.ProjectAccessRuntimeCapability = modelProvider.ProjectAccessRuntimeCapability;
5872
6497
  exports.ProjectProvisioningRuntimeCapability = modelProvider.ProjectProvisioningRuntimeCapability;
5873
6498
  exports.SANDBOX_JOB_ERROR_CODES = modelProvider.SANDBOX_JOB_ERROR_CODES;
5874
6499
  exports.SANDBOX_JOB_PROGRESS_PREFIX = modelProvider.SANDBOX_JOB_PROGRESS_PREFIX;
@@ -5940,6 +6565,8 @@ exports.DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC = DEFAULT_SANDBOX_SHELL_TIMEOUT_SEC;
5940
6565
  exports.DOCUMENT_SOURCE_STRATEGY = DOCUMENT_SOURCE_STRATEGY;
5941
6566
  exports.DOCUMENT_TRANSFORMER_STRATEGY = DOCUMENT_TRANSFORMER_STRATEGY;
5942
6567
  exports.DataSourceStrategy = DataSourceStrategy;
6568
+ exports.DecoratedAgentMiddlewareStrategy = DecoratedAgentMiddlewareStrategy;
6569
+ exports.DecoratedToolsetStrategy = DecoratedToolsetStrategy;
5943
6570
  exports.DocumentSourceStrategy = DocumentSourceStrategy;
5944
6571
  exports.DocumentTransformerStrategy = DocumentTransformerStrategy;
5945
6572
  exports.EVOLUTION_RUNTIME_SERVICE_TOKEN = EVOLUTION_RUNTIME_SERVICE_TOKEN;
@@ -6039,8 +6666,13 @@ exports.WorkflowNodeStrategy = WorkflowNodeStrategy;
6039
6666
  exports.WorkflowTriggerStrategy = WorkflowTriggerStrategy;
6040
6667
  exports.WrapWorkflowNodeExecutionCommand = WrapWorkflowNodeExecutionCommand;
6041
6668
  exports.XPERT_AGENT_MIDDLEWARE_RUNTIME_TOKEN = XPERT_AGENT_MIDDLEWARE_RUNTIME_TOKEN;
6669
+ exports.XPERT_TOOL_METHOD_METADATA = XPERT_TOOL_METHOD_METADATA;
6670
+ exports.XPERT_TOOL_PROVIDER = XPERT_TOOL_PROVIDER;
6671
+ exports.XPERT_TOOL_PROVIDER_METADATA = XPERT_TOOL_PROVIDER_METADATA;
6042
6672
  exports.XpFileSystem = XpFileSystem;
6043
6673
  exports.XpertServerPlugin = XpertServerPlugin;
6674
+ exports.XpertTool = XpertTool;
6675
+ exports.XpertToolProvider = XpertToolProvider;
6044
6676
  exports.als = als;
6045
6677
  exports.appendSandboxMessage = appendSandboxMessage;
6046
6678
  exports.buildSandboxTimeoutMessage = buildSandboxTimeoutMessage;
@@ -6061,6 +6693,7 @@ exports.defineMcpResource = defineMcpResource;
6061
6693
  exports.defineMcpResourceTemplate = defineMcpResourceTemplate;
6062
6694
  exports.defineXpertTool = defineXpertTool;
6063
6695
  exports.derivePluginArtifactNamespace = derivePluginArtifactNamespace;
6696
+ exports.describeXpertToolProvider = describeXpertToolProvider;
6064
6697
  exports.downloadRemoteFile = downloadRemoteFile;
6065
6698
  exports.formatSandboxTimeout = formatSandboxTimeout;
6066
6699
  exports.getDefaultTenantId = getDefaultTenantId;
@@ -6072,6 +6705,7 @@ exports.getPositionMap = getPositionMap;
6072
6705
  exports.getRequestContext = getRequestContext;
6073
6706
  exports.getRequiredPermissionOperation = getRequiredPermissionOperation;
6074
6707
  exports.getTenantGlobalScopeKey = getTenantGlobalScopeKey;
6708
+ exports.getXpertToolMethod = getXpertToolMethod;
6075
6709
  exports.isDevelopmentSandboxRuntimeEnvironment = isDevelopmentSandboxRuntimeEnvironment;
6076
6710
  exports.isModelOutputValidationError = isModelOutputValidationError;
6077
6711
  exports.isModelUsagePricingConfig = isModelUsagePricingConfig;