@xpert-ai/contracts 3.15.7 → 3.15.8

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
@@ -87,13 +87,13 @@ function resolveI18nText(value) {
87
87
  return null;
88
88
  }
89
89
 
90
- function _array_like_to_array$7(arr, len) {
90
+ function _array_like_to_array$8(arr, len) {
91
91
  if (len == null || len > arr.length) len = arr.length;
92
92
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
93
93
  return arr2;
94
94
  }
95
95
  function _array_without_holes$3(arr) {
96
- if (Array.isArray(arr)) return _array_like_to_array$7(arr);
96
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
97
97
  }
98
98
  function _iterable_to_array$4(iter) {
99
99
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
@@ -102,15 +102,15 @@ function _non_iterable_spread$3() {
102
102
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
103
103
  }
104
104
  function _to_consumable_array$3(arr) {
105
- return _array_without_holes$3(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$3();
105
+ return _array_without_holes$3(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$3();
106
106
  }
107
- function _unsupported_iterable_to_array$7(o, minLen) {
107
+ function _unsupported_iterable_to_array$8(o, minLen) {
108
108
  if (!o) return;
109
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
109
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
110
110
  var n = Object.prototype.toString.call(o).slice(8, -1);
111
111
  if (n === "Object" && o.constructor) n = o.constructor.name;
112
112
  if (n === "Map" || n === "Set") return Array.from(n);
113
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
113
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
114
114
  }
115
115
  var _uuidGenerator;
116
116
  var uuidGenerator = new ShortUniqueId({
@@ -1628,16 +1628,16 @@ function toIsoString(value) {
1628
1628
  return new Date().toISOString();
1629
1629
  }
1630
1630
 
1631
- function _array_like_to_array$6(arr, len) {
1631
+ function _array_like_to_array$7(arr, len) {
1632
1632
  if (len == null || len > arr.length) len = arr.length;
1633
1633
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1634
1634
  return arr2;
1635
1635
  }
1636
- function _array_with_holes$5(arr) {
1636
+ function _array_with_holes$6(arr) {
1637
1637
  if (Array.isArray(arr)) return arr;
1638
1638
  }
1639
1639
  function _array_without_holes$2(arr) {
1640
- if (Array.isArray(arr)) return _array_like_to_array$6(arr);
1640
+ if (Array.isArray(arr)) return _array_like_to_array$7(arr);
1641
1641
  }
1642
1642
  function _define_property$8(obj, key, value) {
1643
1643
  if (key in obj) {
@@ -1655,7 +1655,7 @@ function _define_property$8(obj, key, value) {
1655
1655
  function _iterable_to_array$3(iter) {
1656
1656
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1657
1657
  }
1658
- function _iterable_to_array_limit$4(arr, i) {
1658
+ function _iterable_to_array_limit$5(arr, i) {
1659
1659
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1660
1660
  if (_i == null) return;
1661
1661
  var _arr = [];
@@ -1679,7 +1679,7 @@ function _iterable_to_array_limit$4(arr, i) {
1679
1679
  }
1680
1680
  return _arr;
1681
1681
  }
1682
- function _non_iterable_rest$5() {
1682
+ function _non_iterable_rest$6() {
1683
1683
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1684
1684
  }
1685
1685
  function _non_iterable_spread$2() {
@@ -1719,19 +1719,19 @@ function _object_spread_props$6(target, source) {
1719
1719
  }
1720
1720
  return target;
1721
1721
  }
1722
- function _sliced_to_array$4(arr, i) {
1723
- return _array_with_holes$5(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$5();
1722
+ function _sliced_to_array$5(arr, i) {
1723
+ return _array_with_holes$6(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$6();
1724
1724
  }
1725
1725
  function _to_consumable_array$2(arr) {
1726
- return _array_without_holes$2(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$2();
1726
+ return _array_without_holes$2(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$2();
1727
1727
  }
1728
- function _unsupported_iterable_to_array$6(o, minLen) {
1728
+ function _unsupported_iterable_to_array$7(o, minLen) {
1729
1729
  if (!o) return;
1730
- if (typeof o === "string") return _array_like_to_array$6(o, minLen);
1730
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
1731
1731
  var n = Object.prototype.toString.call(o).slice(8, -1);
1732
1732
  if (n === "Object" && o.constructor) n = o.constructor.name;
1733
1733
  if (n === "Map" || n === "Set") return Array.from(n);
1734
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
1734
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
1735
1735
  }
1736
1736
  exports.AssistantCode = void 0;
1737
1737
  (function(AssistantCode) {
@@ -1789,7 +1789,7 @@ function normalizeAssistantBindingToolPreferences(value) {
1789
1789
  }
1790
1790
  var _value_toolsets;
1791
1791
  var toolsets = Object.entries((_value_toolsets = value.toolsets) !== null && _value_toolsets !== void 0 ? _value_toolsets : {}).reduce(function(acc, param) {
1792
- var _param = _sliced_to_array$4(param, 2), key = _param[0], item = _param[1];
1792
+ var _param = _sliced_to_array$5(param, 2), key = _param[0], item = _param[1];
1793
1793
  var nodeKey = normalizeAssistantBindingPreferenceKey(key);
1794
1794
  var toolsetName = normalizeAssistantBindingPreferenceKey(item === null || item === void 0 ? void 0 : item.toolsetName);
1795
1795
  if (!nodeKey || !toolsetName) {
@@ -1804,7 +1804,7 @@ function normalizeAssistantBindingToolPreferences(value) {
1804
1804
  }, {});
1805
1805
  var _value_middlewares;
1806
1806
  var middlewares = Object.entries((_value_middlewares = value.middlewares) !== null && _value_middlewares !== void 0 ? _value_middlewares : {}).reduce(function(acc, param) {
1807
- var _param = _sliced_to_array$4(param, 2), key = _param[0], item = _param[1];
1807
+ var _param = _sliced_to_array$5(param, 2), key = _param[0], item = _param[1];
1808
1808
  var nodeKey = normalizeAssistantBindingPreferenceKey(key);
1809
1809
  var provider = normalizeAssistantBindingPreferenceKey(item === null || item === void 0 ? void 0 : item.provider);
1810
1810
  if (!nodeKey || !provider) {
@@ -1818,7 +1818,7 @@ function normalizeAssistantBindingToolPreferences(value) {
1818
1818
  }, {});
1819
1819
  var _value_skills;
1820
1820
  var skills = Object.entries((_value_skills = value.skills) !== null && _value_skills !== void 0 ? _value_skills : {}).reduce(function(acc, param) {
1821
- var _param = _sliced_to_array$4(param, 2), key = _param[0], item = _param[1];
1821
+ var _param = _sliced_to_array$5(param, 2), key = _param[0], item = _param[1];
1822
1822
  var workspaceKey = normalizeAssistantBindingPreferenceKey(key);
1823
1823
  var workspaceId = normalizeAssistantBindingPreferenceKey(item === null || item === void 0 ? void 0 : item.workspaceId) || workspaceKey;
1824
1824
  if (!workspaceKey || !workspaceId) {
@@ -2173,12 +2173,14 @@ exports.AiFeatureEnum = void 0;
2173
2173
  AiFeatureEnum["FEATURE_COPILOT_KNOWLEDGEBASE"] = "FEATURE_COPILOT_KNOWLEDGEBASE";
2174
2174
  AiFeatureEnum["FEATURE_COPILOT_CHAT"] = "FEATURE_COPILOT_CHAT";
2175
2175
  AiFeatureEnum["FEATURE_COPILOT_MONITORING"] = "FEATURE_COPILOT_MONITORING";
2176
+ AiFeatureEnum["FEATURE_MEMBERSHIP_PLAN"] = "FEATURE_MEMBERSHIP_PLAN";
2176
2177
  AiFeatureEnum["FEATURE_XPERT"] = "FEATURE_XPERT";
2177
2178
  AiFeatureEnum["FEATURE_XPERT_CHATBI"] = "FEATURE_XPERT_CHATBI";
2178
2179
  AiFeatureEnum["FEATURE_XPERT_CLAWXPERT"] = "FEATURE_XPERT_CLAWXPERT";
2179
2180
  AiFeatureEnum["FEATURE_XPERT_CODEXPERT"] = "FEATURE_XPERT_CODEXPERT";
2180
2181
  AiFeatureEnum["FEATURE_XPERT_DEEP_RESEARCH"] = "FEATURE_XPERT_DEEP_RESEARCH";
2181
2182
  AiFeatureEnum["FEATURE_XPERT_DATA_ONTOLOGY"] = "FEATURE_XPERT_DATA_ONTOLOGY";
2183
+ AiFeatureEnum["FEATURE_XPERT_MARKETPLACE"] = "FEATURE_XPERT_MARKETPLACE";
2182
2184
  })(exports.AiFeatureEnum || (exports.AiFeatureEnum = {}));
2183
2185
 
2184
2186
  exports.MembershipPlanStatusEnum = void 0;
@@ -2555,12 +2557,12 @@ var VariableOperations = [
2555
2557
  }
2556
2558
  ];
2557
2559
 
2558
- function _array_like_to_array$5(arr, len) {
2560
+ function _array_like_to_array$6(arr, len) {
2559
2561
  if (len == null || len > arr.length) len = arr.length;
2560
2562
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2561
2563
  return arr2;
2562
2564
  }
2563
- function _array_with_holes$4(arr) {
2565
+ function _array_with_holes$5(arr) {
2564
2566
  if (Array.isArray(arr)) return arr;
2565
2567
  }
2566
2568
  function _define_property$6(obj, key, value) {
@@ -2576,7 +2578,7 @@ function _define_property$6(obj, key, value) {
2576
2578
  }
2577
2579
  return obj;
2578
2580
  }
2579
- function _iterable_to_array_limit$3(arr, i) {
2581
+ function _iterable_to_array_limit$4(arr, i) {
2580
2582
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2581
2583
  if (_i == null) return;
2582
2584
  var _arr = [];
@@ -2600,7 +2602,7 @@ function _iterable_to_array_limit$3(arr, i) {
2600
2602
  }
2601
2603
  return _arr;
2602
2604
  }
2603
- function _non_iterable_rest$4() {
2605
+ function _non_iterable_rest$5() {
2604
2606
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2605
2607
  }
2606
2608
  function _object_spread$5(target) {
@@ -2637,16 +2639,16 @@ function _object_spread_props$4(target, source) {
2637
2639
  }
2638
2640
  return target;
2639
2641
  }
2640
- function _sliced_to_array$3(arr, i) {
2641
- return _array_with_holes$4(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$4();
2642
+ function _sliced_to_array$4(arr, i) {
2643
+ return _array_with_holes$5(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$5();
2642
2644
  }
2643
- function _unsupported_iterable_to_array$5(o, minLen) {
2645
+ function _unsupported_iterable_to_array$6(o, minLen) {
2644
2646
  if (!o) return;
2645
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
2647
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
2646
2648
  var n = Object.prototype.toString.call(o).slice(8, -1);
2647
2649
  if (n === "Object" && o.constructor) n = o.constructor.name;
2648
2650
  if (n === "Map" || n === "Set") return Array.from(n);
2649
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
2651
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
2650
2652
  }
2651
2653
  /**
2652
2654
  * @deprecated can use getCurrentTaskInput instead?
@@ -2728,7 +2730,7 @@ function configurableStoreNamespace(configurable) {
2728
2730
  * @param value
2729
2731
  * @returns
2730
2732
  */ function setStateVariable(state, varName, value) {
2731
- var _varName_split = _sliced_to_array$3(varName.split("."), 2), agentChannelName = _varName_split[0], variableName = _varName_split[1];
2733
+ var _varName_split = _sliced_to_array$4(varName.split("."), 2), agentChannelName = _varName_split[0], variableName = _varName_split[1];
2732
2734
  if (variableName) {
2733
2735
  var _state_agentChannelName;
2734
2736
  state[agentChannelName] = _object_spread_props$4(_object_spread$5({}, (_state_agentChannelName = state[agentChannelName]) !== null && _state_agentChannelName !== void 0 ? _state_agentChannelName : {}), _define_property$6({}, variableName, value));
@@ -3322,14 +3324,190 @@ function genXpertDBSqlKey() {
3322
3324
  return letterStartSUID("DBSql_");
3323
3325
  }
3324
3326
 
3327
+ var XpertMarketplaceBusinessCategories = [
3328
+ "knowledge-management",
3329
+ "sales-growth",
3330
+ "data-analysis",
3331
+ "workflow-automation",
3332
+ "legal-compliance",
3333
+ "content-creation",
3334
+ "customer-service"
3335
+ ];
3336
+ var XpertMarketplaceCollaborationModes = [
3337
+ "single-agent",
3338
+ "multi-agent",
3339
+ "human-in-loop"
3340
+ ];
3341
+ var XpertMarketplaceTechnicalCategories = [
3342
+ "knowledge-retrieval",
3343
+ "tool-calling",
3344
+ "workflow",
3345
+ "external-xpert",
3346
+ "file-understanding",
3347
+ "sandbox",
3348
+ "trigger",
3349
+ "http",
3350
+ "code",
3351
+ "database",
3352
+ "structured-output"
3353
+ ];
3354
+ exports.XpertAccessRequestStatusEnum = void 0;
3355
+ (function(XpertAccessRequestStatusEnum) {
3356
+ XpertAccessRequestStatusEnum["REQUESTED"] = "requested";
3357
+ XpertAccessRequestStatusEnum["APPROVED"] = "approved";
3358
+ XpertAccessRequestStatusEnum["REJECTED"] = "rejected";
3359
+ })(exports.XpertAccessRequestStatusEnum || (exports.XpertAccessRequestStatusEnum = {}));
3360
+ var databaseWorkflowTypes = new Set([
3361
+ exports.WorkflowNodeTypeEnum.DB_SQL,
3362
+ exports.WorkflowNodeTypeEnum.DB_INSERT,
3363
+ exports.WorkflowNodeTypeEnum.DB_UPDATE,
3364
+ exports.WorkflowNodeTypeEnum.DB_DELETE,
3365
+ exports.WorkflowNodeTypeEnum.DB_QUERY
3366
+ ]);
3367
+ function addUnique(items, item) {
3368
+ if (!items.includes(item)) {
3369
+ items.push(item);
3370
+ }
3371
+ }
3372
+ function hasEnabledFileUnderstanding(node) {
3373
+ var _node_entity_options_fileUnderstanding, _node_entity_options, _node_entity_options_attachment, _node_entity_options1;
3374
+ return ((_node_entity_options = node.entity.options) === null || _node_entity_options === void 0 ? void 0 : (_node_entity_options_fileUnderstanding = _node_entity_options.fileUnderstanding) === null || _node_entity_options_fileUnderstanding === void 0 ? void 0 : _node_entity_options_fileUnderstanding.enabled) === true || ((_node_entity_options1 = node.entity.options) === null || _node_entity_options1 === void 0 ? void 0 : (_node_entity_options_attachment = _node_entity_options1.attachment) === null || _node_entity_options_attachment === void 0 ? void 0 : _node_entity_options_attachment.enabled) === true;
3375
+ }
3376
+ function hasStructuredOutput(node) {
3377
+ var _node_entity_outputVariables, _node_entity_options;
3378
+ return !!((_node_entity_outputVariables = node.entity.outputVariables) === null || _node_entity_outputVariables === void 0 ? void 0 : _node_entity_outputVariables.length) || !!((_node_entity_options = node.entity.options) === null || _node_entity_options === void 0 ? void 0 : _node_entity_options.structuredOutputMethod);
3379
+ }
3380
+ function deriveXpertMarketplaceTechnicalProfile(draft) {
3381
+ var _draft_team_features_sandbox, _draft_team_features, _draft_team_agentConfig_interruptBefore, _draft_team_agentConfig;
3382
+ var _draft_nodes;
3383
+ var nodes = (_draft_nodes = draft === null || draft === void 0 ? void 0 : draft.nodes) !== null && _draft_nodes !== void 0 ? _draft_nodes : [];
3384
+ var _draft_connections;
3385
+ var connections = (_draft_connections = draft === null || draft === void 0 ? void 0 : draft.connections) !== null && _draft_connections !== void 0 ? _draft_connections : [];
3386
+ var categories = [];
3387
+ var workflowNodeTypes = [];
3388
+ var agentNodes = nodes.filter(function(node) {
3389
+ return node.type === "agent";
3390
+ });
3391
+ var knowledgebaseCount = nodes.filter(function(node) {
3392
+ return node.type === "knowledge";
3393
+ }).length;
3394
+ var toolsetCount = nodes.filter(function(node) {
3395
+ return node.type === "toolset";
3396
+ }).length;
3397
+ var externalXpertCount = nodes.filter(function(node) {
3398
+ return node.type === "xpert";
3399
+ }).length;
3400
+ var workflowNodes = nodes.filter(function(node) {
3401
+ return node.type === "workflow";
3402
+ });
3403
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
3404
+ try {
3405
+ for(var _iterator = workflowNodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
3406
+ var node = _step.value;
3407
+ addUnique(workflowNodeTypes, node.entity.type);
3408
+ }
3409
+ } catch (err) {
3410
+ _didIteratorError = true;
3411
+ _iteratorError = err;
3412
+ } finally{
3413
+ try {
3414
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
3415
+ _iterator.return();
3416
+ }
3417
+ } finally{
3418
+ if (_didIteratorError) {
3419
+ throw _iteratorError;
3420
+ }
3421
+ }
3422
+ }
3423
+ if (knowledgebaseCount > 0 || workflowNodeTypes.includes(exports.WorkflowNodeTypeEnum.KNOWLEDGE)) {
3424
+ addUnique(categories, "knowledge-retrieval");
3425
+ }
3426
+ if (toolsetCount > 0 || workflowNodeTypes.includes(exports.WorkflowNodeTypeEnum.TOOL) || workflowNodeTypes.includes(exports.WorkflowNodeTypeEnum.AGENT_TOOL)) {
3427
+ addUnique(categories, "tool-calling");
3428
+ }
3429
+ if (workflowNodes.length > 0 || connections.some(function(connection) {
3430
+ return connection.type === "edge";
3431
+ })) {
3432
+ addUnique(categories, "workflow");
3433
+ }
3434
+ if (externalXpertCount > 0 || connections.some(function(connection) {
3435
+ return connection.type === "xpert";
3436
+ })) {
3437
+ addUnique(categories, "external-xpert");
3438
+ }
3439
+ if (agentNodes.some(hasEnabledFileUnderstanding)) {
3440
+ addUnique(categories, "file-understanding");
3441
+ }
3442
+ if (draft === null || draft === void 0 ? void 0 : (_draft_team_features = draft.team.features) === null || _draft_team_features === void 0 ? void 0 : (_draft_team_features_sandbox = _draft_team_features.sandbox) === null || _draft_team_features_sandbox === void 0 ? void 0 : _draft_team_features_sandbox.enabled) {
3443
+ addUnique(categories, "sandbox");
3444
+ }
3445
+ if (workflowNodeTypes.includes(exports.WorkflowNodeTypeEnum.TRIGGER)) {
3446
+ addUnique(categories, "trigger");
3447
+ }
3448
+ if (workflowNodeTypes.includes(exports.WorkflowNodeTypeEnum.HTTP)) {
3449
+ addUnique(categories, "http");
3450
+ }
3451
+ if (workflowNodeTypes.includes(exports.WorkflowNodeTypeEnum.CODE)) {
3452
+ addUnique(categories, "code");
3453
+ }
3454
+ if (workflowNodeTypes.some(function(type) {
3455
+ return databaseWorkflowTypes.has(type);
3456
+ })) {
3457
+ addUnique(categories, "database");
3458
+ }
3459
+ if (agentNodes.some(hasStructuredOutput)) {
3460
+ addUnique(categories, "structured-output");
3461
+ }
3462
+ var collaborationModes = [];
3463
+ if (agentNodes.length > 1 || externalXpertCount > 0 || connections.some(function(connection) {
3464
+ return connection.type === "agent";
3465
+ })) {
3466
+ addUnique(collaborationModes, "multi-agent");
3467
+ } else {
3468
+ addUnique(collaborationModes, "single-agent");
3469
+ }
3470
+ if (draft === null || draft === void 0 ? void 0 : (_draft_team_agentConfig = draft.team.agentConfig) === null || _draft_team_agentConfig === void 0 ? void 0 : (_draft_team_agentConfig_interruptBefore = _draft_team_agentConfig.interruptBefore) === null || _draft_team_agentConfig_interruptBefore === void 0 ? void 0 : _draft_team_agentConfig_interruptBefore.length) {
3471
+ addUnique(collaborationModes, "human-in-loop");
3472
+ }
3473
+ return {
3474
+ agentCount: agentNodes.length,
3475
+ toolsetCount: toolsetCount,
3476
+ knowledgebaseCount: knowledgebaseCount,
3477
+ externalXpertCount: externalXpertCount,
3478
+ workflowNodeCount: workflowNodes.length,
3479
+ workflowNodeTypes: workflowNodeTypes,
3480
+ categories: categories,
3481
+ collaborationModes: collaborationModes
3482
+ };
3483
+ }
3484
+ function buildXpertMarketplaceProfileSnapshot(input, draft) {
3485
+ var _input_summary, _input_capabilityTags;
3486
+ var technical = deriveXpertMarketplaceTechnicalProfile(draft);
3487
+ var summary = (input === null || input === void 0 ? void 0 : (_input_summary = input.summary) === null || _input_summary === void 0 ? void 0 : _input_summary.trim()) || null;
3488
+ var _input_capabilityTags_map_filter;
3489
+ var capabilityTags = Array.from(new Set((_input_capabilityTags_map_filter = input === null || input === void 0 ? void 0 : (_input_capabilityTags = input.capabilityTags) === null || _input_capabilityTags === void 0 ? void 0 : _input_capabilityTags.map(function(tag) {
3490
+ return tag.trim();
3491
+ }).filter(Boolean)) !== null && _input_capabilityTags_map_filter !== void 0 ? _input_capabilityTags_map_filter : []));
3492
+ var _input_businessCategories;
3493
+ return {
3494
+ summary: summary,
3495
+ businessCategories: (_input_businessCategories = input === null || input === void 0 ? void 0 : input.businessCategories) !== null && _input_businessCategories !== void 0 ? _input_businessCategories : [],
3496
+ capabilityTags: capabilityTags,
3497
+ collaborationModes: technical.collaborationModes,
3498
+ technical: technical,
3499
+ featured: (input === null || input === void 0 ? void 0 : input.featured) === true
3500
+ };
3501
+ }
3502
+
3325
3503
  // Helpers
3326
- function _array_like_to_array$4(arr, len) {
3504
+ function _array_like_to_array$5(arr, len) {
3327
3505
  if (len == null || len > arr.length) len = arr.length;
3328
3506
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
3329
3507
  return arr2;
3330
3508
  }
3331
3509
  function _array_without_holes$1(arr) {
3332
- if (Array.isArray(arr)) return _array_like_to_array$4(arr);
3510
+ if (Array.isArray(arr)) return _array_like_to_array$5(arr);
3333
3511
  }
3334
3512
  function _define_property$4(obj, key, value) {
3335
3513
  if (key in obj) {
@@ -3412,15 +3590,15 @@ function _object_without_properties_loose$1(source, excluded) {
3412
3590
  return target;
3413
3591
  }
3414
3592
  function _to_consumable_array$1(arr) {
3415
- return _array_without_holes$1(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$1();
3593
+ return _array_without_holes$1(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$1();
3416
3594
  }
3417
- function _unsupported_iterable_to_array$4(o, minLen) {
3595
+ function _unsupported_iterable_to_array$5(o, minLen) {
3418
3596
  if (!o) return;
3419
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
3597
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
3420
3598
  var n = Object.prototype.toString.call(o).slice(8, -1);
3421
3599
  if (n === "Object" && o.constructor) n = o.constructor.name;
3422
3600
  if (n === "Map" || n === "Set") return Array.from(n);
3423
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
3601
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
3424
3602
  }
3425
3603
  function omitXpertRelations(xpert) {
3426
3604
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -4097,6 +4275,317 @@ function genXpertSkillKey() {
4097
4275
  return letterStartSUID("Skill_");
4098
4276
  }
4099
4277
 
4278
+ function _array_like_to_array$4(arr, len) {
4279
+ if (len == null || len > arr.length) len = arr.length;
4280
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4281
+ return arr2;
4282
+ }
4283
+ function _array_with_holes$4(arr) {
4284
+ if (Array.isArray(arr)) return arr;
4285
+ }
4286
+ function _iterable_to_array_limit$3(arr, i) {
4287
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
4288
+ if (_i == null) return;
4289
+ var _arr = [];
4290
+ var _n = true;
4291
+ var _d = false;
4292
+ var _s, _e;
4293
+ try {
4294
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
4295
+ _arr.push(_s.value);
4296
+ if (i && _arr.length === i) break;
4297
+ }
4298
+ } catch (err) {
4299
+ _d = true;
4300
+ _e = err;
4301
+ } finally{
4302
+ try {
4303
+ if (!_n && _i["return"] != null) _i["return"]();
4304
+ } finally{
4305
+ if (_d) throw _e;
4306
+ }
4307
+ }
4308
+ return _arr;
4309
+ }
4310
+ function _non_iterable_rest$4() {
4311
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4312
+ }
4313
+ function _sliced_to_array$3(arr, i) {
4314
+ return _array_with_holes$4(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
4315
+ }
4316
+ function _unsupported_iterable_to_array$4(o, minLen) {
4317
+ if (!o) return;
4318
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
4319
+ var n = Object.prototype.toString.call(o).slice(8, -1);
4320
+ if (n === "Object" && o.constructor) n = o.constructor.name;
4321
+ if (n === "Map" || n === "Set") return Array.from(n);
4322
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
4323
+ }
4324
+ var IGNORED_BOOLEAN_FLAGS = new Set([
4325
+ "-y",
4326
+ "--yes",
4327
+ "-g",
4328
+ "--global",
4329
+ "--copy"
4330
+ ]);
4331
+ var REJECTED_FLAGS = new Set([
4332
+ "--list",
4333
+ "-l"
4334
+ ]);
4335
+ function parseGithubSkillInstallCommand(input) {
4336
+ var tokens = tokenizeShellLike(input);
4337
+ if (!tokens.length) {
4338
+ throw new Error("GitHub skill install command is required");
4339
+ }
4340
+ var index = readCommandPrefix(tokens);
4341
+ var source = null;
4342
+ var branch = "";
4343
+ var repositoryPath = "";
4344
+ var skills = [];
4345
+ var installAll = false;
4346
+ while(index < tokens.length){
4347
+ var token = tokens[index];
4348
+ if (!token) {
4349
+ throw new Error("Empty arguments are not supported");
4350
+ }
4351
+ if (REJECTED_FLAGS.has(token)) {
4352
+ throw new Error("".concat(token, " is not supported for workspace skill installation"));
4353
+ }
4354
+ if (IGNORED_BOOLEAN_FLAGS.has(token)) {
4355
+ index += 1;
4356
+ continue;
4357
+ }
4358
+ if (token === "-a" || token === "--agent" || token.startsWith("--agent=")) {
4359
+ var result = readFlagValue(tokens, index, token, "--agent");
4360
+ index = result.nextIndex;
4361
+ continue;
4362
+ }
4363
+ if (token === "-s" || token === "--skill" || token.startsWith("--skill=")) {
4364
+ var result1 = readFlagValue(tokens, index, token, "--skill");
4365
+ var skill = result1.value.trim();
4366
+ if (!skill) {
4367
+ throw new Error("--skill requires a non-empty value");
4368
+ }
4369
+ skills.push(skill);
4370
+ index = result1.nextIndex;
4371
+ continue;
4372
+ }
4373
+ if (token === "--branch" || token.startsWith("--branch=")) {
4374
+ var result2 = readFlagValue(tokens, index, token, "--branch");
4375
+ branch = normalizeNonEmptyFlagValue(result2.value, "--branch");
4376
+ index = result2.nextIndex;
4377
+ continue;
4378
+ }
4379
+ if (token === "--path" || token.startsWith("--path=")) {
4380
+ var result3 = readFlagValue(tokens, index, token, "--path");
4381
+ repositoryPath = normalizeRepositoryPath(result3.value);
4382
+ if (!repositoryPath) {
4383
+ throw new Error("--path requires a non-empty value");
4384
+ }
4385
+ index = result3.nextIndex;
4386
+ continue;
4387
+ }
4388
+ if (token === "--all") {
4389
+ installAll = true;
4390
+ index += 1;
4391
+ continue;
4392
+ }
4393
+ if (token.startsWith("-")) {
4394
+ throw new Error('Unsupported option "'.concat(token, '"'));
4395
+ }
4396
+ if (source) {
4397
+ throw new Error('Unexpected argument "'.concat(token, '"'));
4398
+ }
4399
+ source = parseGithubSource(token);
4400
+ index += 1;
4401
+ }
4402
+ if (!source) {
4403
+ throw new Error("GitHub repository source is required");
4404
+ }
4405
+ if (installAll && skills.length) {
4406
+ throw new Error("--all cannot be used with --skill");
4407
+ }
4408
+ if (source.branch && branch && source.branch !== branch) {
4409
+ throw new Error("GitHub tree URL branch conflicts with --branch");
4410
+ }
4411
+ if (source.repositoryPath && repositoryPath && source.repositoryPath !== repositoryPath) {
4412
+ throw new Error("GitHub tree URL path conflicts with --path");
4413
+ }
4414
+ return {
4415
+ repositoryUrl: source.repositoryUrl,
4416
+ repositoryPath: repositoryPath || source.repositoryPath,
4417
+ branch: branch || source.branch,
4418
+ skills: skills,
4419
+ installAll: installAll
4420
+ };
4421
+ }
4422
+ function tokenizeShellLike(input) {
4423
+ var raw = typeof input === "string" ? input.trim() : "";
4424
+ if (!raw) {
4425
+ return [];
4426
+ }
4427
+ var tokens = [];
4428
+ var token = "";
4429
+ var tokenStarted = false;
4430
+ var quote = null;
4431
+ for(var index = 0; index < raw.length; index += 1){
4432
+ var char = raw[index];
4433
+ if (quote) {
4434
+ if (char === quote) {
4435
+ quote = null;
4436
+ tokenStarted = true;
4437
+ continue;
4438
+ }
4439
+ if (quote === '"' && char === "\\" && index + 1 < raw.length) {
4440
+ index += 1;
4441
+ token += raw[index];
4442
+ tokenStarted = true;
4443
+ continue;
4444
+ }
4445
+ token += char;
4446
+ tokenStarted = true;
4447
+ continue;
4448
+ }
4449
+ if (/\s/.test(char)) {
4450
+ if (tokenStarted) {
4451
+ tokens.push(token);
4452
+ token = "";
4453
+ tokenStarted = false;
4454
+ }
4455
+ continue;
4456
+ }
4457
+ if (char === '"' || char === "'") {
4458
+ quote = char;
4459
+ tokenStarted = true;
4460
+ continue;
4461
+ }
4462
+ if (char === "\\" && index + 1 < raw.length) {
4463
+ index += 1;
4464
+ token += raw[index];
4465
+ tokenStarted = true;
4466
+ continue;
4467
+ }
4468
+ token += char;
4469
+ tokenStarted = true;
4470
+ }
4471
+ if (quote) {
4472
+ throw new Error("Unclosed quote in install command");
4473
+ }
4474
+ if (tokenStarted) {
4475
+ tokens.push(token);
4476
+ }
4477
+ return tokens;
4478
+ }
4479
+ function readCommandPrefix(tokens) {
4480
+ if (tokens[0] === "npx") {
4481
+ var index = 1;
4482
+ while(tokens[index] === "-y" || tokens[index] === "--yes"){
4483
+ index += 1;
4484
+ }
4485
+ if (tokens[index] !== "skills" || tokens[index + 1] !== "add") {
4486
+ throw new Error('Use "npx skills add <github-source>" to install workspace skills');
4487
+ }
4488
+ return index + 2;
4489
+ }
4490
+ if (tokens[0] === "skills") {
4491
+ if (tokens[1] !== "add") {
4492
+ throw new Error('Use "skills add <github-source>" to install workspace skills');
4493
+ }
4494
+ return 2;
4495
+ }
4496
+ return 0;
4497
+ }
4498
+ function readFlagValue(tokens, index, token, flagName) {
4499
+ var equalsIndex = token.indexOf("=");
4500
+ if (equalsIndex > -1) {
4501
+ return {
4502
+ value: token.slice(equalsIndex + 1),
4503
+ nextIndex: index + 1
4504
+ };
4505
+ }
4506
+ var value = tokens[index + 1];
4507
+ if (!value || value.startsWith("-")) {
4508
+ throw new Error("".concat(flagName, " requires a value"));
4509
+ }
4510
+ return {
4511
+ value: value,
4512
+ nextIndex: index + 2
4513
+ };
4514
+ }
4515
+ function normalizeNonEmptyFlagValue(value, flagName) {
4516
+ var normalized = value.trim();
4517
+ if (!normalized) {
4518
+ throw new Error("".concat(flagName, " requires a non-empty value"));
4519
+ }
4520
+ return normalized;
4521
+ }
4522
+ function parseGithubSource(source) {
4523
+ var raw = source.trim();
4524
+ if (!raw) {
4525
+ throw new Error("GitHub repository source is required");
4526
+ }
4527
+ if (isLocalPath(raw)) {
4528
+ throw new Error("Local paths are not supported for workspace skill installation");
4529
+ }
4530
+ if (/^git@/i.test(raw)) {
4531
+ throw new Error("SSH Git URLs are not supported for workspace skill installation");
4532
+ }
4533
+ if (/^https?:\/\//i.test(raw) || /^github\.com\//i.test(raw)) {
4534
+ return parseGithubUrl(raw);
4535
+ }
4536
+ if (/^[^/\s]+\/[^/\s]+$/.test(raw)) {
4537
+ var _raw_split = _sliced_to_array$3(raw.split("/"), 2), owner = _raw_split[0], repoSegment = _raw_split[1];
4538
+ var repo = repoSegment.replace(/\.git$/i, "");
4539
+ if (!repo) {
4540
+ throw new Error("GitHub repository source must include owner and repository name");
4541
+ }
4542
+ return {
4543
+ repositoryUrl: "https://github.com/".concat(owner, "/").concat(repo),
4544
+ repositoryPath: "",
4545
+ branch: ""
4546
+ };
4547
+ }
4548
+ throw new Error("Only GitHub repository URLs or owner/repo sources are supported");
4549
+ }
4550
+ function parseGithubUrl(raw) {
4551
+ var _segments_, _segments_1, _segments_2;
4552
+ var candidate = /^https?:\/\//i.test(raw) ? raw : "https://".concat(raw);
4553
+ var url;
4554
+ try {
4555
+ url = new URL(candidate);
4556
+ } catch (e) {
4557
+ throw new Error("GitHub repository URL is invalid");
4558
+ }
4559
+ if (url.hostname.toLowerCase() !== "github.com") {
4560
+ throw new Error("Only github.com repository URLs are supported");
4561
+ }
4562
+ var segments = url.pathname.replace(/^\/+|\/+$/g, "").split("/").filter(Boolean).map(function(segment) {
4563
+ return decodeURIComponent(segment);
4564
+ });
4565
+ var owner = (_segments_ = segments[0]) === null || _segments_ === void 0 ? void 0 : _segments_.trim();
4566
+ var repo = (_segments_1 = segments[1]) === null || _segments_1 === void 0 ? void 0 : _segments_1.replace(/\.git$/i, "").trim();
4567
+ if (!owner || !repo) {
4568
+ throw new Error("GitHub repository URL must include owner and repository name");
4569
+ }
4570
+ if (segments.length > 2 && segments[2] !== "tree") {
4571
+ throw new Error("Only GitHub repository and tree URLs are supported");
4572
+ }
4573
+ var _segments__trim;
4574
+ var treeBranch = segments[2] === "tree" ? (_segments__trim = (_segments_2 = segments[3]) === null || _segments_2 === void 0 ? void 0 : _segments_2.trim()) !== null && _segments__trim !== void 0 ? _segments__trim : "" : "";
4575
+ var treePath = segments[2] === "tree" ? normalizeRepositoryPath(segments.slice(4).join("/")) : "";
4576
+ return {
4577
+ repositoryUrl: "https://github.com/".concat(owner, "/").concat(repo),
4578
+ repositoryPath: treePath,
4579
+ branch: treeBranch
4580
+ };
4581
+ }
4582
+ function normalizeRepositoryPath(value) {
4583
+ return value.trim().replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+$/, "");
4584
+ }
4585
+ function isLocalPath(value) {
4586
+ return value.startsWith(".") || value.startsWith("/") || value.startsWith("~") || /^file:/i.test(value) || /^[a-z]:[\\/]/i.test(value);
4587
+ }
4588
+
4100
4589
  function _define_property$2(obj, key, value) {
4101
4590
  if (key in obj) {
4102
4591
  Object.defineProperty(obj, key, {
@@ -4920,6 +5409,15 @@ function isUserOrganizationEntryGuideKey(value) {
4920
5409
  return value === USER_ORGANIZATION_ENTRY_GUIDE_CLAWXPERT;
4921
5410
  }
4922
5411
 
5412
+ exports.UserGroupManagedByEnum = void 0;
5413
+ (function(UserGroupManagedByEnum) {
5414
+ UserGroupManagedByEnum["XPERT_MARKETPLACE"] = "xpert-marketplace";
5415
+ })(exports.UserGroupManagedByEnum || (exports.UserGroupManagedByEnum = {}));
5416
+ exports.UserGroupManagedEntityTypeEnum = void 0;
5417
+ (function(UserGroupManagedEntityTypeEnum) {
5418
+ UserGroupManagedEntityTypeEnum["XPERT"] = "xpert";
5419
+ })(exports.UserGroupManagedEntityTypeEnum || (exports.UserGroupManagedEntityTypeEnum = {}));
5420
+
4923
5421
  exports.UserType = void 0;
4924
5422
  (function(UserType) {
4925
5423
  UserType["USER"] = "user";
@@ -5863,12 +6361,16 @@ exports.WORKSPACE_PUBLIC_SKILL_REPOSITORY_NAME = WORKSPACE_PUBLIC_SKILL_REPOSITO
5863
6361
  exports.WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER = WORKSPACE_PUBLIC_SKILL_SOURCE_PROVIDER;
5864
6362
  exports.XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY = XPERT_TASK_SCHEDULE_IDEMPOTENCY_KEY;
5865
6363
  exports.XPERT_TASK_SCHEDULE_PROPERTY_PREFIX = XPERT_TASK_SCHEDULE_PROPERTY_PREFIX;
6364
+ exports.XpertMarketplaceBusinessCategories = XpertMarketplaceBusinessCategories;
6365
+ exports.XpertMarketplaceCollaborationModes = XpertMarketplaceCollaborationModes;
6366
+ exports.XpertMarketplaceTechnicalCategories = XpertMarketplaceTechnicalCategories;
5866
6367
  exports.agentLabel = agentLabel;
5867
6368
  exports.agentUniqueName = agentUniqueName;
5868
6369
  exports.allChannels = allChannels;
5869
6370
  exports.appendMessageContent = appendMessageContent;
5870
6371
  exports.appendMessagePlainText = appendMessagePlainText;
5871
6372
  exports.buildChunkTree = buildChunkTree;
6373
+ exports.buildXpertMarketplaceProfileSnapshot = buildXpertMarketplaceProfileSnapshot;
5872
6374
  exports.channelName = channelName;
5873
6375
  exports.classificateDocumentCategory = classificateDocumentCategory;
5874
6376
  exports.collectTreeLeaves = collectTreeLeaves;
@@ -5882,6 +6384,7 @@ exports.createThreadGoalClearedEvent = createThreadGoalClearedEvent;
5882
6384
  exports.createThreadGoalUpdatedEvent = createThreadGoalUpdatedEvent;
5883
6385
  exports.createXpertGraph = createXpertGraph;
5884
6386
  exports.createXpertNodes = createXpertNodes;
6387
+ exports.deriveXpertMarketplaceTechnicalProfile = deriveXpertMarketplaceTechnicalProfile;
5885
6388
  exports.embeddingCubeCollectionName = embeddingCubeCollectionName;
5886
6389
  exports.ensureAssistantBindingSkillWorkspacePreference = ensureAssistantBindingSkillWorkspacePreference;
5887
6390
  exports.extractSemanticModelDraft = extractSemanticModelDraft;
@@ -5966,6 +6469,7 @@ exports.normalizeMiddlewareNodes = normalizeMiddlewareNodes;
5966
6469
  exports.normalizeMiddlewareProvider = normalizeMiddlewareProvider;
5967
6470
  exports.normalizeXpertAgentConfig = normalizeXpertAgentConfig;
5968
6471
  exports.omitXpertRelations = omitXpertRelations;
6472
+ exports.parseGithubSkillInstallCommand = parseGithubSkillInstallCommand;
5969
6473
  exports.replaceAgentInDraft = replaceAgentInDraft;
5970
6474
  exports.resolveDraftPrimaryAgent = resolveDraftPrimaryAgent;
5971
6475
  exports.resolveDraftRuntimeGraph = resolveDraftRuntimeGraph;