agent-swarm-kit 1.0.136 → 1.0.139

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/build/index.cjs CHANGED
@@ -345,6 +345,9 @@ var validateDefault = function (output) { return __awaiter(void 0, void 0, void
345
345
  }); };
346
346
 
347
347
  var removeXmlTags = function (input) {
348
+ if (!input) {
349
+ return "";
350
+ }
348
351
  return input
349
352
  .replace(/<[^>]+>[\s\S]*?<\/[^>]+>/g, '')
350
353
  .replace(/\n\s*\n/g, '\n')
@@ -1494,7 +1497,7 @@ var CC_TOOL_CALL_EXCEPTION_FLUSH_PROMPT = "Start the conversation";
1494
1497
  /**
1495
1498
  * @description fix for invalid tool calls on IlyaGusev/saiga_yandexgpt_8b_gguf (LMStudio, appear time to time)
1496
1499
  */
1497
- var CC_TOOL_CALL_EXCEPTION_RECOMPLETE_PROMPT = "I see your previous message is malformed. Think again and resend it correct";
1500
+ var CC_TOOL_CALL_EXCEPTION_RECOMPLETE_PROMPT = functoolsKit.str.newline("Please analyze the last tool call message and identify any errors in its syntax or parameters.", "Then, provide a corrected version of the tool call that properly follows the required format and includes all necessary parameters with appropriate values.", "Include a brief explanation of what was fixed as a text content of a new message with correct tool calls request");
1498
1501
  /**
1499
1502
  * @description custom function to fix the model
1500
1503
  */
@@ -2372,7 +2375,7 @@ var ClientAgent = /** @class */ (function () {
2372
2375
  output = _d.sent();
2373
2376
  ((_b = this.params.completion.callbacks) === null || _b === void 0 ? void 0 : _b.onComplete) &&
2374
2377
  ((_c = this.params.completion.callbacks) === null || _c === void 0 ? void 0 : _c.onComplete(args, output));
2375
- return [2 /*return*/, output];
2378
+ return [2 /*return*/, __assign(__assign({}, output), { content: output.content || "" })];
2376
2379
  }
2377
2380
  });
2378
2381
  });
@@ -6036,6 +6039,7 @@ var SessionPublicService = /** @class */ (function () {
6036
6039
  }); }, {
6037
6040
  clientId: clientId,
6038
6041
  executionId: executionId,
6042
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
6039
6043
  })];
6040
6044
  });
6041
6045
  }); };
@@ -13003,6 +13007,7 @@ var executeForce = beginContext(function (content, clientId) { return __awaiter(
13003
13007
  }); }, {
13004
13008
  clientId: clientId,
13005
13009
  executionId: executionId,
13010
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13006
13011
  })];
13007
13012
  });
13008
13013
  }); });
@@ -13262,6 +13267,7 @@ var execute = beginContext(function (content, clientId, agentName) { return __aw
13262
13267
  }); }, {
13263
13268
  clientId: clientId,
13264
13269
  executionId: executionId,
13270
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13265
13271
  })];
13266
13272
  }
13267
13273
  });
@@ -13388,6 +13394,7 @@ var runStateless = beginContext(function (content, clientId, agentName) { return
13388
13394
  }); }, {
13389
13395
  clientId: clientId,
13390
13396
  executionId: executionId,
13397
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13391
13398
  })];
13392
13399
  }
13393
13400
  });
@@ -13445,6 +13452,7 @@ var runStatelessForce = beginContext(function (content, clientId) { return __awa
13445
13452
  }); }, {
13446
13453
  clientId: clientId,
13447
13454
  executionId: executionId,
13455
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13448
13456
  })];
13449
13457
  });
13450
13458
  }); });
@@ -13752,6 +13760,7 @@ var complete = beginContext(function (content, clientId, swarmName) { return __a
13752
13760
  }); }, {
13753
13761
  clientId: clientId,
13754
13762
  executionId: executionId,
13763
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13755
13764
  })];
13756
13765
  }
13757
13766
  });
@@ -13809,6 +13818,7 @@ var sessionInternal = beginContext(function (clientId, swarmName) {
13809
13818
  }); }, {
13810
13819
  clientId: clientId,
13811
13820
  executionId: executionId,
13821
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13812
13822
  })];
13813
13823
  });
13814
13824
  }); })),
package/build/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { scoped } from 'di-scoped';
2
2
  import { createActivator } from 'di-kit';
3
- import { trycatch, singleshot, memoize, randomString, ToolRegistry, Subject, queued, getErrorMessage, errorData, sleep, not, isObject, createAwaiter, cancelable, CANCELED_PROMISE_SYMBOL, execpool, SortedArray, Source, schedule, rate, ttl } from 'functools-kit';
3
+ import { trycatch, singleshot, memoize, str, randomString, ToolRegistry, Subject, queued, getErrorMessage, errorData, sleep, not, isObject, createAwaiter, cancelable, CANCELED_PROMISE_SYMBOL, execpool, SortedArray, Source, schedule, rate, ttl } from 'functools-kit';
4
4
  import xml2js from 'xml2js';
5
5
  import { AsyncResource } from 'async_hooks';
6
6
  import { omit } from 'lodash-es';
@@ -343,6 +343,9 @@ var validateDefault = function (output) { return __awaiter(void 0, void 0, void
343
343
  }); };
344
344
 
345
345
  var removeXmlTags = function (input) {
346
+ if (!input) {
347
+ return "";
348
+ }
346
349
  return input
347
350
  .replace(/<[^>]+>[\s\S]*?<\/[^>]+>/g, '')
348
351
  .replace(/\n\s*\n/g, '\n')
@@ -1492,7 +1495,7 @@ var CC_TOOL_CALL_EXCEPTION_FLUSH_PROMPT = "Start the conversation";
1492
1495
  /**
1493
1496
  * @description fix for invalid tool calls on IlyaGusev/saiga_yandexgpt_8b_gguf (LMStudio, appear time to time)
1494
1497
  */
1495
- var CC_TOOL_CALL_EXCEPTION_RECOMPLETE_PROMPT = "I see your previous message is malformed. Think again and resend it correct";
1498
+ var CC_TOOL_CALL_EXCEPTION_RECOMPLETE_PROMPT = str.newline("Please analyze the last tool call message and identify any errors in its syntax or parameters.", "Then, provide a corrected version of the tool call that properly follows the required format and includes all necessary parameters with appropriate values.", "Include a brief explanation of what was fixed as a text content of a new message with correct tool calls request");
1496
1499
  /**
1497
1500
  * @description custom function to fix the model
1498
1501
  */
@@ -2370,7 +2373,7 @@ var ClientAgent = /** @class */ (function () {
2370
2373
  output = _d.sent();
2371
2374
  ((_b = this.params.completion.callbacks) === null || _b === void 0 ? void 0 : _b.onComplete) &&
2372
2375
  ((_c = this.params.completion.callbacks) === null || _c === void 0 ? void 0 : _c.onComplete(args, output));
2373
- return [2 /*return*/, output];
2376
+ return [2 /*return*/, __assign(__assign({}, output), { content: output.content || "" })];
2374
2377
  }
2375
2378
  });
2376
2379
  });
@@ -6034,6 +6037,7 @@ var SessionPublicService = /** @class */ (function () {
6034
6037
  }); }, {
6035
6038
  clientId: clientId,
6036
6039
  executionId: executionId,
6040
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
6037
6041
  })];
6038
6042
  });
6039
6043
  }); };
@@ -13001,6 +13005,7 @@ var executeForce = beginContext(function (content, clientId) { return __awaiter(
13001
13005
  }); }, {
13002
13006
  clientId: clientId,
13003
13007
  executionId: executionId,
13008
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13004
13009
  })];
13005
13010
  });
13006
13011
  }); });
@@ -13260,6 +13265,7 @@ var execute = beginContext(function (content, clientId, agentName) { return __aw
13260
13265
  }); }, {
13261
13266
  clientId: clientId,
13262
13267
  executionId: executionId,
13268
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13263
13269
  })];
13264
13270
  }
13265
13271
  });
@@ -13386,6 +13392,7 @@ var runStateless = beginContext(function (content, clientId, agentName) { return
13386
13392
  }); }, {
13387
13393
  clientId: clientId,
13388
13394
  executionId: executionId,
13395
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13389
13396
  })];
13390
13397
  }
13391
13398
  });
@@ -13443,6 +13450,7 @@ var runStatelessForce = beginContext(function (content, clientId) { return __awa
13443
13450
  }); }, {
13444
13451
  clientId: clientId,
13445
13452
  executionId: executionId,
13453
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13446
13454
  })];
13447
13455
  });
13448
13456
  }); });
@@ -13750,6 +13758,7 @@ var complete = beginContext(function (content, clientId, swarmName) { return __a
13750
13758
  }); }, {
13751
13759
  clientId: clientId,
13752
13760
  executionId: executionId,
13761
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13753
13762
  })];
13754
13763
  }
13755
13764
  });
@@ -13807,6 +13816,7 @@ var sessionInternal = beginContext(function (clientId, swarmName) {
13807
13816
  }); }, {
13808
13817
  clientId: clientId,
13809
13818
  executionId: executionId,
13819
+ processId: GLOBAL_CONFIG.CC_PROCESS_UUID,
13810
13820
  })];
13811
13821
  });
13812
13822
  }); })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.136",
3
+ "version": "1.0.139",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -9,6 +9,7 @@ import { ICompletionArgs as ICompletionArgs$1 } from 'src/interfaces/Completion.
9
9
  interface IExecutionContext {
10
10
  clientId: string;
11
11
  executionId: string;
12
+ processId: string;
12
13
  }
13
14
  /**
14
15
  * Service providing execution context information.