@metad/contracts 3.6.0-beta.2 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1100,8 +1100,8 @@ exports.IFeatureToggleTypeEnum = void 0;
1100
1100
  })(exports.IFeatureToggleTypeEnum || (exports.IFeatureToggleTypeEnum = {}));
1101
1101
  exports.FeatureEnum = void 0;
1102
1102
  (function(FeatureEnum) {
1103
- FeatureEnum["FEATURE_DASHBOARD"] = "FEATURE_DASHBOARD";
1104
1103
  FeatureEnum["FEATURE_HOME"] = "FEATURE_HOME";
1104
+ FeatureEnum["FEATURE_DASHBOARD"] = "FEATURE_DASHBOARD";
1105
1105
  FeatureEnum["FEATURE_JOB"] = "FEATURE_JOB";
1106
1106
  FeatureEnum["FEATURE_EMPLOYEES"] = "FEATURE_EMPLOYEES";
1107
1107
  FeatureEnum["FEATURE_MANAGE_INVITE"] = "FEATURE_MANAGE_INVITE";
@@ -2070,58 +2070,6 @@ function workflowNodeIdentifier(node) {
2070
2070
  return node.title || node.key;
2071
2071
  }
2072
2072
 
2073
- function _array_like_to_array$4(arr, len) {
2074
- if (len == null || len > arr.length) len = arr.length;
2075
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2076
- return arr2;
2077
- }
2078
- function _array_without_holes(arr) {
2079
- if (Array.isArray(arr)) return _array_like_to_array$4(arr);
2080
- }
2081
- function _iterable_to_array$1(iter) {
2082
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2083
- }
2084
- function _non_iterable_spread() {
2085
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2086
- }
2087
- function _object_without_properties(source, excluded) {
2088
- if (source == null) return {};
2089
- var target = _object_without_properties_loose(source, excluded);
2090
- var key, i;
2091
- if (Object.getOwnPropertySymbols) {
2092
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
2093
- for(i = 0; i < sourceSymbolKeys.length; i++){
2094
- key = sourceSymbolKeys[i];
2095
- if (excluded.indexOf(key) >= 0) continue;
2096
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
2097
- target[key] = source[key];
2098
- }
2099
- }
2100
- return target;
2101
- }
2102
- function _object_without_properties_loose(source, excluded) {
2103
- if (source == null) return {};
2104
- var target = {};
2105
- var sourceKeys = Object.keys(source);
2106
- var key, i;
2107
- for(i = 0; i < sourceKeys.length; i++){
2108
- key = sourceKeys[i];
2109
- if (excluded.indexOf(key) >= 0) continue;
2110
- target[key] = source[key];
2111
- }
2112
- return target;
2113
- }
2114
- function _to_consumable_array(arr) {
2115
- return _array_without_holes(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread();
2116
- }
2117
- function _unsupported_iterable_to_array$4(o, minLen) {
2118
- if (!o) return;
2119
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
2120
- var n = Object.prototype.toString.call(o).slice(8, -1);
2121
- if (n === "Object" && o.constructor) n = o.constructor.name;
2122
- if (n === "Map" || n === "Set") return Array.from(n);
2123
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
2124
- }
2125
2073
  exports.XpertTypeEnum = void 0;
2126
2074
  (function(XpertTypeEnum) {
2127
2075
  /**
@@ -2185,347 +2133,91 @@ exports.ChatMessageEventTypeEnum = void 0;
2185
2133
  ChatMessageEventTypeEnum["ON_ERROR"] = "on_error";
2186
2134
  ChatMessageEventTypeEnum["ON_CHAT_EVENT"] = "on_chat_event";
2187
2135
  })(exports.ChatMessageEventTypeEnum || (exports.ChatMessageEventTypeEnum = {}));
2188
- // Helpers
2189
- function omitXpertRelations(xpert) {
2190
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2191
- var _ref = xpert !== null && xpert !== void 0 ? xpert : {}; _ref.draft; _ref.agent; _ref.agents; _ref.executors; _ref.leaders; _ref.knowledgebases; _ref.toolsets; _ref.managers; var rest = _object_without_properties(_ref, [
2192
- "draft",
2193
- "agent",
2194
- "agents",
2195
- "executors",
2196
- "leaders",
2197
- "knowledgebases",
2198
- "toolsets",
2199
- "managers"
2200
- ]);
2201
- return rest;
2136
+
2137
+ function agentLabel(agent) {
2138
+ return agent.title || agent.name || agent.key;
2202
2139
  }
2203
- function figureOutXpert(xpert, isDraft) {
2204
- var _xpert_draft;
2205
- var _ref;
2206
- return (_ref = isDraft ? (_xpert_draft = xpert.draft) === null || _xpert_draft === void 0 ? void 0 : _xpert_draft.team : xpert) !== null && _ref !== void 0 ? _ref : xpert;
2140
+ function agentUniqueName(agent) {
2141
+ return agent ? convertToUrlPath(agent.name) || agent.key : null;
2207
2142
  }
2208
- function xpertLabel(agent) {
2209
- return agent.title || agent.name;
2143
+ function convertToUrlPath(title) {
2144
+ return title === null || title === void 0 ? void 0 : title.toLowerCase() // Convert to lowercase
2145
+ .replace(/\s+/g, "-") // Replace spaces with -
2146
+ .replace(/[^a-z0-9-]/g, ""); // Remove non-alphanumeric characters
2210
2147
  }
2211
- function createXpertGraph(xpert, position) {
2212
- var _Math, _Math1, _Math2, _Math3;
2213
- var _xpert_graph;
2214
- var graph = (_xpert_graph = xpert.graph) !== null && _xpert_graph !== void 0 ? _xpert_graph : xpert.draft;
2215
- var nodes = graph.nodes;
2216
- // Extract the area by positions of all nodes
2217
- var positions = nodes.map(function(node) {
2218
- return node.position;
2219
- });
2220
- var x0Positions = positions.map(function(pos) {
2221
- return pos.x;
2222
- });
2223
- var x1Positions = nodes.map(function(node) {
2224
- var _node_size;
2225
- var _node_size_width;
2226
- return node.position.x + ((_node_size_width = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.width) !== null && _node_size_width !== void 0 ? _node_size_width : 240);
2227
- }) // Node width min 240
2228
- ;
2229
- var y0Positions = positions.map(function(pos) {
2230
- return pos.y;
2231
- });
2232
- var y1Positions = nodes.map(function(node) {
2233
- var _node_size;
2234
- var _node_size_height;
2235
- return node.position.y + ((_node_size_height = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.height) !== null && _node_size_height !== void 0 ? _node_size_height : 70);
2236
- }) // Node height min 70
2237
- ;
2238
- var xRange = {
2239
- min: (_Math = Math).min.apply(_Math, _to_consumable_array(x0Positions)),
2240
- max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array(x1Positions))
2241
- };
2242
- var yRange = {
2243
- min: (_Math2 = Math).min.apply(_Math2, _to_consumable_array(y0Positions)),
2244
- max: (_Math3 = Math).max.apply(_Math3, _to_consumable_array(y1Positions))
2245
- };
2246
- var size = {
2247
- width: xRange.max - xRange.min + 50,
2248
- height: yRange.max - yRange.min + 80
2249
- };
2250
- nodes.forEach(function(node) {
2251
- var _node_position, _node_position1;
2252
- node.position = {
2253
- x: position.x + (((_node_position = node.position) === null || _node_position === void 0 ? void 0 : _node_position.x) ? node.position.x - xRange.min : 0) + 10,
2254
- y: position.y + (((_node_position1 = node.position) === null || _node_position1 === void 0 ? void 0 : _node_position1.y) ? node.position.y - yRange.min : 0) + 40
2255
- };
2256
- });
2257
- return {
2258
- nodes: nodes,
2259
- size: size,
2260
- connections: graph.connections
2261
- };
2148
+ var VariableOperations = [
2149
+ {
2150
+ value: "append",
2151
+ label: {
2152
+ zh_Hans: "追加",
2153
+ en_US: "Append"
2154
+ }
2155
+ },
2156
+ {
2157
+ value: "extends",
2158
+ label: {
2159
+ zh_Hans: "扩展",
2160
+ en_US: "Extend"
2161
+ }
2162
+ },
2163
+ {
2164
+ value: "overwrite",
2165
+ label: {
2166
+ zh_Hans: "覆盖",
2167
+ en_US: "Overwrite"
2168
+ }
2169
+ },
2170
+ {
2171
+ value: "clear",
2172
+ label: {
2173
+ zh_Hans: "清除",
2174
+ en_US: "Clear"
2175
+ }
2176
+ }
2177
+ ];
2178
+
2179
+ function _array_like_to_array$4(arr, len) {
2180
+ if (len == null || len > arr.length) len = arr.length;
2181
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2182
+ return arr2;
2262
2183
  }
2263
- /**
2264
- * Create all nodes of xpert and it's area size
2265
- *
2266
- * @param xpert
2267
- * @returns
2268
- */ function createXpertNodes(xpert, position) {
2269
- var // Agents
2270
- _nodes, // knowledgebases
2271
- _nodes1, // Toolsets
2272
- _nodes2, _Math, _Math1, _Math2, _Math3;
2273
- var _xpert_agent_options, _xpert_agents, // External experts
2274
- _xpert_executors;
2275
- var nodes = [];
2276
- var agents = [];
2277
- if (!((_xpert_agent_options = xpert.agent.options) === null || _xpert_agent_options === void 0 ? void 0 : _xpert_agent_options.hidden)) {
2278
- agents.push(xpert.agent);
2184
+ function _array_with_holes$3(arr) {
2185
+ if (Array.isArray(arr)) return arr;
2186
+ }
2187
+ function _define_property$1(obj, key, value) {
2188
+ if (key in obj) {
2189
+ Object.defineProperty(obj, key, {
2190
+ value: value,
2191
+ enumerable: true,
2192
+ configurable: true,
2193
+ writable: true
2194
+ });
2195
+ } else {
2196
+ obj[key] = value;
2279
2197
  }
2280
- if ((_xpert_agents = xpert.agents) === null || _xpert_agents === void 0 ? void 0 : _xpert_agents.length) {
2281
- var _agents;
2282
- (_agents = agents).push.apply(_agents, _to_consumable_array(xpert.agents));
2283
- }
2284
- (_nodes = nodes).push.apply(_nodes, _to_consumable_array(agents.map(function(_) {
2285
- var _xpert_options_agent___key, _xpert_options_agent, _xpert_options, _xpert_options_agent___key1, _xpert_options_agent1, _xpert_options1;
2286
- var _xpert_options_agent___key_position;
2287
- return {
2288
- type: "agent",
2289
- key: _.key,
2290
- position: (_xpert_options_agent___key_position = (_xpert_options = xpert.options) === null || _xpert_options === void 0 ? void 0 : (_xpert_options_agent = _xpert_options.agent) === null || _xpert_options_agent === void 0 ? void 0 : (_xpert_options_agent___key = _xpert_options_agent[_.key]) === null || _xpert_options_agent___key === void 0 ? void 0 : _xpert_options_agent___key.position) !== null && _xpert_options_agent___key_position !== void 0 ? _xpert_options_agent___key_position : {
2291
- x: 0,
2292
- y: 0
2293
- },
2294
- size: (_xpert_options1 = xpert.options) === null || _xpert_options1 === void 0 ? void 0 : (_xpert_options_agent1 = _xpert_options1.agent) === null || _xpert_options_agent1 === void 0 ? void 0 : (_xpert_options_agent___key1 = _xpert_options_agent1[_.key]) === null || _xpert_options_agent___key1 === void 0 ? void 0 : _xpert_options_agent___key1.size,
2295
- entity: _
2296
- };
2297
- })));
2298
- (_xpert_executors = xpert.executors) === null || _xpert_executors === void 0 ? void 0 : _xpert_executors.forEach(function(executor) {
2299
- var _xpert_options_xpert_executor_id, _xpert_options_xpert, _xpert_options;
2300
- var _xpert_options_xpert_executor_id_position;
2301
- var position = (_xpert_options_xpert_executor_id_position = (_xpert_options = xpert.options) === null || _xpert_options === void 0 ? void 0 : (_xpert_options_xpert = _xpert_options.xpert) === null || _xpert_options_xpert === void 0 ? void 0 : (_xpert_options_xpert_executor_id = _xpert_options_xpert[executor.id]) === null || _xpert_options_xpert_executor_id === void 0 ? void 0 : _xpert_options_xpert_executor_id.position) !== null && _xpert_options_xpert_executor_id_position !== void 0 ? _xpert_options_xpert_executor_id_position : {
2302
- x: 0,
2303
- y: 0
2304
- };
2305
- var executorGraph = createXpertNodes(executor, position);
2306
- nodes.push({
2307
- type: "xpert",
2308
- key: executor.id,
2309
- position: position,
2310
- size: executorGraph.size,
2311
- entity: executor,
2312
- nodes: executorGraph.nodes
2313
- });
2314
- });
2315
- var _xpert_knowledgebases;
2316
- (_nodes1 = nodes).push.apply(_nodes1, _to_consumable_array(((_xpert_knowledgebases = xpert.knowledgebases) !== null && _xpert_knowledgebases !== void 0 ? _xpert_knowledgebases : []).map(function(x) {
2317
- var _xpert_options_knowledge_x_id, _xpert_options_knowledge, _xpert_options, _xpert_options_knowledge_x_id1, _xpert_options_knowledge1, _xpert_options1;
2318
- var _xpert_options_knowledge_x_id_position;
2319
- return {
2320
- key: x.id,
2321
- type: "knowledge",
2322
- position: (_xpert_options_knowledge_x_id_position = (_xpert_options = xpert.options) === null || _xpert_options === void 0 ? void 0 : (_xpert_options_knowledge = _xpert_options.knowledge) === null || _xpert_options_knowledge === void 0 ? void 0 : (_xpert_options_knowledge_x_id = _xpert_options_knowledge[x.id]) === null || _xpert_options_knowledge_x_id === void 0 ? void 0 : _xpert_options_knowledge_x_id.position) !== null && _xpert_options_knowledge_x_id_position !== void 0 ? _xpert_options_knowledge_x_id_position : {
2323
- x: 0,
2324
- y: 0
2325
- },
2326
- size: (_xpert_options1 = xpert.options) === null || _xpert_options1 === void 0 ? void 0 : (_xpert_options_knowledge1 = _xpert_options1.knowledge) === null || _xpert_options_knowledge1 === void 0 ? void 0 : (_xpert_options_knowledge_x_id1 = _xpert_options_knowledge1[x.id]) === null || _xpert_options_knowledge_x_id1 === void 0 ? void 0 : _xpert_options_knowledge_x_id1.size,
2327
- entity: x
2328
- };
2329
- })));
2330
- var _xpert_toolsets;
2331
- (_nodes2 = nodes).push.apply(_nodes2, _to_consumable_array(((_xpert_toolsets = xpert.toolsets) !== null && _xpert_toolsets !== void 0 ? _xpert_toolsets : []).map(function(x) {
2332
- var _xpert_options_toolset_x_id, _xpert_options_toolset, _xpert_options, _xpert_options_toolset_x_id1, _xpert_options_toolset1, _xpert_options1;
2333
- var _xpert_options_toolset_x_id_position;
2334
- return {
2335
- key: x.id,
2336
- type: "toolset",
2337
- position: (_xpert_options_toolset_x_id_position = (_xpert_options = xpert.options) === null || _xpert_options === void 0 ? void 0 : (_xpert_options_toolset = _xpert_options.toolset) === null || _xpert_options_toolset === void 0 ? void 0 : (_xpert_options_toolset_x_id = _xpert_options_toolset[x.id]) === null || _xpert_options_toolset_x_id === void 0 ? void 0 : _xpert_options_toolset_x_id.position) !== null && _xpert_options_toolset_x_id_position !== void 0 ? _xpert_options_toolset_x_id_position : {
2338
- x: 0,
2339
- y: 0
2340
- },
2341
- size: (_xpert_options1 = xpert.options) === null || _xpert_options1 === void 0 ? void 0 : (_xpert_options_toolset1 = _xpert_options1.toolset) === null || _xpert_options_toolset1 === void 0 ? void 0 : (_xpert_options_toolset_x_id1 = _xpert_options_toolset1[x.id]) === null || _xpert_options_toolset_x_id1 === void 0 ? void 0 : _xpert_options_toolset_x_id1.size,
2342
- entity: x
2343
- };
2344
- })));
2345
- // Extract the area by positions of all nodes
2346
- var positions = nodes.map(function(node) {
2347
- return node.position;
2348
- });
2349
- var x0Positions = positions.map(function(pos) {
2350
- return pos.x;
2351
- });
2352
- var x1Positions = nodes.map(function(node) {
2353
- var _node_size;
2354
- var _node_size_width;
2355
- return node.position.x + ((_node_size_width = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.width) !== null && _node_size_width !== void 0 ? _node_size_width : 240);
2356
- }) // Node width min 240
2357
- ;
2358
- var y0Positions = positions.map(function(pos) {
2359
- return pos.y;
2360
- });
2361
- var y1Positions = nodes.map(function(node) {
2362
- var _node_size;
2363
- var _node_size_height;
2364
- return node.position.y + ((_node_size_height = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.height) !== null && _node_size_height !== void 0 ? _node_size_height : 70);
2365
- }) // Node height min 70
2366
- ;
2367
- var xRange = {
2368
- min: (_Math = Math).min.apply(_Math, _to_consumable_array(x0Positions)),
2369
- max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array(x1Positions))
2370
- };
2371
- var yRange = {
2372
- min: (_Math2 = Math).min.apply(_Math2, _to_consumable_array(y0Positions)),
2373
- max: (_Math3 = Math).max.apply(_Math3, _to_consumable_array(y1Positions))
2374
- };
2375
- var size = {
2376
- width: xRange.max - xRange.min + 50,
2377
- height: yRange.max - yRange.min + 80
2378
- };
2379
- nodes.forEach(function(node) {
2380
- var _node_position, _node_position1;
2381
- node.position = {
2382
- x: position.x + (((_node_position = node.position) === null || _node_position === void 0 ? void 0 : _node_position.x) ? node.position.x - xRange.min : 0) + 10,
2383
- y: position.y + (((_node_position1 = node.position) === null || _node_position1 === void 0 ? void 0 : _node_position1.y) ? node.position.y - yRange.min : 0) + 40
2384
- };
2385
- });
2386
- return {
2387
- nodes: nodes,
2388
- size: size
2389
- };
2390
- }
2391
- function createAgentConnections(agent, collaborators) {
2392
- var // collaborators
2393
- _agent_collaboratorNames, // knowledgebases
2394
- _agent_knowledgebaseIds, // toolsets
2395
- _agent_toolsetIds;
2396
- var connections = [];
2397
- var from = agent.leaderKey;
2398
- var to = agent.key;
2399
- if (from && to) {
2400
- connections.push({
2401
- type: "agent",
2402
- key: from + "/" + to,
2403
- from: from,
2404
- to: to
2405
- });
2406
- }
2407
- (_agent_collaboratorNames = agent.collaboratorNames) === null || _agent_collaboratorNames === void 0 ? void 0 : _agent_collaboratorNames.forEach(function(name) {
2408
- var collaborator = collaborators.find(function(_) {
2409
- return _.name === name;
2410
- });
2411
- if (collaborator) {
2412
- var from = agent.key;
2413
- var to = collaborator.id;
2414
- connections.push({
2415
- type: "xpert",
2416
- key: from + "/" + to,
2417
- from: from,
2418
- to: to
2419
- });
2420
- }
2421
- });
2422
- (_agent_knowledgebaseIds = agent.knowledgebaseIds) === null || _agent_knowledgebaseIds === void 0 ? void 0 : _agent_knowledgebaseIds.forEach(function(knowledgebaseId) {
2423
- var from = agent.key;
2424
- var to = knowledgebaseId;
2425
- connections.push({
2426
- type: "knowledge",
2427
- key: from + "/" + to,
2428
- from: from,
2429
- to: to
2430
- });
2431
- });
2432
- (_agent_toolsetIds = agent.toolsetIds) === null || _agent_toolsetIds === void 0 ? void 0 : _agent_toolsetIds.forEach(function(toolsetId) {
2433
- var from = agent.key;
2434
- var to = toolsetId;
2435
- connections.push({
2436
- type: "toolset",
2437
- key: from + "/" + to,
2438
- from: from,
2439
- to: to
2440
- });
2441
- });
2442
- return connections;
2443
- }
2444
-
2445
- function agentLabel(agent) {
2446
- return agent.title || agent.name || agent.key;
2447
- }
2448
- function agentUniqueName(agent) {
2449
- return agent ? convertToUrlPath(agent.name) || agent.key : null;
2450
- }
2451
- function convertToUrlPath(title) {
2452
- return title === null || title === void 0 ? void 0 : title.toLowerCase() // Convert to lowercase
2453
- .replace(/\s+/g, "-") // Replace spaces with -
2454
- .replace(/[^a-z0-9-]/g, ""); // Remove non-alphanumeric characters
2455
- }
2456
- var VariableOperations = [
2457
- {
2458
- value: "append",
2459
- label: {
2460
- zh_Hans: "追加",
2461
- en_US: "Append"
2462
- }
2463
- },
2464
- {
2465
- value: "extends",
2466
- label: {
2467
- zh_Hans: "扩展",
2468
- en_US: "Extend"
2469
- }
2470
- },
2471
- {
2472
- value: "overwrite",
2473
- label: {
2474
- zh_Hans: "覆盖",
2475
- en_US: "Overwrite"
2476
- }
2477
- },
2478
- {
2479
- value: "clear",
2480
- label: {
2481
- zh_Hans: "清除",
2482
- en_US: "Clear"
2483
- }
2484
- }
2485
- ];
2486
-
2487
- function _array_like_to_array$3(arr, len) {
2488
- if (len == null || len > arr.length) len = arr.length;
2489
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2490
- return arr2;
2491
- }
2492
- function _array_with_holes$3(arr) {
2493
- if (Array.isArray(arr)) return arr;
2494
- }
2495
- function _define_property$1(obj, key, value) {
2496
- if (key in obj) {
2497
- Object.defineProperty(obj, key, {
2498
- value: value,
2499
- enumerable: true,
2500
- configurable: true,
2501
- writable: true
2502
- });
2503
- } else {
2504
- obj[key] = value;
2505
- }
2506
- return obj;
2507
- }
2508
- function _iterable_to_array_limit$2(arr, i) {
2509
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2510
- if (_i == null) return;
2511
- var _arr = [];
2512
- var _n = true;
2513
- var _d = false;
2514
- var _s, _e;
2515
- try {
2516
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
2517
- _arr.push(_s.value);
2518
- if (i && _arr.length === i) break;
2519
- }
2520
- } catch (err) {
2521
- _d = true;
2522
- _e = err;
2523
- } finally{
2524
- try {
2525
- if (!_n && _i["return"] != null) _i["return"]();
2526
- } finally{
2527
- if (_d) throw _e;
2528
- }
2198
+ return obj;
2199
+ }
2200
+ function _iterable_to_array_limit$2(arr, i) {
2201
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2202
+ if (_i == null) return;
2203
+ var _arr = [];
2204
+ var _n = true;
2205
+ var _d = false;
2206
+ var _s, _e;
2207
+ try {
2208
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
2209
+ _arr.push(_s.value);
2210
+ if (i && _arr.length === i) break;
2211
+ }
2212
+ } catch (err) {
2213
+ _d = true;
2214
+ _e = err;
2215
+ } finally{
2216
+ try {
2217
+ if (!_n && _i["return"] != null) _i["return"]();
2218
+ } finally{
2219
+ if (_d) throw _e;
2220
+ }
2529
2221
  }
2530
2222
  return _arr;
2531
2223
  }
@@ -2567,15 +2259,15 @@ function _object_spread_props(target, source) {
2567
2259
  return target;
2568
2260
  }
2569
2261
  function _sliced_to_array$2(arr, i) {
2570
- return _array_with_holes$3(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
2262
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$3();
2571
2263
  }
2572
- function _unsupported_iterable_to_array$3(o, minLen) {
2264
+ function _unsupported_iterable_to_array$4(o, minLen) {
2573
2265
  if (!o) return;
2574
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
2266
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
2575
2267
  var n = Object.prototype.toString.call(o).slice(8, -1);
2576
2268
  if (n === "Object" && o.constructor) n = o.constructor.name;
2577
2269
  if (n === "Map" || n === "Set") return Array.from(n);
2578
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
2270
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
2579
2271
  }
2580
2272
  /**
2581
2273
  * @deprecated can use getCurrentTaskInput instead?
@@ -2749,9 +2441,16 @@ exports.KnowledgeStructureEnum = void 0;
2749
2441
  })(exports.KnowledgeStructureEnum || (exports.KnowledgeStructureEnum = {}));
2750
2442
  exports.KnowledgebasePermission = void 0;
2751
2443
  (function(KnowledgebasePermission) {
2752
- KnowledgebasePermission["Private"] = "private";
2753
- KnowledgebasePermission["Organization"] = "organization";
2754
- KnowledgebasePermission["Public"] = "public";
2444
+ /**
2445
+ * Only visible to you
2446
+ * @default
2447
+ */ KnowledgebasePermission["Private"] = "private";
2448
+ /**
2449
+ * Visible to all members in the organization
2450
+ */ KnowledgebasePermission["Organization"] = "organization";
2451
+ /**
2452
+ * Visible to all members in the tenant
2453
+ */ KnowledgebasePermission["Public"] = "public";
2755
2454
  })(exports.KnowledgebasePermission || (exports.KnowledgebasePermission = {}));
2756
2455
  /**
2757
2456
  * Channel name for knowledgebase pipeline
@@ -2764,6 +2463,7 @@ exports.KnowledgebasePermission = void 0;
2764
2463
  */ var KnowledgeSources = "sources";
2765
2464
  var KnowledgeDocuments = "documents";
2766
2465
  var KnowledgeFolderId = "folder_id";
2466
+ var KNOWLEDGE_STAGE_NAME = "stage";
2767
2467
 
2768
2468
  exports.KDocumentSourceType = void 0;
2769
2469
  (function(KDocumentSourceType) {
@@ -2957,43 +2657,358 @@ exports.ToolTagEnum = void 0;
2957
2657
  ToolTagEnum["OTHER"] = "other";
2958
2658
  })(exports.ToolTagEnum || (exports.ToolTagEnum = {}));
2959
2659
 
2960
- exports.ApiAuthType = void 0;
2961
- (function(ApiAuthType) {
2962
- /**
2963
- * Enum class for api provider auth type.
2964
- */ ApiAuthType["NONE"] = "none";
2965
- ApiAuthType["API_KEY"] = "api_key";
2966
- ApiAuthType["BASIC"] = "basic";
2967
- })(exports.ApiAuthType || (exports.ApiAuthType = {}));
2968
- exports.EmbeddingStatusEnum = void 0;
2969
- (function(EmbeddingStatusEnum) {
2970
- EmbeddingStatusEnum["PROCESSING"] = "processing";
2971
- EmbeddingStatusEnum["SUCCESS"] = "success";
2972
- EmbeddingStatusEnum["FAILED"] = "failed";
2973
- EmbeddingStatusEnum["REQUIRED"] = "required";
2974
- })(exports.EmbeddingStatusEnum || (exports.EmbeddingStatusEnum = {}));
2975
- var Attachment_Type_Options = [
2976
- {
2977
- key: "document",
2978
- value: "TXT, MD, MDX, MARKDOWN, PDF, HTML, XLSX, XLS, DOC, DOCX, CSV, EML, MSG, PPTX, PPT, XML, EPUB",
2979
- label: {
2980
- zh_Hans: "文档",
2981
- en_US: "Document"
2982
- }
2983
- },
2984
- {
2985
- key: "image",
2986
- value: "JPG, JPEG, PNG, GIF, WEBP, SVG",
2987
- label: {
2988
- zh_Hans: "图片",
2989
- en_US: "Image"
2990
- }
2991
- },
2992
- {
2993
- key: "audio",
2994
- value: "MP3, M4A, WAV, AMR, MPGA",
2995
- label: {
2996
- zh_Hans: "音频",
2660
+ function _array_like_to_array$3(arr, len) {
2661
+ if (len == null || len > arr.length) len = arr.length;
2662
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2663
+ return arr2;
2664
+ }
2665
+ function _array_without_holes(arr) {
2666
+ if (Array.isArray(arr)) return _array_like_to_array$3(arr);
2667
+ }
2668
+ function _iterable_to_array$1(iter) {
2669
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2670
+ }
2671
+ function _non_iterable_spread() {
2672
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2673
+ }
2674
+ function _object_without_properties(source, excluded) {
2675
+ if (source == null) return {};
2676
+ var target = _object_without_properties_loose(source, excluded);
2677
+ var key, i;
2678
+ if (Object.getOwnPropertySymbols) {
2679
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
2680
+ for(i = 0; i < sourceSymbolKeys.length; i++){
2681
+ key = sourceSymbolKeys[i];
2682
+ if (excluded.indexOf(key) >= 0) continue;
2683
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
2684
+ target[key] = source[key];
2685
+ }
2686
+ }
2687
+ return target;
2688
+ }
2689
+ function _object_without_properties_loose(source, excluded) {
2690
+ if (source == null) return {};
2691
+ var target = {};
2692
+ var sourceKeys = Object.keys(source);
2693
+ var key, i;
2694
+ for(i = 0; i < sourceKeys.length; i++){
2695
+ key = sourceKeys[i];
2696
+ if (excluded.indexOf(key) >= 0) continue;
2697
+ target[key] = source[key];
2698
+ }
2699
+ return target;
2700
+ }
2701
+ function _to_consumable_array(arr) {
2702
+ return _array_without_holes(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread();
2703
+ }
2704
+ function _unsupported_iterable_to_array$3(o, minLen) {
2705
+ if (!o) return;
2706
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
2707
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2708
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2709
+ if (n === "Map" || n === "Set") return Array.from(n);
2710
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
2711
+ }
2712
+ // Helpers
2713
+ function omitXpertRelations(xpert) {
2714
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2715
+ var _ref = xpert !== null && xpert !== void 0 ? xpert : {}; _ref.draft; _ref.agent; _ref.agents; _ref.executors; _ref.leaders; _ref.knowledgebases; _ref.toolsets; _ref.managers; var rest = _object_without_properties(_ref, [
2716
+ "draft",
2717
+ "agent",
2718
+ "agents",
2719
+ "executors",
2720
+ "leaders",
2721
+ "knowledgebases",
2722
+ "toolsets",
2723
+ "managers"
2724
+ ]);
2725
+ return rest;
2726
+ }
2727
+ function figureOutXpert(xpert, isDraft) {
2728
+ var _xpert_draft;
2729
+ var _ref;
2730
+ return (_ref = isDraft ? (_xpert_draft = xpert.draft) === null || _xpert_draft === void 0 ? void 0 : _xpert_draft.team : xpert) !== null && _ref !== void 0 ? _ref : xpert;
2731
+ }
2732
+ function xpertLabel(agent) {
2733
+ return agent.title || agent.name;
2734
+ }
2735
+ function createXpertGraph(xpert, position) {
2736
+ var _xpert_graph;
2737
+ var graph = (_xpert_graph = xpert.graph) !== null && _xpert_graph !== void 0 ? _xpert_graph : xpert.draft;
2738
+ var _locateNodes = locateNodes(graph.nodes, position), nodes = _locateNodes.nodes, size = _locateNodes.size;
2739
+ return {
2740
+ nodes: nodes,
2741
+ size: size,
2742
+ connections: graph.connections
2743
+ };
2744
+ }
2745
+ function locateNodes(nodes, position) {
2746
+ var _Math, _Math1, _Math2, _Math3;
2747
+ // Extract the area by positions of all nodes
2748
+ var positions = nodes.map(function(node) {
2749
+ return node.position;
2750
+ });
2751
+ var x0Positions = positions.map(function(pos) {
2752
+ return pos.x;
2753
+ });
2754
+ var x1Positions = nodes.map(function(node) {
2755
+ var _node_size;
2756
+ var _node_size_width;
2757
+ return node.position.x + ((_node_size_width = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.width) !== null && _node_size_width !== void 0 ? _node_size_width : 240);
2758
+ }) // Node width min 240
2759
+ ;
2760
+ var y0Positions = positions.map(function(pos) {
2761
+ return pos.y;
2762
+ });
2763
+ var y1Positions = nodes.map(function(node) {
2764
+ var _node_size;
2765
+ var _node_size_height;
2766
+ return node.position.y + ((_node_size_height = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.height) !== null && _node_size_height !== void 0 ? _node_size_height : 70);
2767
+ }) // Node height min 70
2768
+ ;
2769
+ var xRange = {
2770
+ min: (_Math = Math).min.apply(_Math, _to_consumable_array(x0Positions)),
2771
+ max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array(x1Positions))
2772
+ };
2773
+ var yRange = {
2774
+ min: (_Math2 = Math).min.apply(_Math2, _to_consumable_array(y0Positions)),
2775
+ max: (_Math3 = Math).max.apply(_Math3, _to_consumable_array(y1Positions))
2776
+ };
2777
+ var size = {
2778
+ width: xRange.max - xRange.min + 50,
2779
+ height: yRange.max - yRange.min + 80
2780
+ };
2781
+ nodes.forEach(function(node) {
2782
+ var _node_position, _node_position1;
2783
+ node.position = {
2784
+ x: position.x + (((_node_position = node.position) === null || _node_position === void 0 ? void 0 : _node_position.x) ? node.position.x - xRange.min : 0) + 10,
2785
+ y: position.y + (((_node_position1 = node.position) === null || _node_position1 === void 0 ? void 0 : _node_position1.y) ? node.position.y - yRange.min : 0) + 40
2786
+ };
2787
+ });
2788
+ return {
2789
+ size: size,
2790
+ nodes: nodes
2791
+ };
2792
+ }
2793
+ /**
2794
+ * Create all nodes of xpert and it's area size
2795
+ *
2796
+ * @param xpert
2797
+ * @returns
2798
+ */ function createXpertNodes(xpert, position) {
2799
+ var // Agents
2800
+ _nodes, // knowledgebases
2801
+ _nodes1, // Toolsets
2802
+ _nodes2, _Math, _Math1, _Math2, _Math3;
2803
+ var _xpert_agent_options, _xpert_agents, // External experts
2804
+ _xpert_executors;
2805
+ var nodes = [];
2806
+ var agents = [];
2807
+ if (!((_xpert_agent_options = xpert.agent.options) === null || _xpert_agent_options === void 0 ? void 0 : _xpert_agent_options.hidden)) {
2808
+ agents.push(xpert.agent);
2809
+ }
2810
+ if ((_xpert_agents = xpert.agents) === null || _xpert_agents === void 0 ? void 0 : _xpert_agents.length) {
2811
+ var _agents;
2812
+ (_agents = agents).push.apply(_agents, _to_consumable_array(xpert.agents));
2813
+ }
2814
+ (_nodes = nodes).push.apply(_nodes, _to_consumable_array(agents.map(function(_) {
2815
+ var _xpert_options_agent___key, _xpert_options_agent, _xpert_options, _xpert_options_agent___key1, _xpert_options_agent1, _xpert_options1;
2816
+ var _xpert_options_agent___key_position;
2817
+ return {
2818
+ type: "agent",
2819
+ key: _.key,
2820
+ position: (_xpert_options_agent___key_position = (_xpert_options = xpert.options) === null || _xpert_options === void 0 ? void 0 : (_xpert_options_agent = _xpert_options.agent) === null || _xpert_options_agent === void 0 ? void 0 : (_xpert_options_agent___key = _xpert_options_agent[_.key]) === null || _xpert_options_agent___key === void 0 ? void 0 : _xpert_options_agent___key.position) !== null && _xpert_options_agent___key_position !== void 0 ? _xpert_options_agent___key_position : {
2821
+ x: 0,
2822
+ y: 0
2823
+ },
2824
+ size: (_xpert_options1 = xpert.options) === null || _xpert_options1 === void 0 ? void 0 : (_xpert_options_agent1 = _xpert_options1.agent) === null || _xpert_options_agent1 === void 0 ? void 0 : (_xpert_options_agent___key1 = _xpert_options_agent1[_.key]) === null || _xpert_options_agent___key1 === void 0 ? void 0 : _xpert_options_agent___key1.size,
2825
+ entity: _
2826
+ };
2827
+ })));
2828
+ (_xpert_executors = xpert.executors) === null || _xpert_executors === void 0 ? void 0 : _xpert_executors.forEach(function(executor) {
2829
+ var _xpert_options_xpert_executor_id, _xpert_options_xpert, _xpert_options;
2830
+ var _xpert_options_xpert_executor_id_position;
2831
+ var position = (_xpert_options_xpert_executor_id_position = (_xpert_options = xpert.options) === null || _xpert_options === void 0 ? void 0 : (_xpert_options_xpert = _xpert_options.xpert) === null || _xpert_options_xpert === void 0 ? void 0 : (_xpert_options_xpert_executor_id = _xpert_options_xpert[executor.id]) === null || _xpert_options_xpert_executor_id === void 0 ? void 0 : _xpert_options_xpert_executor_id.position) !== null && _xpert_options_xpert_executor_id_position !== void 0 ? _xpert_options_xpert_executor_id_position : {
2832
+ x: 0,
2833
+ y: 0
2834
+ };
2835
+ var executorGraph = createXpertNodes(executor, position);
2836
+ nodes.push({
2837
+ type: "xpert",
2838
+ key: executor.id,
2839
+ position: position,
2840
+ size: executorGraph.size,
2841
+ entity: executor,
2842
+ nodes: executorGraph.nodes
2843
+ });
2844
+ });
2845
+ var _xpert_knowledgebases;
2846
+ (_nodes1 = nodes).push.apply(_nodes1, _to_consumable_array(((_xpert_knowledgebases = xpert.knowledgebases) !== null && _xpert_knowledgebases !== void 0 ? _xpert_knowledgebases : []).map(function(x) {
2847
+ var _xpert_options_knowledge_x_id, _xpert_options_knowledge, _xpert_options, _xpert_options_knowledge_x_id1, _xpert_options_knowledge1, _xpert_options1;
2848
+ var _xpert_options_knowledge_x_id_position;
2849
+ return {
2850
+ key: x.id,
2851
+ type: "knowledge",
2852
+ position: (_xpert_options_knowledge_x_id_position = (_xpert_options = xpert.options) === null || _xpert_options === void 0 ? void 0 : (_xpert_options_knowledge = _xpert_options.knowledge) === null || _xpert_options_knowledge === void 0 ? void 0 : (_xpert_options_knowledge_x_id = _xpert_options_knowledge[x.id]) === null || _xpert_options_knowledge_x_id === void 0 ? void 0 : _xpert_options_knowledge_x_id.position) !== null && _xpert_options_knowledge_x_id_position !== void 0 ? _xpert_options_knowledge_x_id_position : {
2853
+ x: 0,
2854
+ y: 0
2855
+ },
2856
+ size: (_xpert_options1 = xpert.options) === null || _xpert_options1 === void 0 ? void 0 : (_xpert_options_knowledge1 = _xpert_options1.knowledge) === null || _xpert_options_knowledge1 === void 0 ? void 0 : (_xpert_options_knowledge_x_id1 = _xpert_options_knowledge1[x.id]) === null || _xpert_options_knowledge_x_id1 === void 0 ? void 0 : _xpert_options_knowledge_x_id1.size,
2857
+ entity: x
2858
+ };
2859
+ })));
2860
+ var _xpert_toolsets;
2861
+ (_nodes2 = nodes).push.apply(_nodes2, _to_consumable_array(((_xpert_toolsets = xpert.toolsets) !== null && _xpert_toolsets !== void 0 ? _xpert_toolsets : []).map(function(x) {
2862
+ var _xpert_options_toolset_x_id, _xpert_options_toolset, _xpert_options, _xpert_options_toolset_x_id1, _xpert_options_toolset1, _xpert_options1;
2863
+ var _xpert_options_toolset_x_id_position;
2864
+ return {
2865
+ key: x.id,
2866
+ type: "toolset",
2867
+ position: (_xpert_options_toolset_x_id_position = (_xpert_options = xpert.options) === null || _xpert_options === void 0 ? void 0 : (_xpert_options_toolset = _xpert_options.toolset) === null || _xpert_options_toolset === void 0 ? void 0 : (_xpert_options_toolset_x_id = _xpert_options_toolset[x.id]) === null || _xpert_options_toolset_x_id === void 0 ? void 0 : _xpert_options_toolset_x_id.position) !== null && _xpert_options_toolset_x_id_position !== void 0 ? _xpert_options_toolset_x_id_position : {
2868
+ x: 0,
2869
+ y: 0
2870
+ },
2871
+ size: (_xpert_options1 = xpert.options) === null || _xpert_options1 === void 0 ? void 0 : (_xpert_options_toolset1 = _xpert_options1.toolset) === null || _xpert_options_toolset1 === void 0 ? void 0 : (_xpert_options_toolset_x_id1 = _xpert_options_toolset1[x.id]) === null || _xpert_options_toolset_x_id1 === void 0 ? void 0 : _xpert_options_toolset_x_id1.size,
2872
+ entity: x
2873
+ };
2874
+ })));
2875
+ // Extract the area by positions of all nodes
2876
+ var positions = nodes.map(function(node) {
2877
+ return node.position;
2878
+ });
2879
+ var x0Positions = positions.map(function(pos) {
2880
+ return pos.x;
2881
+ });
2882
+ var x1Positions = nodes.map(function(node) {
2883
+ var _node_size;
2884
+ var _node_size_width;
2885
+ return node.position.x + ((_node_size_width = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.width) !== null && _node_size_width !== void 0 ? _node_size_width : 240);
2886
+ }) // Node width min 240
2887
+ ;
2888
+ var y0Positions = positions.map(function(pos) {
2889
+ return pos.y;
2890
+ });
2891
+ var y1Positions = nodes.map(function(node) {
2892
+ var _node_size;
2893
+ var _node_size_height;
2894
+ return node.position.y + ((_node_size_height = (_node_size = node.size) === null || _node_size === void 0 ? void 0 : _node_size.height) !== null && _node_size_height !== void 0 ? _node_size_height : 70);
2895
+ }) // Node height min 70
2896
+ ;
2897
+ var xRange = {
2898
+ min: (_Math = Math).min.apply(_Math, _to_consumable_array(x0Positions)),
2899
+ max: (_Math1 = Math).max.apply(_Math1, _to_consumable_array(x1Positions))
2900
+ };
2901
+ var yRange = {
2902
+ min: (_Math2 = Math).min.apply(_Math2, _to_consumable_array(y0Positions)),
2903
+ max: (_Math3 = Math).max.apply(_Math3, _to_consumable_array(y1Positions))
2904
+ };
2905
+ var size = {
2906
+ width: xRange.max - xRange.min + 50,
2907
+ height: yRange.max - yRange.min + 80
2908
+ };
2909
+ nodes.forEach(function(node) {
2910
+ var _node_position, _node_position1;
2911
+ node.position = {
2912
+ x: position.x + (((_node_position = node.position) === null || _node_position === void 0 ? void 0 : _node_position.x) ? node.position.x - xRange.min : 0) + 10,
2913
+ y: position.y + (((_node_position1 = node.position) === null || _node_position1 === void 0 ? void 0 : _node_position1.y) ? node.position.y - yRange.min : 0) + 40
2914
+ };
2915
+ });
2916
+ return {
2917
+ nodes: nodes,
2918
+ size: size
2919
+ };
2920
+ }
2921
+ function createAgentConnections(agent, collaborators) {
2922
+ var // collaborators
2923
+ _agent_collaboratorNames, // knowledgebases
2924
+ _agent_knowledgebaseIds, // toolsets
2925
+ _agent_toolsetIds;
2926
+ var connections = [];
2927
+ var from = agent.leaderKey;
2928
+ var to = agent.key;
2929
+ if (from && to) {
2930
+ connections.push({
2931
+ type: "agent",
2932
+ key: from + "/" + to,
2933
+ from: from,
2934
+ to: to
2935
+ });
2936
+ }
2937
+ (_agent_collaboratorNames = agent.collaboratorNames) === null || _agent_collaboratorNames === void 0 ? void 0 : _agent_collaboratorNames.forEach(function(name) {
2938
+ var collaborator = collaborators.find(function(_) {
2939
+ return _.name === name;
2940
+ });
2941
+ if (collaborator) {
2942
+ var from = agent.key;
2943
+ var to = collaborator.id;
2944
+ connections.push({
2945
+ type: "xpert",
2946
+ key: from + "/" + to,
2947
+ from: from,
2948
+ to: to
2949
+ });
2950
+ }
2951
+ });
2952
+ (_agent_knowledgebaseIds = agent.knowledgebaseIds) === null || _agent_knowledgebaseIds === void 0 ? void 0 : _agent_knowledgebaseIds.forEach(function(knowledgebaseId) {
2953
+ var from = agent.key;
2954
+ var to = knowledgebaseId;
2955
+ connections.push({
2956
+ type: "knowledge",
2957
+ key: from + "/" + to,
2958
+ from: from,
2959
+ to: to
2960
+ });
2961
+ });
2962
+ (_agent_toolsetIds = agent.toolsetIds) === null || _agent_toolsetIds === void 0 ? void 0 : _agent_toolsetIds.forEach(function(toolsetId) {
2963
+ var from = agent.key;
2964
+ var to = toolsetId;
2965
+ connections.push({
2966
+ type: "toolset",
2967
+ key: from + "/" + to,
2968
+ from: from,
2969
+ to: to
2970
+ });
2971
+ });
2972
+ return connections;
2973
+ }
2974
+
2975
+ exports.ApiAuthType = void 0;
2976
+ (function(ApiAuthType) {
2977
+ /**
2978
+ * Enum class for api provider auth type.
2979
+ */ ApiAuthType["NONE"] = "none";
2980
+ ApiAuthType["API_KEY"] = "api_key";
2981
+ ApiAuthType["BASIC"] = "basic";
2982
+ })(exports.ApiAuthType || (exports.ApiAuthType = {}));
2983
+ exports.EmbeddingStatusEnum = void 0;
2984
+ (function(EmbeddingStatusEnum) {
2985
+ EmbeddingStatusEnum["PROCESSING"] = "processing";
2986
+ EmbeddingStatusEnum["SUCCESS"] = "success";
2987
+ EmbeddingStatusEnum["FAILED"] = "failed";
2988
+ EmbeddingStatusEnum["REQUIRED"] = "required";
2989
+ })(exports.EmbeddingStatusEnum || (exports.EmbeddingStatusEnum = {}));
2990
+ var Attachment_Type_Options = [
2991
+ {
2992
+ key: "document",
2993
+ value: "TXT, MD, MDX, MARKDOWN, PDF, HTML, XLSX, XLS, DOC, DOCX, CSV, EML, MSG, PPTX, PPT, XML, EPUB",
2994
+ label: {
2995
+ zh_Hans: "文档",
2996
+ en_US: "Document"
2997
+ }
2998
+ },
2999
+ {
3000
+ key: "image",
3001
+ value: "JPG, JPEG, PNG, GIF, WEBP, SVG",
3002
+ label: {
3003
+ zh_Hans: "图片",
3004
+ en_US: "Image"
3005
+ }
3006
+ },
3007
+ {
3008
+ key: "audio",
3009
+ value: "MP3, M4A, WAV, AMR, MPGA",
3010
+ label: {
3011
+ zh_Hans: "音频",
2997
3012
  en_US: "Audio"
2998
3013
  }
2999
3014
  },
@@ -3027,10 +3042,22 @@ exports.MCPServerType = void 0;
3027
3042
 
3028
3043
  exports.DocumentSourceProviderCategoryEnum = void 0;
3029
3044
  (function(DocumentSourceProviderCategoryEnum) {
3030
- DocumentSourceProviderCategoryEnum["LocalFile"] = "local-file";
3031
- DocumentSourceProviderCategoryEnum["RemoteFile"] = "remote-file";
3032
- DocumentSourceProviderCategoryEnum["WebCrawl"] = "web-crawl";
3033
- DocumentSourceProviderCategoryEnum["Database"] = "database";
3045
+ /**
3046
+ * Local files uploaded directly to the system
3047
+ */ DocumentSourceProviderCategoryEnum["LocalFile"] = "local-file";
3048
+ /**
3049
+ * Remote file systems, e.g. S3, FTP, etc.
3050
+ */ DocumentSourceProviderCategoryEnum["FileSystem"] = "file-system";
3051
+ /**
3052
+ * Online documents, e.g. public URLs, Google Docs, etc.
3053
+ */ DocumentSourceProviderCategoryEnum["OnlineDocument"] = "online-document";
3054
+ /**
3055
+ * Web crawling from public websites
3056
+ */ DocumentSourceProviderCategoryEnum["WebCrawl"] = "web-crawl";
3057
+ /**
3058
+ * Database connections, e.g. MySQL, PostgreSQL, etc.
3059
+ * @deprecated Planning
3060
+ */ DocumentSourceProviderCategoryEnum["Database"] = "database";
3034
3061
  })(exports.DocumentSourceProviderCategoryEnum || (exports.DocumentSourceProviderCategoryEnum = {}));
3035
3062
  function genPipelineSourceKey() {
3036
3063
  return letterStartSUID("Source_");
@@ -3892,6 +3919,7 @@ exports.IntegrationLarkProvider = IntegrationLarkProvider;
3892
3919
  exports.IteratingIndexParameterName = IteratingIndexParameterName;
3893
3920
  exports.IteratingItemParameterName = IteratingItemParameterName;
3894
3921
  exports.KDocumentWebTypeOptions = KDocumentWebTypeOptions;
3922
+ exports.KNOWLEDGE_STAGE_NAME = KNOWLEDGE_STAGE_NAME;
3895
3923
  exports.KnowledgeDocuments = KnowledgeDocuments;
3896
3924
  exports.KnowledgeFolderId = KnowledgeFolderId;
3897
3925
  exports.KnowledgeSources = KnowledgeSources;
@@ -3957,6 +3985,7 @@ exports.isRouterKey = isRouterKey;
3957
3985
  exports.isToolEnabled = isToolEnabled;
3958
3986
  exports.isWorkflowKey = isWorkflowKey;
3959
3987
  exports.letterStartSUID = letterStartSUID;
3988
+ exports.locateNodes = locateNodes;
3960
3989
  exports.mapTranslationLanguage = mapTranslationLanguage;
3961
3990
  exports.messageContentText = messageContentText;
3962
3991
  exports.omitXpertRelations = omitXpertRelations;