agent-swarm-kit 1.0.221 → 1.0.222

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
@@ -4307,7 +4307,7 @@ class AgentConnectionService {
4307
4307
  }
4308
4308
 
4309
4309
  /** @private Constant defining the method name for logging purposes */
4310
- const METHOD_NAME$X = "function.common.getPayload";
4310
+ const METHOD_NAME$Y = "function.common.getPayload";
4311
4311
  /**
4312
4312
  * Retrieves the payload from the current PayloadContextService context.
4313
4313
  * Returns null if no context is available. Logs the operation if logging is enabled.
@@ -4318,7 +4318,7 @@ const METHOD_NAME$X = "function.common.getPayload";
4318
4318
  * console.log(payload); // { id: number } or null
4319
4319
  */
4320
4320
  const getPayload = () => {
4321
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$X);
4321
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$Y);
4322
4322
  if (PayloadContextService.hasContext()) {
4323
4323
  const { payload } = swarm$1.payloadContextService.context;
4324
4324
  return payload;
@@ -13456,7 +13456,7 @@ const swarm = {
13456
13456
  init();
13457
13457
  var swarm$1 = swarm;
13458
13458
 
13459
- const METHOD_NAME$W = "cli.dumpDocs";
13459
+ const METHOD_NAME$X = "cli.dumpDocs";
13460
13460
  /**
13461
13461
  * Dumps the documentation for the agents and swarms.
13462
13462
  *
@@ -13466,7 +13466,7 @@ const METHOD_NAME$W = "cli.dumpDocs";
13466
13466
  */
13467
13467
  const dumpDocs = beginContext((prefix = "swarm", dirName = "./docs/chat", PlantUML) => {
13468
13468
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13469
- swarm$1.loggerService.log(METHOD_NAME$W, {
13469
+ swarm$1.loggerService.log(METHOD_NAME$X, {
13470
13470
  dirName,
13471
13471
  });
13472
13472
  if (PlantUML) {
@@ -13476,10 +13476,10 @@ const dumpDocs = beginContext((prefix = "swarm", dirName = "./docs/chat", PlantU
13476
13476
  }
13477
13477
  swarm$1.agentValidationService
13478
13478
  .getAgentList()
13479
- .forEach((agentName) => swarm$1.agentValidationService.validate(agentName, METHOD_NAME$W));
13479
+ .forEach((agentName) => swarm$1.agentValidationService.validate(agentName, METHOD_NAME$X));
13480
13480
  swarm$1.swarmValidationService
13481
13481
  .getSwarmList()
13482
- .forEach((swarmName) => swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$W));
13482
+ .forEach((swarmName) => swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$X));
13483
13483
  swarm$1.agentValidationService.getAgentList().forEach((agentName) => {
13484
13484
  const { dependsOn } = swarm$1.agentSchemaService.get(agentName);
13485
13485
  if (!dependsOn) {
@@ -13489,7 +13489,7 @@ const dumpDocs = beginContext((prefix = "swarm", dirName = "./docs/chat", PlantU
13489
13489
  return swarm$1.docService.dumpDocs(prefix, dirName);
13490
13490
  });
13491
13491
 
13492
- const METHOD_NAME$V = "cli.dumpAgent";
13492
+ const METHOD_NAME$W = "cli.dumpAgent";
13493
13493
  /**
13494
13494
  * Dumps the agent information into PlantUML format.
13495
13495
  *
@@ -13498,14 +13498,14 @@ const METHOD_NAME$V = "cli.dumpAgent";
13498
13498
  */
13499
13499
  const dumpAgent = beginContext((agentName, { withSubtree = false } = {}) => {
13500
13500
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13501
- swarm$1.loggerService.log(METHOD_NAME$V, {
13501
+ swarm$1.loggerService.log(METHOD_NAME$W, {
13502
13502
  agentName,
13503
13503
  });
13504
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$V);
13504
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$W);
13505
13505
  return swarm$1.agentMetaService.toUML(agentName, withSubtree);
13506
13506
  });
13507
13507
 
13508
- const METHOD_NAME$U = "cli.dumpSwarm";
13508
+ const METHOD_NAME$V = "cli.dumpSwarm";
13509
13509
  /**
13510
13510
  * Dumps the swarm information into PlantUML format.
13511
13511
  *
@@ -13514,14 +13514,14 @@ const METHOD_NAME$U = "cli.dumpSwarm";
13514
13514
  */
13515
13515
  const dumpSwarm = beginContext((swarmName) => {
13516
13516
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13517
- swarm$1.loggerService.log(METHOD_NAME$U, {
13517
+ swarm$1.loggerService.log(METHOD_NAME$V, {
13518
13518
  swarmName,
13519
13519
  });
13520
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$U);
13520
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$V);
13521
13521
  return swarm$1.swarmMetaService.toUML(swarmName);
13522
13522
  });
13523
13523
 
13524
- const METHOD_NAME$T = "cli.dumpPerfomance";
13524
+ const METHOD_NAME$U = "cli.dumpPerfomance";
13525
13525
  const METHOD_NAME_INTERNAL$1 = "cli.dumpPerfomance.internal";
13526
13526
  const METHOD_NAME_INTERVAL = "cli.dumpPerfomance.interval";
13527
13527
  /**
@@ -13540,7 +13540,7 @@ const dumpPerfomanceInternal = beginContext(async (dirName = "./logs/meta") => {
13540
13540
  * @returns {Promise<void>} A promise that resolves when the performance data has been dumped.
13541
13541
  */
13542
13542
  const dumpPerfomance = async (dirName = "./logs/meta") => {
13543
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$T);
13543
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$U);
13544
13544
  await dumpPerfomanceInternal(dirName);
13545
13545
  };
13546
13546
  /**
@@ -13598,7 +13598,7 @@ const listenExecutionEvent = beginContext((clientId, fn) => {
13598
13598
  return swarm$1.busService.subscribe(clientId, "execution-bus", functoolsKit.queued(async (e) => await fn(e)));
13599
13599
  });
13600
13600
 
13601
- const METHOD_NAME$S = "cli.dumpClientPerformance";
13601
+ const METHOD_NAME$T = "cli.dumpClientPerformance";
13602
13602
  const METHOD_NAME_INTERNAL = "cli.dumpClientPerformance.internal";
13603
13603
  const METHOD_NAME_EXECUTE = "cli.dumpClientPerformance.execute";
13604
13604
  /**
@@ -13622,7 +13622,7 @@ const dumpClientPerformanceInternal = beginContext(async (clientId, dirName = ".
13622
13622
  * @returns {Promise<void>} A promise that resolves when the performance data has been dumped.
13623
13623
  */
13624
13624
  const dumpClientPerformance = async (clientId, dirName = "./logs/client") => {
13625
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$S);
13625
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$T);
13626
13626
  await dumpClientPerformanceInternal(clientId, dirName);
13627
13627
  };
13628
13628
  /**
@@ -13642,7 +13642,7 @@ dumpClientPerformance.runAfterExecute = beginContext(async (dirName = "./logs/cl
13642
13642
  });
13643
13643
  });
13644
13644
 
13645
- const METHOD_NAME$R = "function.setup.addAgent";
13645
+ const METHOD_NAME$S = "function.setup.addAgent";
13646
13646
  /**
13647
13647
  * Adds a new agent to the agent registry for use within the swarm system.
13648
13648
  *
@@ -13662,7 +13662,7 @@ const METHOD_NAME$R = "function.setup.addAgent";
13662
13662
  const addAgent = beginContext((agentSchema) => {
13663
13663
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
13664
13664
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13665
- swarm$1.loggerService.log(METHOD_NAME$R, {
13665
+ swarm$1.loggerService.log(METHOD_NAME$S, {
13666
13666
  agentSchema,
13667
13667
  });
13668
13668
  // Register the agent in the validation and schema services
@@ -13672,7 +13672,7 @@ const addAgent = beginContext((agentSchema) => {
13672
13672
  return agentSchema.agentName;
13673
13673
  });
13674
13674
 
13675
- const METHOD_NAME$Q = "function.setup.addCompletion";
13675
+ const METHOD_NAME$R = "function.setup.addCompletion";
13676
13676
  /**
13677
13677
  * Adds a completion engine to the registry for use by agents in the swarm system.
13678
13678
  *
@@ -13692,7 +13692,7 @@ const METHOD_NAME$Q = "function.setup.addCompletion";
13692
13692
  const addCompletion = beginContext((completionSchema) => {
13693
13693
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
13694
13694
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13695
- swarm$1.loggerService.log(METHOD_NAME$Q, {
13695
+ swarm$1.loggerService.log(METHOD_NAME$R, {
13696
13696
  completionSchema,
13697
13697
  });
13698
13698
  // Register the completion in the validation and schema services
@@ -13702,7 +13702,7 @@ const addCompletion = beginContext((completionSchema) => {
13702
13702
  return completionSchema.completionName;
13703
13703
  });
13704
13704
 
13705
- const METHOD_NAME$P = "function.setup.addSwarm";
13705
+ const METHOD_NAME$Q = "function.setup.addSwarm";
13706
13706
  /**
13707
13707
  * Adds a new swarm to the system for managing client sessions.
13708
13708
  *
@@ -13722,7 +13722,7 @@ const METHOD_NAME$P = "function.setup.addSwarm";
13722
13722
  const addSwarm = beginContext((swarmSchema) => {
13723
13723
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
13724
13724
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13725
- swarm$1.loggerService.log(METHOD_NAME$P, {
13725
+ swarm$1.loggerService.log(METHOD_NAME$Q, {
13726
13726
  swarmSchema,
13727
13727
  });
13728
13728
  // Register the swarm in the validation and schema services
@@ -13732,7 +13732,7 @@ const addSwarm = beginContext((swarmSchema) => {
13732
13732
  return swarmSchema.swarmName;
13733
13733
  });
13734
13734
 
13735
- const METHOD_NAME$O = "function.setup.addTool";
13735
+ const METHOD_NAME$P = "function.setup.addTool";
13736
13736
  /**
13737
13737
  * Adds a new tool to the tool registry for use by agents in the swarm system.
13738
13738
  *
@@ -13754,7 +13754,7 @@ const METHOD_NAME$O = "function.setup.addTool";
13754
13754
  const addTool = beginContext((toolSchema) => {
13755
13755
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
13756
13756
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13757
- swarm$1.loggerService.log(METHOD_NAME$O, {
13757
+ swarm$1.loggerService.log(METHOD_NAME$P, {
13758
13758
  toolSchema,
13759
13759
  });
13760
13760
  // Register the tool in the validation and schema services
@@ -13764,7 +13764,7 @@ const addTool = beginContext((toolSchema) => {
13764
13764
  return toolSchema.toolName;
13765
13765
  });
13766
13766
 
13767
- const METHOD_NAME$N = "function.setup.addState";
13767
+ const METHOD_NAME$O = "function.setup.addState";
13768
13768
  /**
13769
13769
  * Adds a new state to the state registry for use within the swarm system.
13770
13770
  *
@@ -13786,7 +13786,7 @@ const METHOD_NAME$N = "function.setup.addState";
13786
13786
  const addState = beginContext((stateSchema) => {
13787
13787
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
13788
13788
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13789
- swarm$1.loggerService.log(METHOD_NAME$N, {
13789
+ swarm$1.loggerService.log(METHOD_NAME$O, {
13790
13790
  stateSchema,
13791
13791
  });
13792
13792
  // Register the state in the schema service
@@ -13801,7 +13801,7 @@ const addState = beginContext((stateSchema) => {
13801
13801
  return stateSchema.stateName;
13802
13802
  });
13803
13803
 
13804
- const METHOD_NAME$M = "function.setup.addEmbedding";
13804
+ const METHOD_NAME$N = "function.setup.addEmbedding";
13805
13805
  /**
13806
13806
  * Adds a new embedding engine to the embedding registry for use within the swarm system.
13807
13807
  *
@@ -13821,7 +13821,7 @@ const METHOD_NAME$M = "function.setup.addEmbedding";
13821
13821
  const addEmbedding = beginContext((embeddingSchema) => {
13822
13822
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
13823
13823
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13824
- swarm$1.loggerService.log(METHOD_NAME$M, {
13824
+ swarm$1.loggerService.log(METHOD_NAME$N, {
13825
13825
  embeddingSchema,
13826
13826
  });
13827
13827
  // Register the embedding in the validation and schema services
@@ -13831,7 +13831,7 @@ const addEmbedding = beginContext((embeddingSchema) => {
13831
13831
  return embeddingSchema.embeddingName;
13832
13832
  });
13833
13833
 
13834
- const METHOD_NAME$L = "function.setup.addStorage";
13834
+ const METHOD_NAME$M = "function.setup.addStorage";
13835
13835
  /**
13836
13836
  * Adds a new storage engine to the storage registry for use within the swarm system.
13837
13837
  *
@@ -13853,7 +13853,7 @@ const METHOD_NAME$L = "function.setup.addStorage";
13853
13853
  const addStorage = beginContext((storageSchema) => {
13854
13854
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
13855
13855
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13856
- swarm$1.loggerService.log(METHOD_NAME$L, {
13856
+ swarm$1.loggerService.log(METHOD_NAME$M, {
13857
13857
  storageSchema,
13858
13858
  });
13859
13859
  // Register the storage in the validation and schema services
@@ -13870,7 +13870,7 @@ const addStorage = beginContext((storageSchema) => {
13870
13870
  });
13871
13871
 
13872
13872
  /** @private Constant defining the method name for logging and validation context */
13873
- const METHOD_NAME$K = "function.setup.addPolicy";
13873
+ const METHOD_NAME$L = "function.setup.addPolicy";
13874
13874
  /**
13875
13875
  * Adds a new policy for agents in the swarm system by registering it with validation and schema services.
13876
13876
  * Registers the policy with PolicyValidationService for runtime validation and PolicySchemaService for schema management.
@@ -13886,7 +13886,7 @@ const METHOD_NAME$K = "function.setup.addPolicy";
13886
13886
  const addPolicy = beginContext((policySchema) => {
13887
13887
  // Log the policy addition attempt if enabled
13888
13888
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13889
- swarm$1.loggerService.log(METHOD_NAME$K, {
13889
+ swarm$1.loggerService.log(METHOD_NAME$L, {
13890
13890
  policySchema,
13891
13891
  });
13892
13892
  // Register the policy with PolicyValidationService for runtime validation
@@ -13897,7 +13897,7 @@ const addPolicy = beginContext((policySchema) => {
13897
13897
  return policySchema.policyName;
13898
13898
  });
13899
13899
 
13900
- const METHOD_NAME$J = "function.other.markOnline";
13900
+ const METHOD_NAME$K = "function.other.markOnline";
13901
13901
  /**
13902
13902
  * Marks a client as online in the specified swarm.
13903
13903
  *
@@ -13909,16 +13909,16 @@ const METHOD_NAME$J = "function.other.markOnline";
13909
13909
  const markOnline = async (clientId, swarmName) => {
13910
13910
  // Log the operation if logging is enabled in the global configuration
13911
13911
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13912
- swarm.loggerService.log(METHOD_NAME$J, {
13912
+ swarm.loggerService.log(METHOD_NAME$K, {
13913
13913
  clientId,
13914
13914
  });
13915
13915
  // Validate the swarm name
13916
- swarm.swarmValidationService.validate(swarmName, METHOD_NAME$J);
13916
+ swarm.swarmValidationService.validate(swarmName, METHOD_NAME$K);
13917
13917
  // Run the operation in the method context
13918
13918
  return await MethodContextService.runInContext(async () => {
13919
- await swarm.aliveService.markOnline(clientId, swarmName, METHOD_NAME$J);
13919
+ await swarm.aliveService.markOnline(clientId, swarmName, METHOD_NAME$K);
13920
13920
  }, {
13921
- methodName: METHOD_NAME$J,
13921
+ methodName: METHOD_NAME$K,
13922
13922
  agentName: "",
13923
13923
  policyName: "",
13924
13924
  stateName: "",
@@ -13928,7 +13928,7 @@ const markOnline = async (clientId, swarmName) => {
13928
13928
  });
13929
13929
  };
13930
13930
 
13931
- const METHOD_NAME$I = "function.other.markOffline";
13931
+ const METHOD_NAME$J = "function.other.markOffline";
13932
13932
  /**
13933
13933
  * Marks a client as offline in the specified swarm.
13934
13934
  *
@@ -13943,14 +13943,14 @@ const METHOD_NAME$I = "function.other.markOffline";
13943
13943
  */
13944
13944
  const markOffline = async (clientId, swarmName) => {
13945
13945
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13946
- swarm.loggerService.log(METHOD_NAME$I, {
13946
+ swarm.loggerService.log(METHOD_NAME$J, {
13947
13947
  clientId,
13948
13948
  });
13949
- swarm.swarmValidationService.validate(swarmName, METHOD_NAME$I);
13949
+ swarm.swarmValidationService.validate(swarmName, METHOD_NAME$J);
13950
13950
  return await MethodContextService.runInContext(async () => {
13951
- await swarm.aliveService.markOffline(clientId, swarmName, METHOD_NAME$I);
13951
+ await swarm.aliveService.markOffline(clientId, swarmName, METHOD_NAME$J);
13952
13952
  }, {
13953
- methodName: METHOD_NAME$I,
13953
+ methodName: METHOD_NAME$J,
13954
13954
  agentName: "",
13955
13955
  policyName: "",
13956
13956
  stateName: "",
@@ -13960,7 +13960,7 @@ const markOffline = async (clientId, swarmName) => {
13960
13960
  });
13961
13961
  };
13962
13962
 
13963
- const METHOD_NAME$H = "function.commit.commitToolOutput";
13963
+ const METHOD_NAME$I = "function.commit.commitToolOutput";
13964
13964
  /**
13965
13965
  * Commits the output of a tool execution to the active agent in a swarm session.
13966
13966
  *
@@ -13980,19 +13980,19 @@ const METHOD_NAME$H = "function.commit.commitToolOutput";
13980
13980
  const commitToolOutput = beginContext(async (toolId, content, clientId, agentName) => {
13981
13981
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
13982
13982
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
13983
- swarm$1.loggerService.log(METHOD_NAME$H, {
13983
+ swarm$1.loggerService.log(METHOD_NAME$I, {
13984
13984
  toolId,
13985
13985
  content,
13986
13986
  clientId,
13987
13987
  agentName,
13988
13988
  });
13989
13989
  // Validate the agent, session, and swarm to ensure they exist and are accessible
13990
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$H);
13991
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$H);
13990
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$I);
13991
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$I);
13992
13992
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
13993
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$H);
13993
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$I);
13994
13994
  // Check if the specified agent is still the active agent in the swarm session
13995
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$H, clientId, swarmName);
13995
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$I, clientId, swarmName);
13996
13996
  if (currentAgentName !== agentName) {
13997
13997
  // Log a skip message if the agent has changed during the operation
13998
13998
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
@@ -14005,11 +14005,11 @@ const commitToolOutput = beginContext(async (toolId, content, clientId, agentNam
14005
14005
  return;
14006
14006
  }
14007
14007
  // Commit the tool output to the session via the session public service
14008
- await swarm$1.sessionPublicService.commitToolOutput(toolId, content, METHOD_NAME$H, clientId, swarmName);
14008
+ await swarm$1.sessionPublicService.commitToolOutput(toolId, content, METHOD_NAME$I, clientId, swarmName);
14009
14009
  });
14010
14010
 
14011
14011
  /** @private Constant defining the method name for logging and validation context */
14012
- const METHOD_NAME$G = "function.commit.commitSystemMessage";
14012
+ const METHOD_NAME$H = "function.commit.commitSystemMessage";
14013
14013
  /**
14014
14014
  * Commits a system-generated message to the active agent in the swarm system.
14015
14015
  * Validates the agent, session, and swarm, ensuring the current agent matches the provided agent before committing the message.
@@ -14028,20 +14028,20 @@ const METHOD_NAME$G = "function.commit.commitSystemMessage";
14028
14028
  const commitSystemMessage = beginContext(async (content, clientId, agentName) => {
14029
14029
  // Log the commit attempt if enabled
14030
14030
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14031
- swarm$1.loggerService.log(METHOD_NAME$G, {
14031
+ swarm$1.loggerService.log(METHOD_NAME$H, {
14032
14032
  content,
14033
14033
  clientId,
14034
14034
  agentName,
14035
14035
  });
14036
14036
  // Validate the agent exists
14037
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$G);
14037
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$H);
14038
14038
  // Validate the session exists and retrieve the associated swarm
14039
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$G);
14039
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$H);
14040
14040
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14041
14041
  // Validate the swarm configuration
14042
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$G);
14042
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$H);
14043
14043
  // Check if the current agent matches the provided agent
14044
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$G, clientId, swarmName);
14044
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$H, clientId, swarmName);
14045
14045
  if (currentAgentName !== agentName) {
14046
14046
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14047
14047
  swarm$1.loggerService.log('function "commitSystemMessage" skipped due to the agent change', {
@@ -14052,11 +14052,11 @@ const commitSystemMessage = beginContext(async (content, clientId, agentName) =>
14052
14052
  return;
14053
14053
  }
14054
14054
  // Commit the system message via SessionPublicService
14055
- await swarm$1.sessionPublicService.commitSystemMessage(content, METHOD_NAME$G, clientId, swarmName);
14055
+ await swarm$1.sessionPublicService.commitSystemMessage(content, METHOD_NAME$H, clientId, swarmName);
14056
14056
  });
14057
14057
 
14058
14058
  /** @private Constant defining the method name for logging and validation context */
14059
- const METHOD_NAME$F = "function.commit.commitFlush";
14059
+ const METHOD_NAME$G = "function.commit.commitFlush";
14060
14060
  /**
14061
14061
  * Commits a flush of agent history for a specific client and agent in the swarm system.
14062
14062
  * Validates the agent, session, and swarm, ensuring the current agent matches the provided agent before flushing the history.
@@ -14073,19 +14073,19 @@ const METHOD_NAME$F = "function.commit.commitFlush";
14073
14073
  const commitFlush = beginContext(async (clientId, agentName) => {
14074
14074
  // Log the flush attempt if enabled
14075
14075
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14076
- swarm$1.loggerService.log(METHOD_NAME$F, {
14076
+ swarm$1.loggerService.log(METHOD_NAME$G, {
14077
14077
  clientId,
14078
14078
  agentName,
14079
14079
  });
14080
14080
  // Validate the agent exists
14081
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$F);
14081
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$G);
14082
14082
  // Validate the session exists and retrieve the associated swarm
14083
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$F);
14083
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$G);
14084
14084
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14085
14085
  // Validate the swarm configuration
14086
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$F);
14086
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$G);
14087
14087
  // Check if the current agent matches the provided agent
14088
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$F, clientId, swarmName);
14088
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$G, clientId, swarmName);
14089
14089
  if (currentAgentName !== agentName) {
14090
14090
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14091
14091
  swarm$1.loggerService.log('function "commitFlush" skipped due to the agent change', {
@@ -14096,10 +14096,10 @@ const commitFlush = beginContext(async (clientId, agentName) => {
14096
14096
  return;
14097
14097
  }
14098
14098
  // Commit the flush of agent history via SessionPublicService
14099
- await swarm$1.sessionPublicService.commitFlush(METHOD_NAME$F, clientId, swarmName);
14099
+ await swarm$1.sessionPublicService.commitFlush(METHOD_NAME$G, clientId, swarmName);
14100
14100
  });
14101
14101
 
14102
- const METHOD_NAME$E = "function.commit.commitSystemMessage";
14102
+ const METHOD_NAME$F = "function.commit.commitSystemMessage";
14103
14103
  /**
14104
14104
  * Commits a user message to the active agent's history in a swarm session without triggering a response.
14105
14105
  *
@@ -14118,19 +14118,19 @@ const METHOD_NAME$E = "function.commit.commitSystemMessage";
14118
14118
  const commitUserMessage = beginContext(async (content, mode, clientId, agentName, payload) => {
14119
14119
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14120
14120
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14121
- swarm$1.loggerService.log(METHOD_NAME$E, {
14121
+ swarm$1.loggerService.log(METHOD_NAME$F, {
14122
14122
  content,
14123
14123
  clientId,
14124
14124
  agentName,
14125
14125
  mode,
14126
14126
  });
14127
14127
  // Validate the agent, session, and swarm to ensure they exist and are accessible
14128
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$E);
14129
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$E);
14128
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$F);
14129
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$F);
14130
14130
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14131
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$E);
14131
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$F);
14132
14132
  // Check if the specified agent is still the active agent in the swarm session
14133
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$E, clientId, swarmName);
14133
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$F, clientId, swarmName);
14134
14134
  if (currentAgentName !== agentName) {
14135
14135
  // Log a skip message if the agent has changed during the operation
14136
14136
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
@@ -14143,17 +14143,17 @@ const commitUserMessage = beginContext(async (content, mode, clientId, agentName
14143
14143
  }
14144
14144
  if (payload) {
14145
14145
  return await PayloadContextService.runInContext(async () => {
14146
- await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$E, clientId, swarmName);
14146
+ await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$F, clientId, swarmName);
14147
14147
  }, {
14148
14148
  clientId,
14149
14149
  payload,
14150
14150
  });
14151
14151
  }
14152
14152
  // Commit the user message to the agent's history via the session public service
14153
- return await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$E, clientId, swarmName);
14153
+ return await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$F, clientId, swarmName);
14154
14154
  });
14155
14155
 
14156
- const METHOD_NAME$D = "function.commit.commitToolOutputForce";
14156
+ const METHOD_NAME$E = "function.commit.commitToolOutputForce";
14157
14157
  /**
14158
14158
  * Commits the output of a tool execution to the active agent in a swarm session without checking the active agent.
14159
14159
  *
@@ -14172,21 +14172,21 @@ const METHOD_NAME$D = "function.commit.commitToolOutputForce";
14172
14172
  const commitToolOutputForce = beginContext(async (toolId, content, clientId) => {
14173
14173
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14174
14174
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14175
- swarm$1.loggerService.log(METHOD_NAME$D, {
14175
+ swarm$1.loggerService.log(METHOD_NAME$E, {
14176
14176
  toolId,
14177
14177
  content,
14178
14178
  clientId,
14179
14179
  });
14180
14180
  // Validate the session and swarm to ensure they exist and are accessible
14181
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$D);
14181
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$E);
14182
14182
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14183
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$D);
14183
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$E);
14184
14184
  // Commit the tool output to the session via the session public service without checking the active agent
14185
- await swarm$1.sessionPublicService.commitToolOutput(toolId, content, METHOD_NAME$D, clientId, swarmName);
14185
+ await swarm$1.sessionPublicService.commitToolOutput(toolId, content, METHOD_NAME$E, clientId, swarmName);
14186
14186
  });
14187
14187
 
14188
14188
  /** @private Constant defining the method name for logging and validation context */
14189
- const METHOD_NAME$C = "function.commit.commitSystemMessageForce";
14189
+ const METHOD_NAME$D = "function.commit.commitSystemMessageForce";
14190
14190
  /**
14191
14191
  * Forcefully commits a system-generated message to a session in the swarm system, without checking the active agent.
14192
14192
  * Validates the session and swarm, then proceeds with committing the message regardless of the current agent state.
@@ -14205,21 +14205,21 @@ const METHOD_NAME$C = "function.commit.commitSystemMessageForce";
14205
14205
  const commitSystemMessageForce = beginContext(async (content, clientId) => {
14206
14206
  // Log the commit attempt if enabled
14207
14207
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14208
- swarm$1.loggerService.log(METHOD_NAME$C, {
14208
+ swarm$1.loggerService.log(METHOD_NAME$D, {
14209
14209
  content,
14210
14210
  clientId,
14211
14211
  });
14212
14212
  // Validate the session exists and retrieve the associated swarm
14213
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$C);
14213
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$D);
14214
14214
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14215
14215
  // Validate the swarm configuration
14216
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$C);
14216
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$D);
14217
14217
  // Commit the system message via SessionPublicService without agent checks
14218
- await swarm$1.sessionPublicService.commitSystemMessage(content, METHOD_NAME$C, clientId, swarmName);
14218
+ await swarm$1.sessionPublicService.commitSystemMessage(content, METHOD_NAME$D, clientId, swarmName);
14219
14219
  });
14220
14220
 
14221
14221
  /** @private Constant defining the method name for logging and validation context */
14222
- const METHOD_NAME$B = "function.commit.commitFlushForce";
14222
+ const METHOD_NAME$C = "function.commit.commitFlushForce";
14223
14223
  /**
14224
14224
  * Forcefully commits a flush of agent history for a specific client in the swarm system, without checking the active agent.
14225
14225
  * Validates the session and swarm, then proceeds with flushing the history regardless of the current agent state.
@@ -14237,20 +14237,20 @@ const METHOD_NAME$B = "function.commit.commitFlushForce";
14237
14237
  const commitFlushForce = beginContext(async (clientId) => {
14238
14238
  // Log the flush attempt if enabled
14239
14239
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14240
- swarm$1.loggerService.log(METHOD_NAME$B, {
14240
+ swarm$1.loggerService.log(METHOD_NAME$C, {
14241
14241
  clientId,
14242
- METHOD_NAME: METHOD_NAME$B,
14242
+ METHOD_NAME: METHOD_NAME$C,
14243
14243
  });
14244
14244
  // Validate the session exists and retrieve the associated swarm
14245
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$B);
14245
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$C);
14246
14246
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14247
14247
  // Validate the swarm configuration
14248
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$B);
14248
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$C);
14249
14249
  // Commit the flush of agent history via SessionPublicService without agent checks
14250
- await swarm$1.sessionPublicService.commitFlush(METHOD_NAME$B, clientId, swarmName);
14250
+ await swarm$1.sessionPublicService.commitFlush(METHOD_NAME$C, clientId, swarmName);
14251
14251
  });
14252
14252
 
14253
- const METHOD_NAME$A = "function.commit.commitSystemMessage";
14253
+ const METHOD_NAME$B = "function.commit.commitSystemMessage";
14254
14254
  /**
14255
14255
  * Commits a user message to the active agent's history in a swarm session without triggering a response and without checking the active agent.
14256
14256
  *
@@ -14268,29 +14268,29 @@ const METHOD_NAME$A = "function.commit.commitSystemMessage";
14268
14268
  const commitUserMessageForce = beginContext(async (content, mode, clientId, payload) => {
14269
14269
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14270
14270
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14271
- swarm$1.loggerService.log(METHOD_NAME$A, {
14271
+ swarm$1.loggerService.log(METHOD_NAME$B, {
14272
14272
  content,
14273
14273
  clientId,
14274
14274
  mode,
14275
14275
  });
14276
14276
  // Validate the session and swarm to ensure they exist and are accessible
14277
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$A);
14277
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$B);
14278
14278
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14279
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$A);
14279
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$B);
14280
14280
  if (payload) {
14281
14281
  return await PayloadContextService.runInContext(async () => {
14282
- await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$A, clientId, swarmName);
14282
+ await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$B, clientId, swarmName);
14283
14283
  }, {
14284
14284
  clientId,
14285
14285
  payload,
14286
14286
  });
14287
14287
  }
14288
14288
  // Commit the user message to the agent's history via the session public service without checking the active agent
14289
- return await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$A, clientId, swarmName);
14289
+ return await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$B, clientId, swarmName);
14290
14290
  });
14291
14291
 
14292
14292
  /** @private Constant defining the method name for logging and validation context */
14293
- const METHOD_NAME$z = "function.commit.commitAssistantMessage";
14293
+ const METHOD_NAME$A = "function.commit.commitAssistantMessage";
14294
14294
  /**
14295
14295
  * Commits an assistant-generated message to the active agent in the swarm system.
14296
14296
  * Validates the agent, session, and swarm, ensuring the current agent matches the provided agent before committing the message.
@@ -14308,20 +14308,20 @@ const METHOD_NAME$z = "function.commit.commitAssistantMessage";
14308
14308
  const commitAssistantMessage = beginContext(async (content, clientId, agentName) => {
14309
14309
  // Log the commit attempt if enabled
14310
14310
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14311
- swarm$1.loggerService.log(METHOD_NAME$z, {
14311
+ swarm$1.loggerService.log(METHOD_NAME$A, {
14312
14312
  content,
14313
14313
  clientId,
14314
14314
  agentName,
14315
14315
  });
14316
14316
  // Validate the agent exists
14317
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$z);
14317
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$A);
14318
14318
  // Validate the session exists and retrieve the associated swarm
14319
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$z);
14319
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$A);
14320
14320
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14321
14321
  // Validate the swarm configuration
14322
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$z);
14322
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$A);
14323
14323
  // Check if the current agent matches the provided agent
14324
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$z, clientId, swarmName);
14324
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$A, clientId, swarmName);
14325
14325
  if (currentAgentName !== agentName) {
14326
14326
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14327
14327
  swarm$1.loggerService.log('function "commitAssistantMessage" skipped due to the agent change', {
@@ -14332,11 +14332,11 @@ const commitAssistantMessage = beginContext(async (content, clientId, agentName)
14332
14332
  return;
14333
14333
  }
14334
14334
  // Commit the assistant message via SessionPublicService
14335
- await swarm$1.sessionPublicService.commitAssistantMessage(content, METHOD_NAME$z, clientId, swarmName);
14335
+ await swarm$1.sessionPublicService.commitAssistantMessage(content, METHOD_NAME$A, clientId, swarmName);
14336
14336
  });
14337
14337
 
14338
14338
  /** @private Constant defining the method name for logging and validation context */
14339
- const METHOD_NAME$y = "function.commit.commitAssistantMessageForce";
14339
+ const METHOD_NAME$z = "function.commit.commitAssistantMessageForce";
14340
14340
  /**
14341
14341
  * Forcefully commits an assistant-generated message to a session in the swarm system, without checking the active agent.
14342
14342
  * Validates the session and swarm, then proceeds with committing the message regardless of the current agent state.
@@ -14355,21 +14355,21 @@ const METHOD_NAME$y = "function.commit.commitAssistantMessageForce";
14355
14355
  const commitAssistantMessageForce = beginContext(async (content, clientId) => {
14356
14356
  // Log the commit attempt if enabled
14357
14357
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14358
- swarm$1.loggerService.log(METHOD_NAME$y, {
14358
+ swarm$1.loggerService.log(METHOD_NAME$z, {
14359
14359
  content,
14360
14360
  clientId,
14361
14361
  });
14362
14362
  // Validate the session exists and retrieve the associated swarm
14363
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$y);
14363
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$z);
14364
14364
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14365
14365
  // Validate the swarm configuration
14366
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$y);
14366
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$z);
14367
14367
  // Commit the assistant message via SessionPublicService without agent checks
14368
- await swarm$1.sessionPublicService.commitAssistantMessage(content, METHOD_NAME$y, clientId, swarmName);
14368
+ await swarm$1.sessionPublicService.commitAssistantMessage(content, METHOD_NAME$z, clientId, swarmName);
14369
14369
  });
14370
14370
 
14371
14371
  /** @private Constant defining the method name for logging and validation context */
14372
- const METHOD_NAME$x = "function.commit.cancelOutput";
14372
+ const METHOD_NAME$y = "function.commit.cancelOutput";
14373
14373
  /**
14374
14374
  * Cancels the awaited output for a specific client and agent by emitting an empty string.
14375
14375
  * Validates the agent, session, and swarm, ensuring the current agent matches the provided agent before cancellation.
@@ -14385,19 +14385,19 @@ const METHOD_NAME$x = "function.commit.cancelOutput";
14385
14385
  const cancelOutput = beginContext(async (clientId, agentName) => {
14386
14386
  // Log the cancellation attempt if enabled
14387
14387
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14388
- swarm$1.loggerService.log(METHOD_NAME$x, {
14388
+ swarm$1.loggerService.log(METHOD_NAME$y, {
14389
14389
  clientId,
14390
14390
  agentName,
14391
14391
  });
14392
14392
  // Validate the agent exists
14393
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$x);
14393
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$y);
14394
14394
  // Validate the session exists and retrieve the associated swarm
14395
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$x);
14395
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$y);
14396
14396
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14397
14397
  // Validate the swarm configuration
14398
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$x);
14398
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$y);
14399
14399
  // Check if the current agent matches the provided agent
14400
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$x, clientId, swarmName);
14400
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$y, clientId, swarmName);
14401
14401
  if (currentAgentName !== agentName) {
14402
14402
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14403
14403
  swarm$1.loggerService.log('function "cancelOutput" skipped due to the agent change', {
@@ -14408,11 +14408,11 @@ const cancelOutput = beginContext(async (clientId, agentName) => {
14408
14408
  return;
14409
14409
  }
14410
14410
  // Perform the output cancellation via SwarmPublicService
14411
- await swarm$1.swarmPublicService.cancelOutput(METHOD_NAME$x, clientId, swarmName);
14411
+ await swarm$1.swarmPublicService.cancelOutput(METHOD_NAME$y, clientId, swarmName);
14412
14412
  });
14413
14413
 
14414
14414
  /** @private Constant defining the method name for logging and validation context */
14415
- const METHOD_NAME$w = "function.commit.cancelOutputForce";
14415
+ const METHOD_NAME$x = "function.commit.cancelOutputForce";
14416
14416
  /**
14417
14417
  * Forcefully cancels the awaited output for a specific client by emitting an empty string, without checking the active agent.
14418
14418
  * Validates the session and swarm, then proceeds with cancellation regardless of the current agent state.
@@ -14429,20 +14429,20 @@ const METHOD_NAME$w = "function.commit.cancelOutputForce";
14429
14429
  const cancelOutputForce = beginContext(async (clientId) => {
14430
14430
  // Log the cancellation attempt if enabled
14431
14431
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14432
- swarm$1.loggerService.log(METHOD_NAME$w, {
14432
+ swarm$1.loggerService.log(METHOD_NAME$x, {
14433
14433
  clientId,
14434
14434
  });
14435
14435
  // Validate the session exists and retrieve the associated swarm
14436
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$w);
14436
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$x);
14437
14437
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14438
14438
  // Validate the swarm configuration
14439
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$w);
14439
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$x);
14440
14440
  // Perform the output cancellation via SwarmPublicService without agent checks
14441
- await swarm$1.swarmPublicService.cancelOutput(METHOD_NAME$w, clientId, swarmName);
14441
+ await swarm$1.swarmPublicService.cancelOutput(METHOD_NAME$x, clientId, swarmName);
14442
14442
  });
14443
14443
 
14444
14444
  /** @private Constant defining the method name for logging and validation context */
14445
- const METHOD_NAME$v = "function.commit.commitStopTools";
14445
+ const METHOD_NAME$w = "function.commit.commitStopTools";
14446
14446
  /**
14447
14447
  * Prevents the next tool from being executed for a specific client and agent in the swarm system.
14448
14448
  * Validates the agent, session, and swarm, ensuring the current agent matches the provided agent before stopping tool execution.
@@ -14459,19 +14459,19 @@ const METHOD_NAME$v = "function.commit.commitStopTools";
14459
14459
  const commitStopTools = beginContext(async (clientId, agentName) => {
14460
14460
  // Log the stop tools attempt if enabled
14461
14461
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14462
- swarm$1.loggerService.log(METHOD_NAME$v, {
14462
+ swarm$1.loggerService.log(METHOD_NAME$w, {
14463
14463
  clientId,
14464
14464
  agentName,
14465
14465
  });
14466
14466
  // Validate the agent exists
14467
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$v);
14467
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$w);
14468
14468
  // Validate the session exists and retrieve the associated swarm
14469
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$v);
14469
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$w);
14470
14470
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14471
14471
  // Validate the swarm configuration
14472
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$v);
14472
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$w);
14473
14473
  // Check if the current agent matches the provided agent
14474
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$v, clientId, swarmName);
14474
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$w, clientId, swarmName);
14475
14475
  if (currentAgentName !== agentName) {
14476
14476
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14477
14477
  swarm$1.loggerService.log('function "commitStopTools" skipped due to the agent change', {
@@ -14482,11 +14482,11 @@ const commitStopTools = beginContext(async (clientId, agentName) => {
14482
14482
  return;
14483
14483
  }
14484
14484
  // Commit the stop of the next tool execution via SessionPublicService
14485
- await swarm$1.sessionPublicService.commitStopTools(METHOD_NAME$v, clientId, swarmName);
14485
+ await swarm$1.sessionPublicService.commitStopTools(METHOD_NAME$w, clientId, swarmName);
14486
14486
  });
14487
14487
 
14488
14488
  /** @private Constant defining the method name for logging and validation context */
14489
- const METHOD_NAME$u = "function.commit.commitStopToolsForce";
14489
+ const METHOD_NAME$v = "function.commit.commitStopToolsForce";
14490
14490
  /**
14491
14491
  * Forcefully prevents the next tool from being executed for a specific client in the swarm system, without checking the active agent.
14492
14492
  * Validates the session and swarm, then proceeds with stopping tool execution regardless of the current agent state.
@@ -14504,20 +14504,20 @@ const METHOD_NAME$u = "function.commit.commitStopToolsForce";
14504
14504
  const commitStopToolsForce = beginContext(async (clientId) => {
14505
14505
  // Log the stop tools attempt if enabled
14506
14506
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14507
- swarm$1.loggerService.log(METHOD_NAME$u, {
14507
+ swarm$1.loggerService.log(METHOD_NAME$v, {
14508
14508
  clientId,
14509
- METHOD_NAME: METHOD_NAME$u,
14509
+ METHOD_NAME: METHOD_NAME$v,
14510
14510
  });
14511
14511
  // Validate the session exists and retrieve the associated swarm
14512
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$u);
14512
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$v);
14513
14513
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14514
14514
  // Validate the swarm configuration
14515
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$u);
14515
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$v);
14516
14516
  // Commit the stop of the next tool execution via SessionPublicService without agent checks
14517
- await swarm$1.sessionPublicService.commitStopTools(METHOD_NAME$u, clientId, swarmName);
14517
+ await swarm$1.sessionPublicService.commitStopTools(METHOD_NAME$v, clientId, swarmName);
14518
14518
  });
14519
14519
 
14520
- const METHOD_NAME$t = "function.target.emitForce";
14520
+ const METHOD_NAME$u = "function.target.emitForce";
14521
14521
  /**
14522
14522
  * Emits a string as model output without executing an incoming message or checking the active agent.
14523
14523
  *
@@ -14536,19 +14536,19 @@ const METHOD_NAME$t = "function.target.emitForce";
14536
14536
  const emitForce = beginContext(async (content, clientId) => {
14537
14537
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14538
14538
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14539
- swarm$1.loggerService.log(METHOD_NAME$t, {
14539
+ swarm$1.loggerService.log(METHOD_NAME$u, {
14540
14540
  content,
14541
14541
  clientId,
14542
14542
  });
14543
14543
  // Validate the session and swarm
14544
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$t);
14544
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$u);
14545
14545
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14546
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$t);
14546
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$u);
14547
14547
  // Emit the content directly via the session public service
14548
- return await swarm$1.sessionPublicService.emit(content, METHOD_NAME$t, clientId, swarmName);
14548
+ return await swarm$1.sessionPublicService.emit(content, METHOD_NAME$u, clientId, swarmName);
14549
14549
  });
14550
14550
 
14551
- const METHOD_NAME$s = "function.target.executeForce";
14551
+ const METHOD_NAME$t = "function.target.executeForce";
14552
14552
  /**
14553
14553
  * Sends a message to the active agent in a swarm session as if it originated from the client side, forcing execution regardless of agent activity.
14554
14554
  *
@@ -14569,22 +14569,22 @@ const executeForce = beginContext(async (content, clientId) => {
14569
14569
  const executionId = functoolsKit.randomString();
14570
14570
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14571
14571
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14572
- swarm$1.loggerService.log(METHOD_NAME$s, {
14572
+ swarm$1.loggerService.log(METHOD_NAME$t, {
14573
14573
  content,
14574
14574
  clientId,
14575
14575
  executionId,
14576
14576
  });
14577
14577
  // Validate the session and swarm
14578
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$s);
14578
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$t);
14579
14579
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14580
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$s);
14580
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$t);
14581
14581
  // Execute the command within an execution context with performance tracking
14582
14582
  return ExecutionContextService.runInContext(async () => {
14583
14583
  let isFinished = false;
14584
14584
  swarm$1.perfService.startExecution(executionId, clientId, content.length);
14585
14585
  try {
14586
14586
  swarm$1.busService.commitExecutionBegin(clientId, { swarmName });
14587
- const result = await swarm$1.sessionPublicService.execute(content, "tool", METHOD_NAME$s, clientId, swarmName);
14587
+ const result = await swarm$1.sessionPublicService.execute(content, "tool", METHOD_NAME$t, clientId, swarmName);
14588
14588
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
14589
14589
  swarm$1.busService.commitExecutionEnd(clientId, { swarmName });
14590
14590
  return result;
@@ -14601,7 +14601,7 @@ const executeForce = beginContext(async (content, clientId) => {
14601
14601
  });
14602
14602
  });
14603
14603
 
14604
- const METHOD_NAME$r = "function.target.disposeConnection";
14604
+ const METHOD_NAME$s = "function.target.disposeConnection";
14605
14605
  /**
14606
14606
  * Disposes of a client session and all related resources within a swarm.
14607
14607
  *
@@ -14618,10 +14618,10 @@ const METHOD_NAME$r = "function.target.disposeConnection";
14618
14618
  * @example
14619
14619
  * await disposeConnection("client-123", "TaskSwarm");
14620
14620
  */
14621
- const disposeConnection = beginContext(async (clientId, swarmName, methodName = METHOD_NAME$r) => {
14621
+ const disposeConnection = beginContext(async (clientId, swarmName, methodName = METHOD_NAME$s) => {
14622
14622
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14623
14623
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14624
- swarm$1.loggerService.log(METHOD_NAME$r, {
14624
+ swarm$1.loggerService.log(METHOD_NAME$s, {
14625
14625
  clientId,
14626
14626
  swarmName,
14627
14627
  });
@@ -14693,7 +14693,7 @@ const disposeConnection = beginContext(async (clientId, swarmName, methodName =
14693
14693
  PersistMemoryAdapter.dispose(clientId);
14694
14694
  });
14695
14695
 
14696
- const METHOD_NAME$q = "function.target.makeAutoDispose";
14696
+ const METHOD_NAME$r = "function.target.makeAutoDispose";
14697
14697
  /**
14698
14698
  * Default timeout in seconds before auto-dispose is triggered.
14699
14699
  * @constant {number}
@@ -14724,7 +14724,7 @@ const DEFAULT_TIMEOUT = 15 * 60;
14724
14724
  const makeAutoDispose = beginContext((clientId, swarmName, { timeoutSeconds = DEFAULT_TIMEOUT, onDestroy, } = {}) => {
14725
14725
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14726
14726
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14727
- swarm$1.loggerService.log(METHOD_NAME$q, {
14727
+ swarm$1.loggerService.log(METHOD_NAME$r, {
14728
14728
  clientId,
14729
14729
  swarmName,
14730
14730
  });
@@ -14757,7 +14757,7 @@ const makeAutoDispose = beginContext((clientId, swarmName, { timeoutSeconds = DE
14757
14757
  };
14758
14758
  });
14759
14759
 
14760
- const METHOD_NAME$p = "function.target.execute";
14760
+ const METHOD_NAME$q = "function.target.execute";
14761
14761
  /**
14762
14762
  * Sends a message to the active agent in a swarm session as if it originated from the client side.
14763
14763
  *
@@ -14779,19 +14779,19 @@ const execute = beginContext(async (content, clientId, agentName) => {
14779
14779
  const executionId = functoolsKit.randomString();
14780
14780
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14781
14781
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14782
- swarm$1.loggerService.log(METHOD_NAME$p, {
14782
+ swarm$1.loggerService.log(METHOD_NAME$q, {
14783
14783
  content,
14784
14784
  clientId,
14785
14785
  agentName,
14786
14786
  executionId,
14787
14787
  });
14788
14788
  // Validate the agent, session, and swarm
14789
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$p);
14790
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$p);
14789
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$q);
14790
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$q);
14791
14791
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14792
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$p);
14792
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$q);
14793
14793
  // Check if the specified agent is still the active agent
14794
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$p, clientId, swarmName);
14794
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$q, clientId, swarmName);
14795
14795
  if (currentAgentName !== agentName) {
14796
14796
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14797
14797
  swarm$1.loggerService.log('function "execute" skipped due to the agent change', {
@@ -14810,7 +14810,7 @@ const execute = beginContext(async (content, clientId, agentName) => {
14810
14810
  agentName,
14811
14811
  swarmName,
14812
14812
  });
14813
- const result = await swarm$1.sessionPublicService.execute(content, "tool", METHOD_NAME$p, clientId, swarmName);
14813
+ const result = await swarm$1.sessionPublicService.execute(content, "tool", METHOD_NAME$q, clientId, swarmName);
14814
14814
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
14815
14815
  swarm$1.busService.commitExecutionEnd(clientId, {
14816
14816
  agentName,
@@ -14830,7 +14830,7 @@ const execute = beginContext(async (content, clientId, agentName) => {
14830
14830
  });
14831
14831
  });
14832
14832
 
14833
- const METHOD_NAME$o = "function.target.emit";
14833
+ const METHOD_NAME$p = "function.target.emit";
14834
14834
  /**
14835
14835
  * Emits a string as model output without executing an incoming message, with agent activity validation.
14836
14836
  *
@@ -14850,18 +14850,18 @@ const METHOD_NAME$o = "function.target.emit";
14850
14850
  const emit = beginContext(async (content, clientId, agentName) => {
14851
14851
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14852
14852
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14853
- swarm$1.loggerService.log(METHOD_NAME$o, {
14853
+ swarm$1.loggerService.log(METHOD_NAME$p, {
14854
14854
  content,
14855
14855
  clientId,
14856
14856
  agentName,
14857
14857
  });
14858
14858
  // Validate the agent, session, and swarm
14859
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$o);
14860
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$o);
14859
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$p);
14860
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$p);
14861
14861
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14862
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$o);
14862
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$p);
14863
14863
  // Check if the specified agent is still the active agent
14864
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$o, clientId, swarmName);
14864
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$p, clientId, swarmName);
14865
14865
  if (currentAgentName !== agentName) {
14866
14866
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14867
14867
  swarm$1.loggerService.log('function "emit" skipped due to the agent change', {
@@ -14872,10 +14872,10 @@ const emit = beginContext(async (content, clientId, agentName) => {
14872
14872
  return;
14873
14873
  }
14874
14874
  // Emit the content directly via the session public service
14875
- return await swarm$1.sessionPublicService.emit(content, METHOD_NAME$o, clientId, swarmName);
14875
+ return await swarm$1.sessionPublicService.emit(content, METHOD_NAME$p, clientId, swarmName);
14876
14876
  });
14877
14877
 
14878
- const METHOD_NAME$n = "function.target.notify";
14878
+ const METHOD_NAME$o = "function.target.notify";
14879
14879
  /**
14880
14880
  * Sends a notification message as output from the swarm session without executing an incoming message.
14881
14881
  *
@@ -14895,23 +14895,23 @@ const METHOD_NAME$n = "function.target.notify";
14895
14895
  const notify = beginContext(async (content, clientId, agentName) => {
14896
14896
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14897
14897
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14898
- swarm$1.loggerService.log(METHOD_NAME$n, {
14898
+ swarm$1.loggerService.log(METHOD_NAME$o, {
14899
14899
  content,
14900
14900
  clientId,
14901
14901
  agentName,
14902
14902
  });
14903
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$n);
14903
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$o);
14904
14904
  // Check if the session mode is "makeConnection"
14905
14905
  if (swarm$1.sessionValidationService.getSessionMode(clientId) !==
14906
14906
  "makeConnection") {
14907
14907
  throw new Error(`agent-swarm-kit notify session is not makeConnection clientId=${clientId}`);
14908
14908
  }
14909
14909
  // Validate the agent, session, and swarm
14910
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$n);
14910
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$o);
14911
14911
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14912
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$n);
14912
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$o);
14913
14913
  // Check if the specified agent is still the active agent
14914
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$n, clientId, swarmName);
14914
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$o, clientId, swarmName);
14915
14915
  if (currentAgentName !== agentName) {
14916
14916
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14917
14917
  swarm$1.loggerService.log('function "notify" skipped due to the agent change', {
@@ -14922,10 +14922,10 @@ const notify = beginContext(async (content, clientId, agentName) => {
14922
14922
  return;
14923
14923
  }
14924
14924
  // Notify the content directly via the session public service
14925
- return await swarm$1.sessionPublicService.notify(content, METHOD_NAME$n, clientId, swarmName);
14925
+ return await swarm$1.sessionPublicService.notify(content, METHOD_NAME$o, clientId, swarmName);
14926
14926
  });
14927
14927
 
14928
- const METHOD_NAME$m = "function.target.notifyForce";
14928
+ const METHOD_NAME$n = "function.target.notifyForce";
14929
14929
  /**
14930
14930
  * Sends a notification message as output from the swarm session without executing an incoming message.
14931
14931
  *
@@ -14945,28 +14945,28 @@ const METHOD_NAME$m = "function.target.notifyForce";
14945
14945
  const notifyForce = beginContext(async (content, clientId, agentName) => {
14946
14946
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14947
14947
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14948
- swarm$1.loggerService.log(METHOD_NAME$m, {
14948
+ swarm$1.loggerService.log(METHOD_NAME$n, {
14949
14949
  content,
14950
14950
  clientId,
14951
14951
  agentName,
14952
14952
  });
14953
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$m);
14953
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$n);
14954
14954
  // Check if the session mode is "makeConnection"
14955
14955
  if (swarm$1.sessionValidationService.getSessionMode(clientId) !==
14956
14956
  "makeConnection") {
14957
14957
  throw new Error(`agent-swarm-kit notifyForce session is not makeConnection clientId=${clientId}`);
14958
14958
  }
14959
14959
  // Validate the agent, session, and swarm
14960
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$m);
14960
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$n);
14961
14961
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
14962
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$m);
14962
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$n);
14963
14963
  // Check if the specified agent is still the active agent
14964
- await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$m, clientId, swarmName);
14964
+ await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$n, clientId, swarmName);
14965
14965
  // Notify the content directly via the session public service
14966
- return await swarm$1.sessionPublicService.notify(content, METHOD_NAME$m, clientId, swarmName);
14966
+ return await swarm$1.sessionPublicService.notify(content, METHOD_NAME$n, clientId, swarmName);
14967
14967
  });
14968
14968
 
14969
- const METHOD_NAME$l = "function.target.runStateless";
14969
+ const METHOD_NAME$m = "function.target.runStateless";
14970
14970
  /**
14971
14971
  * Executes a message statelessly with an agent in a swarm session, bypassing chat history.
14972
14972
  *
@@ -14989,19 +14989,19 @@ const runStateless = beginContext(async (content, clientId, agentName) => {
14989
14989
  const executionId = functoolsKit.randomString();
14990
14990
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
14991
14991
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
14992
- swarm$1.loggerService.log(METHOD_NAME$l, {
14992
+ swarm$1.loggerService.log(METHOD_NAME$m, {
14993
14993
  content,
14994
14994
  clientId,
14995
14995
  agentName,
14996
14996
  executionId,
14997
14997
  });
14998
14998
  // Validate the agent, session, and swarm
14999
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$l);
15000
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$l);
14999
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$m);
15000
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$m);
15001
15001
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
15002
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$l);
15002
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$m);
15003
15003
  // Check if the specified agent is still the active agent
15004
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$l, clientId, swarmName);
15004
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$m, clientId, swarmName);
15005
15005
  if (currentAgentName !== agentName) {
15006
15006
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15007
15007
  swarm$1.loggerService.log('function "runStateless" skipped due to the agent change', {
@@ -15020,7 +15020,7 @@ const runStateless = beginContext(async (content, clientId, agentName) => {
15020
15020
  agentName,
15021
15021
  swarmName,
15022
15022
  });
15023
- const result = await swarm$1.sessionPublicService.run(content, METHOD_NAME$l, clientId, swarmName);
15023
+ const result = await swarm$1.sessionPublicService.run(content, METHOD_NAME$m, clientId, swarmName);
15024
15024
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
15025
15025
  swarm$1.busService.commitExecutionEnd(clientId, {
15026
15026
  agentName,
@@ -15040,7 +15040,7 @@ const runStateless = beginContext(async (content, clientId, agentName) => {
15040
15040
  });
15041
15041
  });
15042
15042
 
15043
- const METHOD_NAME$k = "function.target.runStatelessForce";
15043
+ const METHOD_NAME$l = "function.target.runStatelessForce";
15044
15044
  /**
15045
15045
  * Executes a message statelessly with the active agent in a swarm session, bypassing chat history and forcing execution regardless of agent activity.
15046
15046
  *
@@ -15061,22 +15061,22 @@ const runStatelessForce = beginContext(async (content, clientId) => {
15061
15061
  const executionId = functoolsKit.randomString();
15062
15062
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
15063
15063
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15064
- swarm$1.loggerService.log(METHOD_NAME$k, {
15064
+ swarm$1.loggerService.log(METHOD_NAME$l, {
15065
15065
  content,
15066
15066
  clientId,
15067
15067
  executionId,
15068
15068
  });
15069
15069
  // Validate the session and swarm
15070
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$k);
15070
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$l);
15071
15071
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
15072
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$k);
15072
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$l);
15073
15073
  // Execute the command statelessly within an execution context with performance tracking
15074
15074
  return ExecutionContextService.runInContext(async () => {
15075
15075
  let isFinished = false;
15076
15076
  swarm$1.perfService.startExecution(executionId, clientId, content.length);
15077
15077
  try {
15078
15078
  swarm$1.busService.commitExecutionBegin(clientId, { swarmName });
15079
- const result = await swarm$1.sessionPublicService.run(content, METHOD_NAME$k, clientId, swarmName);
15079
+ const result = await swarm$1.sessionPublicService.run(content, METHOD_NAME$l, clientId, swarmName);
15080
15080
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
15081
15081
  swarm$1.busService.commitExecutionEnd(clientId, { swarmName });
15082
15082
  return result;
@@ -15103,7 +15103,7 @@ const SCHEDULED_DELAY$1 = 1000;
15103
15103
  * @constant {number}
15104
15104
  */
15105
15105
  const RATE_DELAY = 10000;
15106
- const METHOD_NAME$j = "function.target.makeConnection";
15106
+ const METHOD_NAME$k = "function.target.makeConnection";
15107
15107
  /**
15108
15108
  * Internal implementation of the connection factory for a client to a swarm.
15109
15109
  *
@@ -15118,21 +15118,21 @@ const METHOD_NAME$j = "function.target.makeConnection";
15118
15118
  const makeConnectionInternal = (connector, clientId, swarmName) => {
15119
15119
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
15120
15120
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15121
- swarm$1.loggerService.log(METHOD_NAME$j, {
15121
+ swarm$1.loggerService.log(METHOD_NAME$k, {
15122
15122
  clientId,
15123
15123
  swarmName,
15124
15124
  });
15125
15125
  // Validate the swarm and initialize the session
15126
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$j);
15126
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$k);
15127
15127
  swarm$1.sessionValidationService.addSession(clientId, swarmName, "makeConnection");
15128
15128
  // Create a queued send function using the session public service
15129
- const send = functoolsKit.queued(swarm$1.sessionPublicService.connect(connector, METHOD_NAME$j, clientId, swarmName));
15129
+ const send = functoolsKit.queued(swarm$1.sessionPublicService.connect(connector, METHOD_NAME$k, clientId, swarmName));
15130
15130
  // Return a wrapped send function with validation and agent context
15131
15131
  return (async (outgoing) => {
15132
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$j);
15132
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$k);
15133
15133
  return await send({
15134
15134
  data: outgoing,
15135
- agentName: await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$j, clientId, swarmName),
15135
+ agentName: await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$k, clientId, swarmName),
15136
15136
  clientId,
15137
15137
  });
15138
15138
  });
@@ -15215,13 +15215,13 @@ makeConnection.scheduled = (connector, clientId, swarmName, { delay = SCHEDULED_
15215
15215
  await online();
15216
15216
  if (payload) {
15217
15217
  return await PayloadContextService.runInContext(async () => {
15218
- await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$j, clientId, swarmName);
15218
+ await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$k, clientId, swarmName);
15219
15219
  }, {
15220
15220
  clientId,
15221
15221
  payload,
15222
15222
  });
15223
15223
  }
15224
- await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$j, clientId, swarmName);
15224
+ await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$k, clientId, swarmName);
15225
15225
  }),
15226
15226
  delay,
15227
15227
  });
@@ -15284,7 +15284,7 @@ makeConnection.rate = (connector, clientId, swarmName, { delay = RATE_DELAY } =
15284
15284
  };
15285
15285
  };
15286
15286
 
15287
- const METHOD_NAME$i = "function.target.complete";
15287
+ const METHOD_NAME$j = "function.target.complete";
15288
15288
  /**
15289
15289
  * Time-to-live for the complete function in milliseconds.
15290
15290
  * Defines how long the cached complete function remains valid before expiring.
@@ -15350,7 +15350,7 @@ const complete = beginContext(async (content, clientId, swarmName, payload = nul
15350
15350
  const executionId = functoolsKit.randomString();
15351
15351
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
15352
15352
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15353
- swarm$1.loggerService.log(METHOD_NAME$i, {
15353
+ swarm$1.loggerService.log(METHOD_NAME$j, {
15354
15354
  content,
15355
15355
  clientId,
15356
15356
  executionId,
@@ -15368,7 +15368,7 @@ const complete = beginContext(async (content, clientId, swarmName, payload = nul
15368
15368
  swarm$1.navigationValidationService.beginMonit(clientId, swarmName);
15369
15369
  try {
15370
15370
  swarm$1.busService.commitExecutionBegin(clientId, { swarmName });
15371
- const result = await run(METHOD_NAME$i, content);
15371
+ const result = await run(METHOD_NAME$j, content);
15372
15372
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
15373
15373
  swarm$1.busService.commitExecutionEnd(clientId, { swarmName });
15374
15374
  return result;
@@ -15398,7 +15398,7 @@ const complete = beginContext(async (content, clientId, swarmName, payload = nul
15398
15398
  * @constant {number}
15399
15399
  */
15400
15400
  const SCHEDULED_DELAY = 1000;
15401
- const METHOD_NAME$h = "function.target.session";
15401
+ const METHOD_NAME$i = "function.target.session";
15402
15402
  /**
15403
15403
  * Internal implementation of the session factory for a client and swarm.
15404
15404
  *
@@ -15413,23 +15413,23 @@ const sessionInternal = (clientId, swarmName, { onDispose = () => { } } = {}) =>
15413
15413
  const executionId = functoolsKit.randomString();
15414
15414
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
15415
15415
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15416
- swarm$1.loggerService.log(METHOD_NAME$h, {
15416
+ swarm$1.loggerService.log(METHOD_NAME$i, {
15417
15417
  clientId,
15418
15418
  swarmName,
15419
15419
  executionId,
15420
15420
  });
15421
15421
  // Validate the swarm and initialize the session
15422
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$h);
15422
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$i);
15423
15423
  swarm$1.sessionValidationService.addSession(clientId, swarmName, "session");
15424
15424
  const complete = functoolsKit.queued(async (content) => {
15425
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$h);
15425
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$i);
15426
15426
  return ExecutionContextService.runInContext(async () => {
15427
15427
  let isFinished = false;
15428
15428
  swarm$1.perfService.startExecution(executionId, clientId, content.length);
15429
15429
  swarm$1.navigationValidationService.beginMonit(clientId, swarmName);
15430
15430
  try {
15431
15431
  swarm$1.busService.commitExecutionBegin(clientId, { swarmName });
15432
- const result = await swarm$1.sessionPublicService.execute(content, "user", METHOD_NAME$h, clientId, swarmName);
15432
+ const result = await swarm$1.sessionPublicService.execute(content, "user", METHOD_NAME$i, clientId, swarmName);
15433
15433
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
15434
15434
  swarm$1.busService.commitExecutionEnd(clientId, { swarmName });
15435
15435
  return result;
@@ -15450,7 +15450,7 @@ const sessionInternal = (clientId, swarmName, { onDispose = () => { } } = {}) =>
15450
15450
  return await complete(content);
15451
15451
  }),
15452
15452
  dispose: async () => {
15453
- await disposeConnection(clientId, swarmName, METHOD_NAME$h);
15453
+ await disposeConnection(clientId, swarmName, METHOD_NAME$i);
15454
15454
  await onDispose();
15455
15455
  },
15456
15456
  };
@@ -15550,13 +15550,13 @@ session.scheduled = (clientId, swarmName, { delay = SCHEDULED_DELAY, onDispose }
15550
15550
  await online();
15551
15551
  if (payload) {
15552
15552
  return await PayloadContextService.runInContext(async () => {
15553
- return await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$h, clientId, swarmName);
15553
+ return await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$i, clientId, swarmName);
15554
15554
  }, {
15555
15555
  clientId,
15556
15556
  payload,
15557
15557
  });
15558
15558
  }
15559
- return await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$h, clientId, swarmName);
15559
+ return await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$i, clientId, swarmName);
15560
15560
  }),
15561
15561
  delay,
15562
15562
  });
@@ -15636,7 +15636,7 @@ session.rate = (clientId, swarmName, { delay = SCHEDULED_DELAY, onDispose } = {}
15636
15636
  };
15637
15637
 
15638
15638
  /** @private Constant defining the method name for logging purposes */
15639
- const METHOD_NAME$g = "function.common.hasSession";
15639
+ const METHOD_NAME$h = "function.common.hasSession";
15640
15640
  /**
15641
15641
  * Checks if a session exists for the given client ID.
15642
15642
  *
@@ -15647,11 +15647,12 @@ const METHOD_NAME$g = "function.common.hasSession";
15647
15647
  * @returns {boolean} `true` if the session exists, otherwise `false`.
15648
15648
  */
15649
15649
  const hasSession = (clientId) => {
15650
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$g);
15650
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15651
+ swarm$1.loggerService.log(METHOD_NAME$h, { clientId });
15651
15652
  return swarm$1.sessionValidationService.hasSession(clientId);
15652
15653
  };
15653
15654
 
15654
- const METHOD_NAME$f = "function.common.getAgentName";
15655
+ const METHOD_NAME$g = "function.common.getAgentName";
15655
15656
  /**
15656
15657
  * Retrieves the name of the active agent for a given client session in a swarm.
15657
15658
  *
@@ -15669,18 +15670,18 @@ const METHOD_NAME$f = "function.common.getAgentName";
15669
15670
  const getAgentName = beginContext(async (clientId) => {
15670
15671
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
15671
15672
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15672
- swarm$1.loggerService.log(METHOD_NAME$f, {
15673
+ swarm$1.loggerService.log(METHOD_NAME$g, {
15673
15674
  clientId,
15674
15675
  });
15675
15676
  // Validate the session and swarm to ensure they exist and are accessible
15676
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$f);
15677
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$g);
15677
15678
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
15678
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$f);
15679
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$g);
15679
15680
  // Retrieve the active agent name via the swarm public service
15680
- return await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$f, clientId, swarmName);
15681
+ return await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$g, clientId, swarmName);
15681
15682
  });
15682
15683
 
15683
- const METHOD_NAME$e = "function.common.getAgentHistory";
15684
+ const METHOD_NAME$f = "function.common.getAgentHistory";
15684
15685
  /**
15685
15686
  * Retrieves the history prepared for a specific agent, incorporating rescue algorithm tweaks.
15686
15687
  *
@@ -15699,22 +15700,22 @@ const METHOD_NAME$e = "function.common.getAgentHistory";
15699
15700
  const getAgentHistory = beginContext(async (clientId, agentName) => {
15700
15701
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
15701
15702
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15702
- swarm$1.loggerService.log(METHOD_NAME$e, {
15703
+ swarm$1.loggerService.log(METHOD_NAME$f, {
15703
15704
  clientId,
15704
15705
  agentName,
15705
15706
  });
15706
15707
  // Validate the session and agent to ensure they exist and are accessible
15707
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$e);
15708
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$e);
15708
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$f);
15709
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$f);
15709
15710
  // Retrieve the agent's prompt configuration from the agent schema service
15710
15711
  const { prompt } = swarm$1.agentSchemaService.get(agentName);
15711
15712
  // Fetch the agent's history using the prompt and rescue tweaks via the history public service
15712
- const history = await swarm$1.historyPublicService.toArrayForAgent(prompt, METHOD_NAME$e, clientId, agentName);
15713
+ const history = await swarm$1.historyPublicService.toArrayForAgent(prompt, METHOD_NAME$f, clientId, agentName);
15713
15714
  // Return a shallow copy of the history array
15714
15715
  return [...history];
15715
15716
  });
15716
15717
 
15717
- const METHOD_NAME$d = "function.common.getSessionMode";
15718
+ const METHOD_NAME$e = "function.common.getSessionMode";
15718
15719
  /**
15719
15720
  * Retrieves the session mode for a given client session in a swarm.
15720
15721
  *
@@ -15732,18 +15733,18 @@ const METHOD_NAME$d = "function.common.getSessionMode";
15732
15733
  const getSessionMode = beginContext(async (clientId) => {
15733
15734
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
15734
15735
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15735
- swarm$1.loggerService.log(METHOD_NAME$d, {
15736
+ swarm$1.loggerService.log(METHOD_NAME$e, {
15736
15737
  clientId,
15737
15738
  });
15738
15739
  // Validate the session and swarm to ensure they exist and are accessible
15739
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$d);
15740
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$e);
15740
15741
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
15741
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$d);
15742
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$e);
15742
15743
  // Retrieve the session mode from the session validation service
15743
15744
  return swarm$1.sessionValidationService.getSessionMode(clientId);
15744
15745
  });
15745
15746
 
15746
- const METHOD_NAME$c = "function.common.getSessionContext";
15747
+ const METHOD_NAME$d = "function.common.getSessionContext";
15747
15748
  /**
15748
15749
  * Retrieves the session context for the current execution environment.
15749
15750
  *
@@ -15760,7 +15761,7 @@ const METHOD_NAME$c = "function.common.getSessionContext";
15760
15761
  const getSessionContext = async () => {
15761
15762
  // Log the operation if logging is enabled in GLOBAL_CONFIG
15762
15763
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15763
- swarm$1.loggerService.log(METHOD_NAME$c);
15764
+ swarm$1.loggerService.log(METHOD_NAME$d);
15764
15765
  // Determine the method context, if active
15765
15766
  const methodContext = MethodContextService.hasContext()
15766
15767
  ? swarm$1.methodContextService.context
@@ -15780,6 +15781,29 @@ const getSessionContext = async () => {
15780
15781
  };
15781
15782
  };
15782
15783
 
15784
+ /**
15785
+ * @private Constant defining the method name for logging purposes.
15786
+ * Used as an identifier in log messages to track calls to `getNavigationRoute`.
15787
+ */
15788
+ const METHOD_NAME$c = "function.common.getNavigationRoute";
15789
+ /**
15790
+ * Retrieves the navigation route for a given client and swarm.
15791
+ * Delegates to `NavigationValidationService.getNavigationRoute` to obtain a `Set` of visited agent names,
15792
+ * with optional logging based on global configuration.
15793
+ * @param {string} clientId - The unique identifier of the client requesting the navigation route.
15794
+ * @param {SwarmName} swarmName - The name of the swarm context for which the route is retrieved.
15795
+ * @returns {Set<string>} A set of `AgentName`s representing the visited agents in the navigation route.
15796
+ */
15797
+ const getNavigationRoute = (clientId, swarmName) => {
15798
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
15799
+ swarm$1.loggerService.log(METHOD_NAME$c, {
15800
+ clientId,
15801
+ swarmName,
15802
+ });
15803
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$c);
15804
+ return swarm$1.navigationValidationService.getNavigationRoute(clientId, swarmName);
15805
+ };
15806
+
15783
15807
  const METHOD_NAME$b = "function.history.getRawHistory";
15784
15808
  /**
15785
15809
  * Retrieves the raw, unmodified history for a given client session.
@@ -18479,6 +18503,7 @@ exports.getAssistantHistory = getAssistantHistory;
18479
18503
  exports.getLastAssistantMessage = getLastAssistantMessage;
18480
18504
  exports.getLastSystemMessage = getLastSystemMessage;
18481
18505
  exports.getLastUserMessage = getLastUserMessage;
18506
+ exports.getNavigationRoute = getNavigationRoute;
18482
18507
  exports.getPayload = getPayload;
18483
18508
  exports.getRawHistory = getRawHistory;
18484
18509
  exports.getSessionContext = getSessionContext;