agent-swarm-kit 1.0.183 → 1.0.185

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
@@ -14574,7 +14574,7 @@ const makeConnectionInternal = (connector, clientId, swarmName) => {
14574
14574
  */
14575
14575
  const makeConnection = (connector, clientId, swarmName) => {
14576
14576
  const send = makeConnectionInternal(connector, clientId, swarmName);
14577
- const online = functoolsKit.singleshot(async () => {
14577
+ const online = functoolsKit.singlerun(async () => {
14578
14578
  await markOnline(clientId, swarmName);
14579
14579
  });
14580
14580
  return beginContext(async (content, payload = null) => {
@@ -14608,7 +14608,7 @@ const makeConnection = (connector, clientId, swarmName) => {
14608
14608
  */
14609
14609
  makeConnection.scheduled = (connector, clientId, swarmName, { delay = SCHEDULED_DELAY$1 } = {}) => {
14610
14610
  const send = makeConnectionInternal(connector, clientId, swarmName);
14611
- const online = functoolsKit.singleshot(async () => {
14611
+ const online = functoolsKit.singlerun(async () => {
14612
14612
  await markOnline(clientId, swarmName);
14613
14613
  });
14614
14614
  const wrappedSend = functoolsKit.schedule(beginContext(async (content, payload) => {
@@ -14665,7 +14665,7 @@ makeConnection.scheduled = (connector, clientId, swarmName, { delay = SCHEDULED_
14665
14665
  */
14666
14666
  makeConnection.rate = (connector, clientId, swarmName, { delay = RATE_DELAY } = {}) => {
14667
14667
  const send = makeConnectionInternal(connector, clientId, swarmName);
14668
- const online = functoolsKit.singleshot(async () => {
14668
+ const online = functoolsKit.singlerun(async () => {
14669
14669
  await markOnline(clientId, swarmName);
14670
14670
  });
14671
14671
  const wrappedSend = functoolsKit.rate(beginContext(async (content, payload) => {
@@ -14891,7 +14891,7 @@ const session = (clientId, swarmName, { onDispose } = {}) => {
14891
14891
  onDispose,
14892
14892
  });
14893
14893
  let isMounted = true;
14894
- const online = functoolsKit.singleshot(async () => {
14894
+ const online = functoolsKit.singlerun(async () => {
14895
14895
  await markOnline(clientId, swarmName);
14896
14896
  });
14897
14897
  return {
@@ -14938,7 +14938,7 @@ session.scheduled = (clientId, swarmName, { delay = SCHEDULED_DELAY, onDispose }
14938
14938
  onDispose,
14939
14939
  });
14940
14940
  let isMounted = true;
14941
- const online = functoolsKit.singleshot(async () => {
14941
+ const online = functoolsKit.singlerun(async () => {
14942
14942
  await markOnline(clientId, swarmName);
14943
14943
  });
14944
14944
  const wrappedComplete = functoolsKit.schedule(beginContext(async (content, payload) => {
@@ -15005,7 +15005,7 @@ session.rate = (clientId, swarmName, { delay = SCHEDULED_DELAY, onDispose } = {}
15005
15005
  onDispose,
15006
15006
  });
15007
15007
  let isMounted = true;
15008
- const online = functoolsKit.singleshot(async () => {
15008
+ const online = functoolsKit.singlerun(async () => {
15009
15009
  await markOnline(clientId, swarmName);
15010
15010
  });
15011
15011
  const wrappedComplete = functoolsKit.rate(beginContext(async (content, payload) => {
@@ -17241,7 +17241,6 @@ class AdapterUtils {
17241
17241
  */
17242
17242
  functoolsKit.execpool(functoolsKit.retry(async ({ agentName, messages: rawMessages, mode, tools, clientId, }) => {
17243
17243
  LoggerAdapter.logClient(clientId, "AdapterUtils fromLMStudio completion", JSON.stringify(rawMessages));
17244
- const toolNames = new Set(tools?.map((tool) => tool.function.name));
17245
17244
  const messages = rawMessages.map(({ role, tool_call_id, tool_calls, content }) => ({
17246
17245
  role,
17247
17246
  tool_call_id,
@@ -17267,9 +17266,7 @@ class AdapterUtils {
17267
17266
  mode,
17268
17267
  agentName,
17269
17268
  role,
17270
- tool_calls: tool_calls
17271
- ?.filter(({ function: { name } }) => toolNames.has(name))
17272
- ?.map(({ function: f, ...rest }) => ({
17269
+ tool_calls: tool_calls?.map(({ function: f, ...rest }) => ({
17273
17270
  ...rest,
17274
17271
  function: {
17275
17272
  name: f.name,
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, makeExtendable, singleshot, getErrorMessage, not, queued, memoize, retry, str, randomString, ToolRegistry, Subject, createAwaiter, sleep, errorData, isObject, cancelable, CANCELED_PROMISE_SYMBOL, SortedArray, execpool, Source, schedule, rate, ttl } from 'functools-kit';
3
+ import { trycatch, makeExtendable, singleshot, getErrorMessage, not, queued, memoize, retry, str, randomString, ToolRegistry, Subject, createAwaiter, sleep, errorData, isObject, cancelable, CANCELED_PROMISE_SYMBOL, SortedArray, execpool, Source, singlerun, schedule, rate, ttl } from 'functools-kit';
4
4
  import xml2js from 'xml2js';
5
5
  import fs, { access, mkdir } from 'fs/promises';
6
6
  import path, { join } from 'path';
@@ -14572,7 +14572,7 @@ const makeConnectionInternal = (connector, clientId, swarmName) => {
14572
14572
  */
14573
14573
  const makeConnection = (connector, clientId, swarmName) => {
14574
14574
  const send = makeConnectionInternal(connector, clientId, swarmName);
14575
- const online = singleshot(async () => {
14575
+ const online = singlerun(async () => {
14576
14576
  await markOnline(clientId, swarmName);
14577
14577
  });
14578
14578
  return beginContext(async (content, payload = null) => {
@@ -14606,7 +14606,7 @@ const makeConnection = (connector, clientId, swarmName) => {
14606
14606
  */
14607
14607
  makeConnection.scheduled = (connector, clientId, swarmName, { delay = SCHEDULED_DELAY$1 } = {}) => {
14608
14608
  const send = makeConnectionInternal(connector, clientId, swarmName);
14609
- const online = singleshot(async () => {
14609
+ const online = singlerun(async () => {
14610
14610
  await markOnline(clientId, swarmName);
14611
14611
  });
14612
14612
  const wrappedSend = schedule(beginContext(async (content, payload) => {
@@ -14663,7 +14663,7 @@ makeConnection.scheduled = (connector, clientId, swarmName, { delay = SCHEDULED_
14663
14663
  */
14664
14664
  makeConnection.rate = (connector, clientId, swarmName, { delay = RATE_DELAY } = {}) => {
14665
14665
  const send = makeConnectionInternal(connector, clientId, swarmName);
14666
- const online = singleshot(async () => {
14666
+ const online = singlerun(async () => {
14667
14667
  await markOnline(clientId, swarmName);
14668
14668
  });
14669
14669
  const wrappedSend = rate(beginContext(async (content, payload) => {
@@ -14889,7 +14889,7 @@ const session = (clientId, swarmName, { onDispose } = {}) => {
14889
14889
  onDispose,
14890
14890
  });
14891
14891
  let isMounted = true;
14892
- const online = singleshot(async () => {
14892
+ const online = singlerun(async () => {
14893
14893
  await markOnline(clientId, swarmName);
14894
14894
  });
14895
14895
  return {
@@ -14936,7 +14936,7 @@ session.scheduled = (clientId, swarmName, { delay = SCHEDULED_DELAY, onDispose }
14936
14936
  onDispose,
14937
14937
  });
14938
14938
  let isMounted = true;
14939
- const online = singleshot(async () => {
14939
+ const online = singlerun(async () => {
14940
14940
  await markOnline(clientId, swarmName);
14941
14941
  });
14942
14942
  const wrappedComplete = schedule(beginContext(async (content, payload) => {
@@ -15003,7 +15003,7 @@ session.rate = (clientId, swarmName, { delay = SCHEDULED_DELAY, onDispose } = {}
15003
15003
  onDispose,
15004
15004
  });
15005
15005
  let isMounted = true;
15006
- const online = singleshot(async () => {
15006
+ const online = singlerun(async () => {
15007
15007
  await markOnline(clientId, swarmName);
15008
15008
  });
15009
15009
  const wrappedComplete = rate(beginContext(async (content, payload) => {
@@ -17239,7 +17239,6 @@ class AdapterUtils {
17239
17239
  */
17240
17240
  execpool(retry(async ({ agentName, messages: rawMessages, mode, tools, clientId, }) => {
17241
17241
  LoggerAdapter.logClient(clientId, "AdapterUtils fromLMStudio completion", JSON.stringify(rawMessages));
17242
- const toolNames = new Set(tools?.map((tool) => tool.function.name));
17243
17242
  const messages = rawMessages.map(({ role, tool_call_id, tool_calls, content }) => ({
17244
17243
  role,
17245
17244
  tool_call_id,
@@ -17265,9 +17264,7 @@ class AdapterUtils {
17265
17264
  mode,
17266
17265
  agentName,
17267
17266
  role,
17268
- tool_calls: tool_calls
17269
- ?.filter(({ function: { name } }) => toolNames.has(name))
17270
- ?.map(({ function: f, ...rest }) => ({
17267
+ tool_calls: tool_calls?.map(({ function: f, ...rest }) => ({
17271
17268
  ...rest,
17272
17269
  function: {
17273
17270
  name: f.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.183",
3
+ "version": "1.0.185",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",