agent-swarm-kit 1.1.30 → 1.1.32

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
@@ -20054,11 +20054,12 @@ const startPipeline = beginContext(async (clientId, pipelineName, payload = {})
20054
20054
  const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$d, clientId, swarmName);
20055
20055
  const { execute, callbacks } = swarm$1.pipelineSchemaService.get(pipelineName);
20056
20056
  let isError = false;
20057
+ let result = null;
20057
20058
  try {
20058
20059
  if (callbacks?.onStart) {
20059
20060
  callbacks.onStart(clientId, pipelineName, payload);
20060
20061
  }
20061
- await execute(clientId, payload, agentName);
20062
+ result = await execute(clientId, agentName, payload);
20062
20063
  }
20063
20064
  catch (error) {
20064
20065
  if (callbacks?.onError) {
@@ -20071,6 +20072,7 @@ const startPipeline = beginContext(async (clientId, pipelineName, payload = {})
20071
20072
  callbacks.onEnd(clientId, pipelineName, payload, isError);
20072
20073
  }
20073
20074
  }
20075
+ return result;
20074
20076
  });
20075
20077
 
20076
20078
  /** @private Constant defining the method name for logging purposes */
package/build/index.mjs CHANGED
@@ -20052,11 +20052,12 @@ const startPipeline = beginContext(async (clientId, pipelineName, payload = {})
20052
20052
  const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$d, clientId, swarmName);
20053
20053
  const { execute, callbacks } = swarm$1.pipelineSchemaService.get(pipelineName);
20054
20054
  let isError = false;
20055
+ let result = null;
20055
20056
  try {
20056
20057
  if (callbacks?.onStart) {
20057
20058
  callbacks.onStart(clientId, pipelineName, payload);
20058
20059
  }
20059
- await execute(clientId, payload, agentName);
20060
+ result = await execute(clientId, agentName, payload);
20060
20061
  }
20061
20062
  catch (error) {
20062
20063
  if (callbacks?.onError) {
@@ -20069,6 +20070,7 @@ const startPipeline = beginContext(async (clientId, pipelineName, payload = {})
20069
20070
  callbacks.onEnd(clientId, pipelineName, payload, isError);
20070
20071
  }
20071
20072
  }
20073
+ return result;
20072
20074
  });
20073
20075
 
20074
20076
  /** @private Constant defining the method name for logging purposes */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
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
@@ -9941,7 +9941,7 @@ interface IPipelineSchema<Payload extends object = any> {
9941
9941
  * @param {AgentName} agentName - The name of the agent executing the pipeline.
9942
9942
  * @returns {Promise<T>} The result of the pipeline execution.
9943
9943
  */
9944
- execute: <T = any>(clientId: string, payload: Payload, agentName: AgentName) => Promise<T>;
9944
+ execute: <T = any>(clientId: string, agentName: AgentName, payload: Payload) => Promise<T | void>;
9945
9945
  /**
9946
9946
  * @property {Partial<IPipelineCallbacks<Payload>>} [callbacks]
9947
9947
  * @description Optional callbacks for pipeline lifecycle events.
@@ -11746,7 +11746,7 @@ interface ISessionConfig {
11746
11746
  onDispose?: () => void;
11747
11747
  }
11748
11748
 
11749
- declare const startPipeline: <Payload extends object = any>(clientId: string, pipelineName: PipelineName, payload?: Payload) => Promise<void>;
11749
+ declare const startPipeline: <Payload extends object = any, T = any>(clientId: string, pipelineName: PipelineName, payload?: Payload) => Promise<T>;
11750
11750
 
11751
11751
  /**
11752
11752
  * Disposes of a client session and all related resources within a swarm.