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