agent-swarm-kit 1.1.127 → 1.1.129

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
@@ -4950,26 +4950,26 @@ class ClientOperator {
4950
4950
  }
4951
4951
  }
4952
4952
 
4953
- const METHOD_NAME$1E = "function.commit.commitToolOutput";
4953
+ const METHOD_NAME$1F = "function.commit.commitToolOutput";
4954
4954
  /**
4955
4955
  * Function implementation
4956
4956
  */
4957
4957
  const commitToolOutputInternal = beginContext(async (toolId, content, clientId, agentName) => {
4958
4958
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
4959
4959
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
4960
- swarm$1.loggerService.log(METHOD_NAME$1E, {
4960
+ swarm$1.loggerService.log(METHOD_NAME$1F, {
4961
4961
  toolId,
4962
4962
  content,
4963
4963
  clientId,
4964
4964
  agentName,
4965
4965
  });
4966
4966
  // Validate the agent, session, and swarm to ensure they exist and are accessible
4967
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1E);
4968
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1E);
4967
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1F);
4968
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1F);
4969
4969
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
4970
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1E);
4970
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1F);
4971
4971
  // Check if the specified agent is still the active agent in the swarm session
4972
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1E, clientId, swarmName);
4972
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1F, clientId, swarmName);
4973
4973
  if (currentAgentName !== agentName) {
4974
4974
  // Log a skip message if the agent has changed during the operation
4975
4975
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
@@ -4982,7 +4982,7 @@ const commitToolOutputInternal = beginContext(async (toolId, content, clientId,
4982
4982
  return;
4983
4983
  }
4984
4984
  // Commit the tool output to the session via the session public service
4985
- await swarm$1.sessionPublicService.commitToolOutput(toolId, content, METHOD_NAME$1E, clientId, swarmName);
4985
+ await swarm$1.sessionPublicService.commitToolOutput(toolId, content, METHOD_NAME$1F, clientId, swarmName);
4986
4986
  });
4987
4987
  /**
4988
4988
  * Commits the output of a tool execution to the active agent in a swarm session.
@@ -5004,7 +5004,7 @@ async function commitToolOutput(toolId, content, clientId, agentName) {
5004
5004
  return await commitToolOutputInternal(toolId, content, clientId, agentName);
5005
5005
  }
5006
5006
 
5007
- const METHOD_NAME$1D = "function.target.execute";
5007
+ const METHOD_NAME$1E = "function.target.execute";
5008
5008
  /**
5009
5009
  * Function implementation
5010
5010
  */
@@ -5012,19 +5012,19 @@ const executeInternal = beginContext(async (content, clientId, agentName) => {
5012
5012
  const executionId = functoolsKit.randomString();
5013
5013
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
5014
5014
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
5015
- swarm$1.loggerService.log(METHOD_NAME$1D, {
5015
+ swarm$1.loggerService.log(METHOD_NAME$1E, {
5016
5016
  content,
5017
5017
  clientId,
5018
5018
  agentName,
5019
5019
  executionId,
5020
5020
  });
5021
5021
  // Validate the agent, session, and swarm
5022
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1D);
5023
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1D);
5022
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1E);
5023
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1E);
5024
5024
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
5025
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1D);
5025
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1E);
5026
5026
  // Check if the specified agent is still the active agent
5027
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1D, clientId, swarmName);
5027
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1E, clientId, swarmName);
5028
5028
  if (currentAgentName !== agentName) {
5029
5029
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
5030
5030
  swarm$1.loggerService.log('function "execute" skipped due to the agent change', {
@@ -5043,7 +5043,7 @@ const executeInternal = beginContext(async (content, clientId, agentName) => {
5043
5043
  agentName,
5044
5044
  swarmName,
5045
5045
  });
5046
- const result = await swarm$1.sessionPublicService.execute(content, "tool", METHOD_NAME$1D, clientId, swarmName);
5046
+ const result = await swarm$1.sessionPublicService.execute(content, "tool", METHOD_NAME$1E, clientId, swarmName);
5047
5047
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
5048
5048
  swarm$1.busService.commitExecutionEnd(clientId, {
5049
5049
  agentName,
@@ -5085,26 +5085,26 @@ async function execute(content, clientId, agentName) {
5085
5085
  }
5086
5086
 
5087
5087
  /** @private Constant defining the method name for logging and validation context */
5088
- const METHOD_NAME$1C = "function.commit.commitFlush";
5088
+ const METHOD_NAME$1D = "function.commit.commitFlush";
5089
5089
  /**
5090
5090
  * Function implementation
5091
5091
  */
5092
5092
  const commitFlushInternal = beginContext(async (clientId, agentName) => {
5093
5093
  // Log the flush attempt if enabled
5094
5094
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
5095
- swarm$1.loggerService.log(METHOD_NAME$1C, {
5095
+ swarm$1.loggerService.log(METHOD_NAME$1D, {
5096
5096
  clientId,
5097
5097
  agentName,
5098
5098
  });
5099
5099
  // Validate the agent exists
5100
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1C);
5100
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1D);
5101
5101
  // Validate the session exists and retrieve the associated swarm
5102
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1C);
5102
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1D);
5103
5103
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
5104
5104
  // Validate the swarm configuration
5105
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1C);
5105
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1D);
5106
5106
  // Check if the current agent matches the provided agent
5107
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1C, clientId, swarmName);
5107
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1D, clientId, swarmName);
5108
5108
  if (currentAgentName !== agentName) {
5109
5109
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
5110
5110
  swarm$1.loggerService.log('function "commitFlush" skipped due to the agent change', {
@@ -5115,7 +5115,7 @@ const commitFlushInternal = beginContext(async (clientId, agentName) => {
5115
5115
  return;
5116
5116
  }
5117
5117
  // Commit the flush of agent history via SessionPublicService
5118
- await swarm$1.sessionPublicService.commitFlush(METHOD_NAME$1C, clientId, swarmName);
5118
+ await swarm$1.sessionPublicService.commitFlush(METHOD_NAME$1D, clientId, swarmName);
5119
5119
  });
5120
5120
  /**
5121
5121
  * Commits a flush of agent history for a specific client and agent in the swarm system.
@@ -5134,25 +5134,25 @@ async function commitFlush(clientId, agentName) {
5134
5134
  return await commitFlushInternal(clientId, agentName);
5135
5135
  }
5136
5136
 
5137
- const METHOD_NAME$1B = "function.target.emit";
5137
+ const METHOD_NAME$1C = "function.target.emit";
5138
5138
  /**
5139
5139
  * Function implementation
5140
5140
  */
5141
5141
  const emitInternal = beginContext(async (content, clientId, agentName) => {
5142
5142
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
5143
5143
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
5144
- swarm$1.loggerService.log(METHOD_NAME$1B, {
5144
+ swarm$1.loggerService.log(METHOD_NAME$1C, {
5145
5145
  content,
5146
5146
  clientId,
5147
5147
  agentName,
5148
5148
  });
5149
5149
  // Validate the agent, session, and swarm
5150
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1B);
5151
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1B);
5150
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1C);
5151
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1C);
5152
5152
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
5153
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1B);
5153
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1C);
5154
5154
  // Check if the specified agent is still the active agent
5155
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1B, clientId, swarmName);
5155
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1C, clientId, swarmName);
5156
5156
  if (currentAgentName !== agentName) {
5157
5157
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
5158
5158
  swarm$1.loggerService.log('function "emit" skipped due to the agent change', {
@@ -5163,7 +5163,7 @@ const emitInternal = beginContext(async (content, clientId, agentName) => {
5163
5163
  return;
5164
5164
  }
5165
5165
  // Emit the content directly via the session public service
5166
- return await swarm$1.sessionPublicService.emit(content, METHOD_NAME$1B, clientId, swarmName);
5166
+ return await swarm$1.sessionPublicService.emit(content, METHOD_NAME$1C, clientId, swarmName);
5167
5167
  });
5168
5168
  /**
5169
5169
  * Emits a string as model output without executing an incoming message, with agent activity validation.
@@ -5185,22 +5185,22 @@ async function emit(content, clientId, agentName) {
5185
5185
  return await emitInternal(content, clientId, agentName);
5186
5186
  }
5187
5187
 
5188
- const METHOD_NAME$1A = "function.common.getAgentName";
5188
+ const METHOD_NAME$1B = "function.common.getAgentName";
5189
5189
  /**
5190
5190
  * Function implementation
5191
5191
  */
5192
5192
  const getAgentNameInternal = beginContext(async (clientId) => {
5193
5193
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
5194
5194
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
5195
- swarm$1.loggerService.log(METHOD_NAME$1A, {
5195
+ swarm$1.loggerService.log(METHOD_NAME$1B, {
5196
5196
  clientId,
5197
5197
  });
5198
5198
  // Validate the session and swarm to ensure they exist and are accessible
5199
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1A);
5199
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1B);
5200
5200
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
5201
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1A);
5201
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1B);
5202
5202
  // Retrieve the active agent name via the swarm public service
5203
- return await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1A, clientId, swarmName);
5203
+ return await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1B, clientId, swarmName);
5204
5204
  });
5205
5205
  /**
5206
5206
  * Retrieves the name of the active agent for a given client session in a swarm.
@@ -5221,26 +5221,26 @@ async function getAgentName(clientId) {
5221
5221
  }
5222
5222
 
5223
5223
  /** @private Constant defining the method name for logging and validation context */
5224
- const METHOD_NAME$1z = "function.commit.commitStopTools";
5224
+ const METHOD_NAME$1A = "function.commit.commitStopTools";
5225
5225
  /**
5226
5226
  * Function implementation
5227
5227
  */
5228
5228
  const commitStopToolsInternal = beginContext(async (clientId, agentName) => {
5229
5229
  // Log the stop tools attempt if enabled
5230
5230
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
5231
- swarm$1.loggerService.log(METHOD_NAME$1z, {
5231
+ swarm$1.loggerService.log(METHOD_NAME$1A, {
5232
5232
  clientId,
5233
5233
  agentName,
5234
5234
  });
5235
5235
  // Validate the agent exists
5236
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1z);
5236
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1A);
5237
5237
  // Validate the session exists and retrieve the associated swarm
5238
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1z);
5238
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1A);
5239
5239
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
5240
5240
  // Validate the swarm configuration
5241
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1z);
5241
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1A);
5242
5242
  // Check if the current agent matches the provided agent
5243
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1z, clientId, swarmName);
5243
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1A, clientId, swarmName);
5244
5244
  if (currentAgentName !== agentName) {
5245
5245
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
5246
5246
  swarm$1.loggerService.log('function "commitStopTools" skipped due to the agent change', {
@@ -5251,7 +5251,7 @@ const commitStopToolsInternal = beginContext(async (clientId, agentName) => {
5251
5251
  return;
5252
5252
  }
5253
5253
  // Commit the stop of the next tool execution via SessionPublicService
5254
- await swarm$1.sessionPublicService.commitStopTools(METHOD_NAME$1z, clientId, swarmName);
5254
+ await swarm$1.sessionPublicService.commitStopTools(METHOD_NAME$1A, clientId, swarmName);
5255
5255
  });
5256
5256
  /**
5257
5257
  * Prevents the next tool from being executed for a specific client and agent in the swarm system.
@@ -5812,12 +5812,12 @@ class AgentConnectionService {
5812
5812
  }
5813
5813
 
5814
5814
  /** @private Constant defining the method name for logging purposes */
5815
- const METHOD_NAME$1y = "function.common.getPayload";
5815
+ const METHOD_NAME$1z = "function.common.getPayload";
5816
5816
  /**
5817
5817
  * Function implementation
5818
5818
  */
5819
5819
  const getPayloadInternal = () => {
5820
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1y);
5820
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1z);
5821
5821
  if (PayloadContextService.hasContext()) {
5822
5822
  const { payload } = swarm$1.payloadContextService.context;
5823
5823
  return payload;
@@ -13532,7 +13532,6 @@ class DocService {
13532
13532
  result.push("## Output format");
13533
13533
  result.push("");
13534
13534
  result.push(strict ? "*Strict template match*" : "*Partial template match*");
13535
- result.push("");
13536
13535
  const entries = Object.entries(object.properties);
13537
13536
  entries.forEach(([key, { type, description, enum: e }], idx) => {
13538
13537
  result.push("");
@@ -18663,7 +18662,7 @@ const swarm = {
18663
18662
  init();
18664
18663
  var swarm$1 = swarm;
18665
18664
 
18666
- const METHOD_NAME$1x = "cli.dumpDocs";
18665
+ const METHOD_NAME$1y = "cli.dumpDocs";
18667
18666
  /**
18668
18667
  * Dumps the documentation for the agents and swarms.
18669
18668
  *
@@ -18673,7 +18672,7 @@ const METHOD_NAME$1x = "cli.dumpDocs";
18673
18672
  */
18674
18673
  const dumpDocs = beginContext((prefix = "swarm", dirName = "./docs/chat", PlantUML, sanitizeMarkdown = (t) => t) => {
18675
18674
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
18676
- swarm$1.loggerService.log(METHOD_NAME$1x, {
18675
+ swarm$1.loggerService.log(METHOD_NAME$1y, {
18677
18676
  dirName,
18678
18677
  });
18679
18678
  if (PlantUML) {
@@ -18683,10 +18682,10 @@ const dumpDocs = beginContext((prefix = "swarm", dirName = "./docs/chat", PlantU
18683
18682
  }
18684
18683
  swarm$1.agentValidationService
18685
18684
  .getAgentList()
18686
- .forEach((agentName) => swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1x));
18685
+ .forEach((agentName) => swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1y));
18687
18686
  swarm$1.swarmValidationService
18688
18687
  .getSwarmList()
18689
- .forEach((swarmName) => swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1x));
18688
+ .forEach((swarmName) => swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1y));
18690
18689
  swarm$1.agentValidationService.getAgentList().forEach((agentName) => {
18691
18690
  const { dependsOn } = swarm$1.agentSchemaService.get(agentName);
18692
18691
  if (!dependsOn) {
@@ -18695,11 +18694,11 @@ const dumpDocs = beginContext((prefix = "swarm", dirName = "./docs/chat", PlantU
18695
18694
  });
18696
18695
  swarm$1.outlineValidationService
18697
18696
  .getOutlineList()
18698
- .forEach((swarmName) => swarm$1.outlineValidationService.validate(swarmName, METHOD_NAME$1x));
18697
+ .forEach((swarmName) => swarm$1.outlineValidationService.validate(swarmName, METHOD_NAME$1y));
18699
18698
  return swarm$1.docService.dumpDocs(prefix, dirName, sanitizeMarkdown);
18700
18699
  });
18701
18700
 
18702
- const METHOD_NAME$1w = "cli.dumpAgent";
18701
+ const METHOD_NAME$1x = "cli.dumpAgent";
18703
18702
  /**
18704
18703
  * Dumps the agent information into PlantUML format.
18705
18704
  *
@@ -18708,14 +18707,14 @@ const METHOD_NAME$1w = "cli.dumpAgent";
18708
18707
  */
18709
18708
  const dumpAgent = beginContext((agentName, { withSubtree = false } = {}) => {
18710
18709
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
18711
- swarm$1.loggerService.log(METHOD_NAME$1w, {
18710
+ swarm$1.loggerService.log(METHOD_NAME$1x, {
18712
18711
  agentName,
18713
18712
  });
18714
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1w);
18713
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1x);
18715
18714
  return swarm$1.agentMetaService.toUML(agentName, withSubtree);
18716
18715
  });
18717
18716
 
18718
- const METHOD_NAME$1v = "cli.dumpSwarm";
18717
+ const METHOD_NAME$1w = "cli.dumpSwarm";
18719
18718
  /**
18720
18719
  * Dumps the swarm information into PlantUML format.
18721
18720
  *
@@ -18724,14 +18723,14 @@ const METHOD_NAME$1v = "cli.dumpSwarm";
18724
18723
  */
18725
18724
  const dumpSwarm = beginContext((swarmName) => {
18726
18725
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
18727
- swarm$1.loggerService.log(METHOD_NAME$1v, {
18726
+ swarm$1.loggerService.log(METHOD_NAME$1w, {
18728
18727
  swarmName,
18729
18728
  });
18730
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1v);
18729
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1w);
18731
18730
  return swarm$1.swarmMetaService.toUML(swarmName);
18732
18731
  });
18733
18732
 
18734
- const METHOD_NAME$1u = "cli.dumpPerfomance";
18733
+ const METHOD_NAME$1v = "cli.dumpPerfomance";
18735
18734
  const METHOD_NAME_INTERNAL$1 = "cli.dumpPerfomance.internal";
18736
18735
  const METHOD_NAME_INTERVAL = "cli.dumpPerfomance.interval";
18737
18736
  /**
@@ -18750,7 +18749,7 @@ const dumpPerfomanceInternal = beginContext(async (dirName = "./logs/meta") => {
18750
18749
  * @returns {Promise<void>} A promise that resolves when the performance data has been dumped.
18751
18750
  */
18752
18751
  const dumpPerfomance = async (dirName = "./logs/meta") => {
18753
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1u);
18752
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1v);
18754
18753
  await dumpPerfomanceInternal(dirName);
18755
18754
  };
18756
18755
  /**
@@ -18808,7 +18807,7 @@ const listenExecutionEvent = beginContext((clientId, fn) => {
18808
18807
  return swarm$1.busService.subscribe(clientId, "execution-bus", functoolsKit.queued(async (e) => await fn(e)));
18809
18808
  });
18810
18809
 
18811
- const METHOD_NAME$1t = "cli.dumpClientPerformance";
18810
+ const METHOD_NAME$1u = "cli.dumpClientPerformance";
18812
18811
  const METHOD_NAME_INTERNAL = "cli.dumpClientPerformance.internal";
18813
18812
  const METHOD_NAME_EXECUTE = "cli.dumpClientPerformance.execute";
18814
18813
  /**
@@ -18832,7 +18831,7 @@ const dumpClientPerformanceInternal = beginContext(async (clientId, dirName = ".
18832
18831
  * @returns {Promise<void>} A promise that resolves when the performance data has been dumped.
18833
18832
  */
18834
18833
  const dumpClientPerformance = async (clientId, dirName = "./logs/client") => {
18835
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1t);
18834
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1u);
18836
18835
  await dumpClientPerformanceInternal(clientId, dirName);
18837
18836
  };
18838
18837
  /**
@@ -18853,24 +18852,24 @@ dumpClientPerformance.runAfterExecute = beginContext(async (dirName = "./logs/cl
18853
18852
  });
18854
18853
 
18855
18854
  /** @private Constant defining the method name for logging and validation context */
18856
- const METHOD_NAME$1s = "function.commit.commitFlushForce";
18855
+ const METHOD_NAME$1t = "function.commit.commitFlushForce";
18857
18856
  /**
18858
18857
  * Function implementation
18859
18858
  */
18860
18859
  const commitFlushForceInternal = beginContext(async (clientId) => {
18861
18860
  // Log the flush attempt if enabled
18862
18861
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
18863
- swarm$1.loggerService.log(METHOD_NAME$1s, {
18862
+ swarm$1.loggerService.log(METHOD_NAME$1t, {
18864
18863
  clientId,
18865
- METHOD_NAME: METHOD_NAME$1s,
18864
+ METHOD_NAME: METHOD_NAME$1t,
18866
18865
  });
18867
18866
  // Validate the session exists and retrieve the associated swarm
18868
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1s);
18867
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1t);
18869
18868
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
18870
18869
  // Validate the swarm configuration
18871
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1s);
18870
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1t);
18872
18871
  // Commit the flush of agent history via SessionPublicService without agent checks
18873
- await swarm$1.sessionPublicService.commitFlush(METHOD_NAME$1s, clientId, swarmName);
18872
+ await swarm$1.sessionPublicService.commitFlush(METHOD_NAME$1t, clientId, swarmName);
18874
18873
  });
18875
18874
  /**
18876
18875
  * Forcefully commits a flush of agent history for a specific client in the swarm system, without checking the active agent.
@@ -18890,24 +18889,24 @@ async function commitFlushForce(clientId) {
18890
18889
  return await commitFlushForceInternal(clientId);
18891
18890
  }
18892
18891
 
18893
- const METHOD_NAME$1r = "function.commit.commitToolOutputForce";
18892
+ const METHOD_NAME$1s = "function.commit.commitToolOutputForce";
18894
18893
  /**
18895
18894
  * Function implementation
18896
18895
  */
18897
18896
  const commitToolOutputForceInternal = beginContext(async (toolId, content, clientId) => {
18898
18897
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
18899
18898
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
18900
- swarm$1.loggerService.log(METHOD_NAME$1r, {
18899
+ swarm$1.loggerService.log(METHOD_NAME$1s, {
18901
18900
  toolId,
18902
18901
  content,
18903
18902
  clientId,
18904
18903
  });
18905
18904
  // Validate the session and swarm to ensure they exist and are accessible
18906
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1r);
18905
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1s);
18907
18906
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
18908
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1r);
18907
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1s);
18909
18908
  // Commit the tool output to the session via the session public service without checking the active agent
18910
- await swarm$1.sessionPublicService.commitToolOutput(toolId, content, METHOD_NAME$1r, clientId, swarmName);
18909
+ await swarm$1.sessionPublicService.commitToolOutput(toolId, content, METHOD_NAME$1s, clientId, swarmName);
18911
18910
  });
18912
18911
  /**
18913
18912
  * Commits the output of a tool execution to the active agent in a swarm session without checking the active agent.
@@ -18932,15 +18931,15 @@ async function commitToolOutputForce(toolId, content, clientId) {
18932
18931
  * @private Constant defining the method name for logging and validation purposes.
18933
18932
  * Used as an identifier in log messages and validation checks to track calls to `hasNavigation`.
18934
18933
  */
18935
- const METHOD_NAME$1q = "function.common.hasNavigation";
18934
+ const METHOD_NAME$1r = "function.common.hasNavigation";
18936
18935
  /**
18937
18936
  * Function implementation
18938
18937
  */
18939
18938
  const hasNavigationInternal = async (clientId, agentName) => {
18940
18939
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
18941
- swarm$1.loggerService.log(METHOD_NAME$1q, { clientId });
18942
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1q);
18943
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1q);
18940
+ swarm$1.loggerService.log(METHOD_NAME$1r, { clientId });
18941
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1r);
18942
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1r);
18944
18943
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
18945
18944
  return swarm$1.navigationValidationService
18946
18945
  .getNavigationRoute(clientId, swarmName)
@@ -18958,14 +18957,14 @@ async function hasNavigation(clientId, agentName) {
18958
18957
  return await hasNavigationInternal(clientId, agentName);
18959
18958
  }
18960
18959
 
18961
- const METHOD_NAME$1p = "function.history.getRawHistory";
18960
+ const METHOD_NAME$1q = "function.history.getRawHistory";
18962
18961
  /**
18963
18962
  * Function implementation
18964
18963
  */
18965
18964
  const getRawHistoryInternal = beginContext(async (clientId, methodName) => {
18966
18965
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
18967
18966
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
18968
- swarm$1.loggerService.log(METHOD_NAME$1p, {
18967
+ swarm$1.loggerService.log(METHOD_NAME$1q, {
18969
18968
  clientId,
18970
18969
  });
18971
18970
  // Validate the session and swarm
@@ -18994,21 +18993,21 @@ const getRawHistoryInternal = beginContext(async (clientId, methodName) => {
18994
18993
  * console.log(rawHistory); // Outputs the full raw history array
18995
18994
  */
18996
18995
  async function getRawHistory(clientId) {
18997
- return await getRawHistoryInternal(clientId, METHOD_NAME$1p);
18996
+ return await getRawHistoryInternal(clientId, METHOD_NAME$1q);
18998
18997
  }
18999
18998
 
19000
- const METHOD_NAME$1o = "function.history.getLastUserMessage";
18999
+ const METHOD_NAME$1p = "function.history.getLastUserMessage";
19001
19000
  /**
19002
19001
  * Function implementation
19003
19002
  */
19004
19003
  const getLastUserMessageInternal = beginContext(async (clientId) => {
19005
19004
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19006
19005
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19007
- swarm$1.loggerService.log(METHOD_NAME$1o, {
19006
+ swarm$1.loggerService.log(METHOD_NAME$1p, {
19008
19007
  clientId,
19009
19008
  });
19010
19009
  // Fetch raw history and find the last user message
19011
- const history = await getRawHistoryInternal(clientId, METHOD_NAME$1o);
19010
+ const history = await getRawHistoryInternal(clientId, METHOD_NAME$1p);
19012
19011
  const last = history.findLast(({ role, mode }) => role === "user" && mode === "user");
19013
19012
  return last?.content ? last.content : null;
19014
19013
  });
@@ -19032,7 +19031,7 @@ async function getLastUserMessage(clientId) {
19032
19031
 
19033
19032
  const disposeSubject = new functoolsKit.Subject();
19034
19033
 
19035
- const METHOD_NAME$1n = "function.navigate.changeToDefaultAgent";
19034
+ const METHOD_NAME$1o = "function.navigate.changeToDefaultAgent";
19036
19035
  /**
19037
19036
  * Creates a change agent function with time-to-live (TTL) and queuing capabilities for switching to the default agent.
19038
19037
  *
@@ -19055,7 +19054,7 @@ const createChangeToDefaultAgent = functoolsKit.memoize(([clientId]) => `${clien
19055
19054
  }));
19056
19055
  {
19057
19056
  // Dispose of the current agent's resources and set up the new default agent
19058
- const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1n, clientId, swarmName);
19057
+ const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1o, clientId, swarmName);
19059
19058
  await swarm$1.agentPublicService.dispose(methodName, clientId, agentName);
19060
19059
  await swarm$1.historyPublicService.dispose(methodName, clientId, agentName);
19061
19060
  await swarm$1.swarmPublicService.setAgentRef(methodName, clientId, swarmName, agentName, await swarm$1.agentPublicService.createAgentRef(methodName, clientId, agentName));
@@ -19083,20 +19082,20 @@ const createGc$3 = functoolsKit.singleshot(async () => {
19083
19082
  const changeToDefaultAgentInternal = beginContext(async (clientId) => {
19084
19083
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19085
19084
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19086
- swarm$1.loggerService.log(METHOD_NAME$1n, {
19085
+ swarm$1.loggerService.log(METHOD_NAME$1o, {
19087
19086
  clientId,
19088
19087
  });
19089
19088
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
19090
19089
  const { defaultAgent: agentName } = swarm$1.swarmSchemaService.get(swarmName);
19091
19090
  {
19092
19091
  // Validate session and default agent
19093
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1n);
19094
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1n);
19092
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1o);
19093
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1o);
19095
19094
  }
19096
19095
  // Execute the agent change with TTL and queuing
19097
19096
  const run = await createChangeToDefaultAgent(clientId);
19098
19097
  createGc$3();
19099
- return await run(METHOD_NAME$1n, agentName, swarmName);
19098
+ return await run(METHOD_NAME$1o, agentName, swarmName);
19100
19099
  });
19101
19100
  /**
19102
19101
  * Navigates back to the default agent for a given client session in a swarm.
@@ -19115,23 +19114,23 @@ async function changeToDefaultAgent(clientId) {
19115
19114
  return await changeToDefaultAgentInternal(clientId);
19116
19115
  }
19117
19116
 
19118
- const METHOD_NAME$1m = "function.target.emitForce";
19117
+ const METHOD_NAME$1n = "function.target.emitForce";
19119
19118
  /**
19120
19119
  * Function implementation
19121
19120
  */
19122
19121
  const emitForceInternal = beginContext(async (content, clientId) => {
19123
19122
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19124
19123
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19125
- swarm$1.loggerService.log(METHOD_NAME$1m, {
19124
+ swarm$1.loggerService.log(METHOD_NAME$1n, {
19126
19125
  content,
19127
19126
  clientId,
19128
19127
  });
19129
19128
  // Validate the session and swarm
19130
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1m);
19129
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1n);
19131
19130
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
19132
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1m);
19131
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1n);
19133
19132
  // Emit the content directly via the session public service
19134
- return await swarm$1.sessionPublicService.emit(content, METHOD_NAME$1m, clientId, swarmName);
19133
+ return await swarm$1.sessionPublicService.emit(content, METHOD_NAME$1n, clientId, swarmName);
19135
19134
  });
19136
19135
  /**
19137
19136
  * Emits a string as model output without executing an incoming message or checking the active agent.
@@ -19152,7 +19151,7 @@ async function emitForce(content, clientId) {
19152
19151
  return await emitForceInternal(content, clientId);
19153
19152
  }
19154
19153
 
19155
- const METHOD_NAME$1l = "function.target.executeForce";
19154
+ const METHOD_NAME$1m = "function.target.executeForce";
19156
19155
  /**
19157
19156
  * Function implementation
19158
19157
  */
@@ -19160,22 +19159,22 @@ const executeForceInternal = beginContext(async (content, clientId) => {
19160
19159
  const executionId = functoolsKit.randomString();
19161
19160
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19162
19161
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19163
- swarm$1.loggerService.log(METHOD_NAME$1l, {
19162
+ swarm$1.loggerService.log(METHOD_NAME$1m, {
19164
19163
  content,
19165
19164
  clientId,
19166
19165
  executionId,
19167
19166
  });
19168
19167
  // Validate the session and swarm
19169
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1l);
19168
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1m);
19170
19169
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
19171
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1l);
19170
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1m);
19172
19171
  // Execute the command within an execution context with performance tracking
19173
19172
  return ExecutionContextService.runInContext(async () => {
19174
19173
  let isFinished = false;
19175
19174
  swarm$1.perfService.startExecution(executionId, clientId, content.length);
19176
19175
  try {
19177
19176
  swarm$1.busService.commitExecutionBegin(clientId, { swarmName });
19178
- const result = await swarm$1.sessionPublicService.execute(content, "tool", METHOD_NAME$1l, clientId, swarmName);
19177
+ const result = await swarm$1.sessionPublicService.execute(content, "tool", METHOD_NAME$1m, clientId, swarmName);
19179
19178
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
19180
19179
  swarm$1.busService.commitExecutionEnd(clientId, { swarmName });
19181
19180
  return result;
@@ -19213,24 +19212,24 @@ async function executeForce(content, clientId) {
19213
19212
  }
19214
19213
 
19215
19214
  /** @private Constant defining the method name for logging and validation context */
19216
- const METHOD_NAME$1k = "function.commit.commitStopToolsForce";
19215
+ const METHOD_NAME$1l = "function.commit.commitStopToolsForce";
19217
19216
  /**
19218
19217
  * Function implementation
19219
19218
  */
19220
19219
  const commitStopToolsForceInternal = beginContext(async (clientId) => {
19221
19220
  // Log the stop tools attempt if enabled
19222
19221
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19223
- swarm$1.loggerService.log(METHOD_NAME$1k, {
19222
+ swarm$1.loggerService.log(METHOD_NAME$1l, {
19224
19223
  clientId,
19225
- METHOD_NAME: METHOD_NAME$1k,
19224
+ METHOD_NAME: METHOD_NAME$1l,
19226
19225
  });
19227
19226
  // Validate the session exists and retrieve the associated swarm
19228
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1k);
19227
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1l);
19229
19228
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
19230
19229
  // Validate the swarm configuration
19231
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1k);
19230
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$1l);
19232
19231
  // Commit the stop of the next tool execution via SessionPublicService without agent checks
19233
- await swarm$1.sessionPublicService.commitStopTools(METHOD_NAME$1k, clientId, swarmName);
19232
+ await swarm$1.sessionPublicService.commitStopTools(METHOD_NAME$1l, clientId, swarmName);
19234
19233
  });
19235
19234
  /**
19236
19235
  * Forcefully prevents the next tool from being executed for a specific client in the swarm system, without checking the active agent.
@@ -19250,7 +19249,7 @@ async function commitStopToolsForce(clientId) {
19250
19249
  return await commitStopToolsForceInternal(clientId);
19251
19250
  }
19252
19251
 
19253
- const METHOD_NAME$1j = "function.template.navigateToTriageAgent";
19252
+ const METHOD_NAME$1k = "function.template.navigateToTriageAgent";
19254
19253
  /**
19255
19254
  * Will send tool output directly to the model without any additions
19256
19255
  */
@@ -19301,7 +19300,7 @@ const createNavigateToTriageAgent = ({ flushMessage, beforeNavigate, lastMessage
19301
19300
  */
19302
19301
  return beginContext(async (toolId, clientId) => {
19303
19302
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19304
- swarm$1.loggerService.log(METHOD_NAME$1j, {
19303
+ swarm$1.loggerService.log(METHOD_NAME$1k, {
19305
19304
  clientId,
19306
19305
  toolId,
19307
19306
  });
@@ -19336,7 +19335,7 @@ const createNavigateToTriageAgent = ({ flushMessage, beforeNavigate, lastMessage
19336
19335
  });
19337
19336
  };
19338
19337
 
19339
- const METHOD_NAME$1i = "function.navigate.changeToAgent";
19338
+ const METHOD_NAME$1j = "function.navigate.changeToAgent";
19340
19339
  /**
19341
19340
  * Creates a change agent function with time-to-live (TTL) and queuing capabilities.
19342
19341
  *
@@ -19360,7 +19359,7 @@ const createChangeToAgent = functoolsKit.memoize(([clientId]) => `${clientId}`,
19360
19359
  }));
19361
19360
  {
19362
19361
  // Dispose of the current agent's resources and set up the new agent
19363
- const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1i, clientId, swarmName);
19362
+ const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1j, clientId, swarmName);
19364
19363
  await swarm$1.agentPublicService.dispose(methodName, clientId, agentName);
19365
19364
  await swarm$1.historyPublicService.dispose(methodName, clientId, agentName);
19366
19365
  await swarm$1.swarmPublicService.setAgentRef(methodName, clientId, swarmName, agentName, await swarm$1.agentPublicService.createAgentRef(methodName, clientId, agentName));
@@ -19388,16 +19387,16 @@ const createGc$2 = functoolsKit.singleshot(async () => {
19388
19387
  const changeToAgentInternal = beginContext(async (agentName, clientId) => {
19389
19388
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19390
19389
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19391
- swarm$1.loggerService.log(METHOD_NAME$1i, {
19390
+ swarm$1.loggerService.log(METHOD_NAME$1j, {
19392
19391
  agentName,
19393
19392
  clientId,
19394
19393
  });
19395
19394
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
19396
19395
  {
19397
19396
  // Validate session, agent, and dependencies
19398
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1i);
19399
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1i);
19400
- const activeAgent = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1i, clientId, swarmName);
19397
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1j);
19398
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1j);
19399
+ const activeAgent = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1j, clientId, swarmName);
19401
19400
  if (!swarm$1.agentValidationService.hasDependency(activeAgent, agentName)) {
19402
19401
  console.error(`agent-swarm missing dependency detected for activeAgent=${activeAgent} dependencyAgent=${agentName}`);
19403
19402
  }
@@ -19415,7 +19414,7 @@ const changeToAgentInternal = beginContext(async (agentName, clientId) => {
19415
19414
  // Execute the agent change with TTL and queuing
19416
19415
  const run = await createChangeToAgent(clientId);
19417
19416
  createGc$2();
19418
- return await run(METHOD_NAME$1i, agentName, swarmName);
19417
+ return await run(METHOD_NAME$1j, agentName, swarmName);
19419
19418
  });
19420
19419
  /**
19421
19420
  * Changes the active agent for a given client session in a swarm.
@@ -19435,7 +19434,7 @@ async function changeToAgent(agentName, clientId) {
19435
19434
  return await changeToAgentInternal(agentName, clientId);
19436
19435
  }
19437
19436
 
19438
- const METHOD_NAME$1h = "function.template.navigateToAgent";
19437
+ const METHOD_NAME$1i = "function.template.navigateToAgent";
19439
19438
  /**
19440
19439
  * Will send tool output directly to the model without any additions
19441
19440
  */
@@ -19511,7 +19510,7 @@ const createNavigateToAgent = ({ beforeNavigate, lastMessage: lastMessageFn = DE
19511
19510
  */
19512
19511
  return beginContext(async (toolId, clientId, agentName) => {
19513
19512
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19514
- swarm$1.loggerService.log(METHOD_NAME$1h, {
19513
+ swarm$1.loggerService.log(METHOD_NAME$1i, {
19515
19514
  clientId,
19516
19515
  toolId,
19517
19516
  });
@@ -19549,14 +19548,14 @@ const createNavigateToAgent = ({ beforeNavigate, lastMessage: lastMessageFn = DE
19549
19548
  });
19550
19549
  };
19551
19550
 
19552
- const METHOD_NAME$1g = "function.setup.addTool";
19551
+ const METHOD_NAME$1h = "function.setup.addTool";
19553
19552
  /**
19554
19553
  * Function implementation
19555
19554
  */
19556
19555
  const addToolInternal = beginContext((toolSchema) => {
19557
19556
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19558
19557
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19559
- swarm$1.loggerService.log(METHOD_NAME$1g, {
19558
+ swarm$1.loggerService.log(METHOD_NAME$1h, {
19560
19559
  toolSchema,
19561
19560
  });
19562
19561
  // Register the tool in the validation and schema services
@@ -19591,12 +19590,12 @@ function addTool(toolSchema) {
19591
19590
  * Adds navigation functionality to an agent by creating a tool that allows navigation to a specified agent.
19592
19591
  * @module addAgentNavigation
19593
19592
  */
19594
- const METHOD_NAME$1f = "function.alias.addAgentNavigation";
19593
+ const METHOD_NAME$1g = "function.alias.addAgentNavigation";
19595
19594
  /**
19596
19595
  * Function implementation
19597
19596
  */
19598
19597
  const addAgentNavigationInternal = beginContext(({ toolName, docNote, description, navigateTo, ...navigateProps }) => {
19599
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1f);
19598
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1g);
19600
19599
  const navigate = createNavigateToAgent(navigateProps);
19601
19600
  const toolSchema = addTool({
19602
19601
  toolName,
@@ -19640,12 +19639,12 @@ function addAgentNavigation(params) {
19640
19639
  * Adds triage navigation functionality to an agent by creating a tool that facilitates navigation to a triage agent.
19641
19640
  * @module addTriageNavigation
19642
19641
  */
19643
- const METHOD_NAME$1e = "function.alias.addTriageNavigation";
19642
+ const METHOD_NAME$1f = "function.alias.addTriageNavigation";
19644
19643
  /**
19645
19644
  * Function implementation
19646
19645
  */
19647
19646
  const addTriageNavigationInternal = beginContext(({ toolName, docNote, description, ...navigateProps }) => {
19648
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1e);
19647
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$1f);
19649
19648
  const navigate = createNavigateToTriageAgent(navigateProps);
19650
19649
  const toolSchema = addTool({
19651
19650
  toolName,
@@ -19685,13 +19684,13 @@ function addTriageNavigation(params) {
19685
19684
  }
19686
19685
 
19687
19686
  /** @constant {string} METHOD_NAME - The name of the method used for logging */
19688
- const METHOD_NAME$1d = "function.setup.addWiki";
19687
+ const METHOD_NAME$1e = "function.setup.addWiki";
19689
19688
  /**
19690
19689
  * Function implementation
19691
19690
  */
19692
19691
  const addWikiInternal = beginContext((wikiSchema) => {
19693
19692
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19694
- swarm$1.loggerService.log(METHOD_NAME$1d, {
19693
+ swarm$1.loggerService.log(METHOD_NAME$1e, {
19695
19694
  wikiSchema,
19696
19695
  });
19697
19696
  swarm$1.wikiValidationService.addWiki(wikiSchema.wikiName, wikiSchema);
@@ -19778,14 +19777,14 @@ const mapAgentSchema = ({ system, systemDynamic, systemStatic, ...schema }) => r
19778
19777
  : systemDynamic,
19779
19778
  });
19780
19779
 
19781
- const METHOD_NAME$1c = "function.setup.addAgent";
19780
+ const METHOD_NAME$1d = "function.setup.addAgent";
19782
19781
  /**
19783
19782
  * Function implementation
19784
19783
  */
19785
19784
  const addAgentInternal = beginContext((publicAgentSchema) => {
19786
19785
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19787
19786
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19788
- swarm$1.loggerService.log(METHOD_NAME$1c, {
19787
+ swarm$1.loggerService.log(METHOD_NAME$1d, {
19789
19788
  agentSchema: publicAgentSchema,
19790
19789
  });
19791
19790
  const agentSchema = mapAgentSchema(publicAgentSchema);
@@ -19815,14 +19814,14 @@ function addAgent(agentSchema) {
19815
19814
  return addAgentInternal(agentSchema);
19816
19815
  }
19817
19816
 
19818
- const METHOD_NAME$1b = "function.setup.addCompletion";
19817
+ const METHOD_NAME$1c = "function.setup.addCompletion";
19819
19818
  /**
19820
19819
  * Function implementation
19821
19820
  */
19822
19821
  const addCompletionInternal = beginContext((completionSchema) => {
19823
19822
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19824
19823
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19825
- swarm$1.loggerService.log(METHOD_NAME$1b, {
19824
+ swarm$1.loggerService.log(METHOD_NAME$1c, {
19826
19825
  completionSchema,
19827
19826
  });
19828
19827
  // Register the completion in the validation and schema services
@@ -19851,14 +19850,14 @@ function addCompletion(completionSchema) {
19851
19850
  return addCompletionInternal(completionSchema);
19852
19851
  }
19853
19852
 
19854
- const METHOD_NAME$1a = "function.setup.addSwarm";
19853
+ const METHOD_NAME$1b = "function.setup.addSwarm";
19855
19854
  /**
19856
19855
  * Function implementation
19857
19856
  */
19858
19857
  const addSwarmInternal = beginContext((swarmSchema) => {
19859
19858
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19860
19859
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19861
- swarm$1.loggerService.log(METHOD_NAME$1a, {
19860
+ swarm$1.loggerService.log(METHOD_NAME$1b, {
19862
19861
  swarmSchema,
19863
19862
  });
19864
19863
  // Register the swarm in the validation and schema services
@@ -19887,13 +19886,13 @@ function addSwarm(swarmSchema) {
19887
19886
  return addSwarmInternal(swarmSchema);
19888
19887
  }
19889
19888
 
19890
- const METHOD_NAME$19 = "function.setup.addMCP";
19889
+ const METHOD_NAME$1a = "function.setup.addMCP";
19891
19890
  /**
19892
19891
  * Function implementation
19893
19892
  */
19894
19893
  const addMCPInternal = beginContext((mcpSchema) => {
19895
19894
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19896
- swarm$1.loggerService.log(METHOD_NAME$19, {
19895
+ swarm$1.loggerService.log(METHOD_NAME$1a, {
19897
19896
  mcpSchema,
19898
19897
  });
19899
19898
  swarm$1.mcpValidationService.addMCP(mcpSchema.mcpName, mcpSchema);
@@ -19909,14 +19908,14 @@ function addMCP(mcpSchema) {
19909
19908
  return addMCPInternal(mcpSchema);
19910
19909
  }
19911
19910
 
19912
- const METHOD_NAME$18 = "function.setup.addState";
19911
+ const METHOD_NAME$19 = "function.setup.addState";
19913
19912
  /**
19914
19913
  * Function implementation
19915
19914
  */
19916
19915
  const addStateInternal = beginContext((stateSchema) => {
19917
19916
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19918
19917
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19919
- swarm$1.loggerService.log(METHOD_NAME$18, {
19918
+ swarm$1.loggerService.log(METHOD_NAME$19, {
19920
19919
  stateSchema,
19921
19920
  });
19922
19921
  // Register the policy with StateValidationService for runtime validation
@@ -19954,14 +19953,14 @@ function addState(stateSchema) {
19954
19953
  return addStateInternal(stateSchema);
19955
19954
  }
19956
19955
 
19957
- const METHOD_NAME$17 = "function.setup.addEmbedding";
19956
+ const METHOD_NAME$18 = "function.setup.addEmbedding";
19958
19957
  /**
19959
19958
  * Function implementation
19960
19959
  */
19961
19960
  const addEmbeddingInternal = beginContext((embeddingSchema) => {
19962
19961
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19963
19962
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
19964
- swarm$1.loggerService.log(METHOD_NAME$17, {
19963
+ swarm$1.loggerService.log(METHOD_NAME$18, {
19965
19964
  embeddingSchema,
19966
19965
  });
19967
19966
  // Register the embedding in the validation and schema services
@@ -19990,14 +19989,14 @@ function addEmbedding(embeddingSchema) {
19990
19989
  return addEmbeddingInternal(embeddingSchema);
19991
19990
  }
19992
19991
 
19993
- const METHOD_NAME$16 = "function.setup.addStorage";
19992
+ const METHOD_NAME$17 = "function.setup.addStorage";
19994
19993
  /**
19995
19994
  * Function implementation
19996
19995
  */
19997
19996
  const addStorageInternal = beginContext((storageSchema) => {
19998
19997
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
19999
19998
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20000
- swarm$1.loggerService.log(METHOD_NAME$16, {
19999
+ swarm$1.loggerService.log(METHOD_NAME$17, {
20001
20000
  storageSchema,
20002
20001
  });
20003
20002
  // Register the storage in the validation and schema services
@@ -20035,14 +20034,14 @@ function addStorage(storageSchema) {
20035
20034
  }
20036
20035
 
20037
20036
  /** @private Constant defining the method name for logging and validation context */
20038
- const METHOD_NAME$15 = "function.setup.addPolicy";
20037
+ const METHOD_NAME$16 = "function.setup.addPolicy";
20039
20038
  /**
20040
20039
  * Function implementation
20041
20040
  */
20042
20041
  const addPolicyInternal = beginContext((policySchema) => {
20043
20042
  // Log the policy addition attempt if enabled
20044
20043
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20045
- swarm$1.loggerService.log(METHOD_NAME$15, {
20044
+ swarm$1.loggerService.log(METHOD_NAME$16, {
20046
20045
  policySchema,
20047
20046
  });
20048
20047
  // Register the policy with PolicyValidationService for runtime validation
@@ -20103,13 +20102,13 @@ function addCompute(computeSchema) {
20103
20102
  * @description Method name for the addPipeline operation.
20104
20103
  * @private
20105
20104
  */
20106
- const METHOD_NAME$14 = "function.setup.addPipeline";
20105
+ const METHOD_NAME$15 = "function.setup.addPipeline";
20107
20106
  /**
20108
20107
  * Function implementation
20109
20108
  */
20110
20109
  const addPipelineInternal = beginContext((pipelineSchema) => {
20111
20110
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20112
- swarm$1.loggerService.log(METHOD_NAME$14, {
20111
+ swarm$1.loggerService.log(METHOD_NAME$15, {
20113
20112
  pipelineSchema,
20114
20113
  });
20115
20114
  swarm$1.pipelineValidationService.addPipeline(pipelineSchema.pipelineName, pipelineSchema);
@@ -20132,7 +20131,7 @@ function addPipeline(pipelineSchema) {
20132
20131
  * @private
20133
20132
  * @constant {string}
20134
20133
  */
20135
- const METHOD_NAME$13 = "function.setup.addOutline";
20134
+ const METHOD_NAME$14 = "function.setup.addOutline";
20136
20135
  /**
20137
20136
  * Internal implementation of the outline addition logic, wrapped in a clean context.
20138
20137
  * Registers the outline schema with both the validation and schema services and logs the operation if enabled.
@@ -20142,7 +20141,7 @@ const METHOD_NAME$13 = "function.setup.addOutline";
20142
20141
  */
20143
20142
  const addOutlineInternal = beginContext((outlineSchema) => {
20144
20143
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20145
- swarm$1.loggerService.log(METHOD_NAME$13, {
20144
+ swarm$1.loggerService.log(METHOD_NAME$14, {
20146
20145
  outlineSchema,
20147
20146
  });
20148
20147
  swarm$1.outlineValidationService.addOutline(outlineSchema.outlineName, outlineSchema);
@@ -20160,13 +20159,13 @@ function addOutline(outlineSchema) {
20160
20159
  return addOutlineInternal(outlineSchema);
20161
20160
  }
20162
20161
 
20163
- const METHOD_NAME$12 = "function.test.overrideAgent";
20162
+ const METHOD_NAME$13 = "function.test.overrideAgent";
20164
20163
  /**
20165
20164
  * Function implementation
20166
20165
  */
20167
20166
  const overrideAgentInternal = beginContext((publicAgentSchema) => {
20168
20167
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20169
- swarm$1.loggerService.log(METHOD_NAME$12, {
20168
+ swarm$1.loggerService.log(METHOD_NAME$13, {
20170
20169
  agentSchema: publicAgentSchema,
20171
20170
  });
20172
20171
  const agentSchema = mapAgentSchema(publicAgentSchema);
@@ -20197,13 +20196,13 @@ function overrideAgent(agentSchema) {
20197
20196
  return overrideAgentInternal(agentSchema);
20198
20197
  }
20199
20198
 
20200
- const METHOD_NAME$11 = "function.test.overrideCompletion";
20199
+ const METHOD_NAME$12 = "function.test.overrideCompletion";
20201
20200
  /**
20202
20201
  * Function implementation
20203
20202
  */
20204
20203
  const overrideCompletionInternal = beginContext((completionSchema) => {
20205
20204
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20206
- swarm$1.loggerService.log(METHOD_NAME$11, {
20205
+ swarm$1.loggerService.log(METHOD_NAME$12, {
20207
20206
  completionSchema,
20208
20207
  });
20209
20208
  return swarm$1.completionSchemaService.override(completionSchema.completionName, completionSchema);
@@ -20233,13 +20232,13 @@ function overrideCompletion(completionSchema) {
20233
20232
  return overrideCompletionInternal(completionSchema);
20234
20233
  }
20235
20234
 
20236
- const METHOD_NAME$10 = "function.test.overrideEmbeding";
20235
+ const METHOD_NAME$11 = "function.test.overrideEmbeding";
20237
20236
  /**
20238
20237
  * Function implementation
20239
20238
  */
20240
20239
  const overrideEmbedingInternal = beginContext((embeddingSchema) => {
20241
20240
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20242
- swarm$1.loggerService.log(METHOD_NAME$10, {
20241
+ swarm$1.loggerService.log(METHOD_NAME$11, {
20243
20242
  embeddingSchema,
20244
20243
  });
20245
20244
  return swarm$1.embeddingSchemaService.override(embeddingSchema.embeddingName, embeddingSchema);
@@ -20271,13 +20270,13 @@ function overrideEmbeding(embeddingSchema) {
20271
20270
  return overrideEmbedingInternal(embeddingSchema);
20272
20271
  }
20273
20272
 
20274
- const METHOD_NAME$$ = "function.test.overridePolicy";
20273
+ const METHOD_NAME$10 = "function.test.overridePolicy";
20275
20274
  /**
20276
20275
  * Function implementation
20277
20276
  */
20278
20277
  const overridePolicyInternal = beginContext((policySchema) => {
20279
20278
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20280
- swarm$1.loggerService.log(METHOD_NAME$$, {
20279
+ swarm$1.loggerService.log(METHOD_NAME$10, {
20281
20280
  policySchema,
20282
20281
  });
20283
20282
  return swarm$1.policySchemaService.override(policySchema.policyName, policySchema);
@@ -20307,13 +20306,13 @@ function overridePolicy(policySchema) {
20307
20306
  return overridePolicyInternal(policySchema);
20308
20307
  }
20309
20308
 
20310
- const METHOD_NAME$_ = "function.test.overrideState";
20309
+ const METHOD_NAME$$ = "function.test.overrideState";
20311
20310
  /**
20312
20311
  * Function implementation
20313
20312
  */
20314
20313
  const overrideStateInternal = beginContext((stateSchema) => {
20315
20314
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20316
- swarm$1.loggerService.log(METHOD_NAME$_, {
20315
+ swarm$1.loggerService.log(METHOD_NAME$$, {
20317
20316
  stateSchema,
20318
20317
  });
20319
20318
  return swarm$1.stateSchemaService.override(stateSchema.stateName, stateSchema);
@@ -20344,13 +20343,13 @@ function overrideState(stateSchema) {
20344
20343
  return overrideStateInternal(stateSchema);
20345
20344
  }
20346
20345
 
20347
- const METHOD_NAME$Z = "function.test.overrideStorage";
20346
+ const METHOD_NAME$_ = "function.test.overrideStorage";
20348
20347
  /**
20349
20348
  * Function implementation
20350
20349
  */
20351
20350
  const overrideStorageInternal = beginContext((storageSchema) => {
20352
20351
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20353
- swarm$1.loggerService.log(METHOD_NAME$Z, {
20352
+ swarm$1.loggerService.log(METHOD_NAME$_, {
20354
20353
  storageSchema,
20355
20354
  });
20356
20355
  return swarm$1.storageSchemaService.override(storageSchema.storageName, storageSchema);
@@ -20382,13 +20381,13 @@ function overrideStorage(storageSchema) {
20382
20381
  return overrideStorageInternal(storageSchema);
20383
20382
  }
20384
20383
 
20385
- const METHOD_NAME$Y = "function.test.overrideSwarm";
20384
+ const METHOD_NAME$Z = "function.test.overrideSwarm";
20386
20385
  /**
20387
20386
  * Function implementation
20388
20387
  */
20389
20388
  const overrideSwarmInternal = beginContext((swarmSchema) => {
20390
20389
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20391
- swarm$1.loggerService.log(METHOD_NAME$Y, {
20390
+ swarm$1.loggerService.log(METHOD_NAME$Z, {
20392
20391
  swarmSchema,
20393
20392
  });
20394
20393
  return swarm$1.swarmSchemaService.override(swarmSchema.swarmName, swarmSchema);
@@ -20418,13 +20417,13 @@ function overrideSwarm(swarmSchema) {
20418
20417
  return overrideSwarmInternal(swarmSchema);
20419
20418
  }
20420
20419
 
20421
- const METHOD_NAME$X = "function.test.overrideTool";
20420
+ const METHOD_NAME$Y = "function.test.overrideTool";
20422
20421
  /**
20423
20422
  * Function implementation
20424
20423
  */
20425
20424
  const overrideToolInternal = beginContext((toolSchema) => {
20426
20425
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20427
- swarm$1.loggerService.log(METHOD_NAME$X, {
20426
+ swarm$1.loggerService.log(METHOD_NAME$Y, {
20428
20427
  toolSchema,
20429
20428
  });
20430
20429
  return swarm$1.toolSchemaService.override(toolSchema.toolName, toolSchema);
@@ -20454,13 +20453,13 @@ function overrideTool(toolSchema) {
20454
20453
  return overrideToolInternal(toolSchema);
20455
20454
  }
20456
20455
 
20457
- const METHOD_NAME$W = "function.test.overrideMCP";
20456
+ const METHOD_NAME$X = "function.test.overrideMCP";
20458
20457
  /**
20459
20458
  * Function implementation
20460
20459
  */
20461
20460
  const overrideMCPInternal = beginContext((mcpSchema) => {
20462
20461
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20463
- swarm$1.loggerService.log(METHOD_NAME$W, {
20462
+ swarm$1.loggerService.log(METHOD_NAME$X, {
20464
20463
  mcpSchema,
20465
20464
  });
20466
20465
  return swarm$1.mcpSchemaService.override(mcpSchema.mcpName, mcpSchema);
@@ -20474,13 +20473,13 @@ function overrideMCP(mcpSchema) {
20474
20473
  return overrideMCPInternal(mcpSchema);
20475
20474
  }
20476
20475
 
20477
- const METHOD_NAME$V = "function.test.overrideWiki";
20476
+ const METHOD_NAME$W = "function.test.overrideWiki";
20478
20477
  /**
20479
20478
  * Function implementation
20480
20479
  */
20481
20480
  const overrideWikiInternal = beginContext((wikiSchema) => {
20482
20481
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20483
- swarm$1.loggerService.log(METHOD_NAME$V, {
20482
+ swarm$1.loggerService.log(METHOD_NAME$W, {
20484
20483
  wikiSchema,
20485
20484
  });
20486
20485
  return swarm$1.wikiSchemaService.override(wikiSchema.wikiName, wikiSchema);
@@ -20519,13 +20518,13 @@ function overrideWiki(wikiSchema) {
20519
20518
  * @description Method name for the overrideCompute operation.
20520
20519
  * @private
20521
20520
  */
20522
- const METHOD_NAME$U = "function.test.overrideCompute";
20521
+ const METHOD_NAME$V = "function.test.overrideCompute";
20523
20522
  /**
20524
20523
  * Function implementation
20525
20524
  */
20526
20525
  const overrideComputeInternal = beginContext((computeSchema) => {
20527
20526
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20528
- swarm$1.loggerService.log(METHOD_NAME$U, {
20527
+ swarm$1.loggerService.log(METHOD_NAME$V, {
20529
20528
  computeSchema,
20530
20529
  });
20531
20530
  return swarm$1.computeSchemaService.override(computeSchema.computeName, computeSchema);
@@ -20548,13 +20547,13 @@ function overrideCompute(computeSchema) {
20548
20547
  * @description Method name for the overridePipeline operation.
20549
20548
  * @private
20550
20549
  */
20551
- const METHOD_NAME$T = "function.test.overridePipeline";
20550
+ const METHOD_NAME$U = "function.test.overridePipeline";
20552
20551
  /**
20553
20552
  * Function implementation
20554
20553
  */
20555
20554
  const overridePipelineInternal = beginContext((pipelineSchema) => {
20556
20555
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20557
- swarm$1.loggerService.log(METHOD_NAME$T, {
20556
+ swarm$1.loggerService.log(METHOD_NAME$U, {
20558
20557
  pipelineSchema,
20559
20558
  });
20560
20559
  return swarm$1.pipelineSchemaService.override(pipelineSchema.pipelineName, pipelineSchema);
@@ -20575,7 +20574,7 @@ function overridePipeline(pipelineSchema) {
20575
20574
  * @private
20576
20575
  * @constant {string}
20577
20576
  */
20578
- const METHOD_NAME$S = "function.test.overrideOutline";
20577
+ const METHOD_NAME$T = "function.test.overrideOutline";
20579
20578
  /**
20580
20579
  * Internal implementation of the outline override logic, wrapped in a clean context.
20581
20580
  * Updates the specified outline schema in the swarm's schema service and logs the operation if enabled.
@@ -20584,7 +20583,7 @@ const METHOD_NAME$S = "function.test.overrideOutline";
20584
20583
  */
20585
20584
  const overrideOutlineInternal = beginContext((outlineSchema) => {
20586
20585
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20587
- swarm$1.loggerService.log(METHOD_NAME$S, {
20586
+ swarm$1.loggerService.log(METHOD_NAME$T, {
20588
20587
  outlineSchema,
20589
20588
  });
20590
20589
  return swarm$1.outlineSchemaService.override(outlineSchema.outlineName, outlineSchema);
@@ -20599,23 +20598,23 @@ function overrideOutline(outlineSchema) {
20599
20598
  return overrideOutlineInternal(outlineSchema);
20600
20599
  }
20601
20600
 
20602
- const METHOD_NAME$R = "function.other.markOnline";
20601
+ const METHOD_NAME$S = "function.other.markOnline";
20603
20602
  /**
20604
20603
  * Function implementation
20605
20604
  */
20606
20605
  const markOnlineInternal = async (clientId, swarmName) => {
20607
20606
  // Log the operation if logging is enabled in the global configuration
20608
20607
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20609
- swarm.loggerService.log(METHOD_NAME$R, {
20608
+ swarm.loggerService.log(METHOD_NAME$S, {
20610
20609
  clientId,
20611
20610
  });
20612
20611
  // Validate the swarm name
20613
- swarm.swarmValidationService.validate(swarmName, METHOD_NAME$R);
20612
+ swarm.swarmValidationService.validate(swarmName, METHOD_NAME$S);
20614
20613
  // Run the operation in the method context
20615
20614
  return await MethodContextService.runInContext(async () => {
20616
- await swarm.aliveService.markOnline(clientId, swarmName, METHOD_NAME$R);
20615
+ await swarm.aliveService.markOnline(clientId, swarmName, METHOD_NAME$S);
20617
20616
  }, {
20618
- methodName: METHOD_NAME$R,
20617
+ methodName: METHOD_NAME$S,
20619
20618
  agentName: "",
20620
20619
  policyName: "",
20621
20620
  stateName: "",
@@ -20638,20 +20637,20 @@ async function markOnline(clientId, swarmName) {
20638
20637
  return await markOnlineInternal(clientId, swarmName);
20639
20638
  }
20640
20639
 
20641
- const METHOD_NAME$Q = "function.other.markOffline";
20640
+ const METHOD_NAME$R = "function.other.markOffline";
20642
20641
  /**
20643
20642
  * Function implementation
20644
20643
  */
20645
20644
  const markOfflineInternal = async (clientId, swarmName) => {
20646
20645
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20647
- swarm.loggerService.log(METHOD_NAME$Q, {
20646
+ swarm.loggerService.log(METHOD_NAME$R, {
20648
20647
  clientId,
20649
20648
  });
20650
- swarm.swarmValidationService.validate(swarmName, METHOD_NAME$Q);
20649
+ swarm.swarmValidationService.validate(swarmName, METHOD_NAME$R);
20651
20650
  return await MethodContextService.runInContext(async () => {
20652
- await swarm.aliveService.markOffline(clientId, swarmName, METHOD_NAME$Q);
20651
+ await swarm.aliveService.markOffline(clientId, swarmName, METHOD_NAME$R);
20653
20652
  }, {
20654
- methodName: METHOD_NAME$Q,
20653
+ methodName: METHOD_NAME$R,
20655
20654
  agentName: "",
20656
20655
  policyName: "",
20657
20656
  stateName: "",
@@ -20679,27 +20678,27 @@ async function markOffline(clientId, swarmName) {
20679
20678
  }
20680
20679
 
20681
20680
  /** @private Constant defining the method name for logging and validation context */
20682
- const METHOD_NAME$P = "function.commit.commitSystemMessage";
20681
+ const METHOD_NAME$Q = "function.commit.commitSystemMessage";
20683
20682
  /**
20684
20683
  * Function implementation
20685
20684
  */
20686
20685
  const commitSystemMessageInternal = beginContext(async (content, clientId, agentName) => {
20687
20686
  // Log the commit attempt if enabled
20688
20687
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20689
- swarm$1.loggerService.log(METHOD_NAME$P, {
20688
+ swarm$1.loggerService.log(METHOD_NAME$Q, {
20690
20689
  content,
20691
20690
  clientId,
20692
20691
  agentName,
20693
20692
  });
20694
20693
  // Validate the agent exists
20695
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$P);
20694
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$Q);
20696
20695
  // Validate the session exists and retrieve the associated swarm
20697
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$P);
20696
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$Q);
20698
20697
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
20699
20698
  // Validate the swarm configuration
20700
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$P);
20699
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$Q);
20701
20700
  // Check if the current agent matches the provided agent
20702
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$P, clientId, swarmName);
20701
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$Q, clientId, swarmName);
20703
20702
  if (currentAgentName !== agentName) {
20704
20703
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20705
20704
  swarm$1.loggerService.log('function "commitSystemMessage" skipped due to the agent change', {
@@ -20710,7 +20709,7 @@ const commitSystemMessageInternal = beginContext(async (content, clientId, agent
20710
20709
  return;
20711
20710
  }
20712
20711
  // Commit the system message via SessionPublicService
20713
- await swarm$1.sessionPublicService.commitSystemMessage(content, METHOD_NAME$P, clientId, swarmName);
20712
+ await swarm$1.sessionPublicService.commitSystemMessage(content, METHOD_NAME$Q, clientId, swarmName);
20714
20713
  });
20715
20714
  /**
20716
20715
  * Commits a system-generated message to the active agent in the swarm system.
@@ -20731,26 +20730,26 @@ async function commitSystemMessage(content, clientId, agentName) {
20731
20730
  return await commitSystemMessageInternal(content, clientId, agentName);
20732
20731
  }
20733
20732
 
20734
- const METHOD_NAME$O = "function.commit.commitSystemMessage";
20733
+ const METHOD_NAME$P = "function.commit.commitSystemMessage";
20735
20734
  /**
20736
20735
  * Function implementation
20737
20736
  */
20738
20737
  const commitUserMessageInternal = beginContext(async (content, mode, clientId, agentName, payload) => {
20739
20738
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
20740
20739
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20741
- swarm$1.loggerService.log(METHOD_NAME$O, {
20740
+ swarm$1.loggerService.log(METHOD_NAME$P, {
20742
20741
  content,
20743
20742
  clientId,
20744
20743
  agentName,
20745
20744
  mode,
20746
20745
  });
20747
20746
  // Validate the agent, session, and swarm to ensure they exist and are accessible
20748
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$O);
20749
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$O);
20747
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$P);
20748
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$P);
20750
20749
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
20751
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$O);
20750
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$P);
20752
20751
  // Check if the specified agent is still the active agent in the swarm session
20753
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$O, clientId, swarmName);
20752
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$P, clientId, swarmName);
20754
20753
  if (currentAgentName !== agentName) {
20755
20754
  // Log a skip message if the agent has changed during the operation
20756
20755
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
@@ -20763,14 +20762,14 @@ const commitUserMessageInternal = beginContext(async (content, mode, clientId, a
20763
20762
  }
20764
20763
  if (payload) {
20765
20764
  return await PayloadContextService.runInContext(async () => {
20766
- await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$O, clientId, swarmName);
20765
+ await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$P, clientId, swarmName);
20767
20766
  }, {
20768
20767
  clientId,
20769
20768
  payload,
20770
20769
  });
20771
20770
  }
20772
20771
  // Commit the user message to the agent's history via the session public service
20773
- return await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$O, clientId, swarmName);
20772
+ return await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$P, clientId, swarmName);
20774
20773
  });
20775
20774
  /**
20776
20775
  * Commits a user message to the active agent's history in a swarm session without triggering a response.
@@ -20792,24 +20791,24 @@ async function commitUserMessage(content, mode, clientId, agentName, payload) {
20792
20791
  }
20793
20792
 
20794
20793
  /** @private Constant defining the method name for logging and validation context */
20795
- const METHOD_NAME$N = "function.commit.commitSystemMessageForce";
20794
+ const METHOD_NAME$O = "function.commit.commitSystemMessageForce";
20796
20795
  /**
20797
20796
  * Function implementation
20798
20797
  */
20799
20798
  const commitSystemMessageForceInternal = beginContext(async (content, clientId) => {
20800
20799
  // Log the commit attempt if enabled
20801
20800
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20802
- swarm$1.loggerService.log(METHOD_NAME$N, {
20801
+ swarm$1.loggerService.log(METHOD_NAME$O, {
20803
20802
  content,
20804
20803
  clientId,
20805
20804
  });
20806
20805
  // Validate the session exists and retrieve the associated swarm
20807
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$N);
20806
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$O);
20808
20807
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
20809
20808
  // Validate the swarm configuration
20810
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$N);
20809
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$O);
20811
20810
  // Commit the system message via SessionPublicService without agent checks
20812
- await swarm$1.sessionPublicService.commitSystemMessage(content, METHOD_NAME$N, clientId, swarmName);
20811
+ await swarm$1.sessionPublicService.commitSystemMessage(content, METHOD_NAME$O, clientId, swarmName);
20813
20812
  });
20814
20813
  /**
20815
20814
  * Forcefully commits a system-generated message to a session in the swarm system, without checking the active agent.
@@ -20830,32 +20829,32 @@ async function commitSystemMessageForce(content, clientId) {
20830
20829
  return await commitSystemMessageForceInternal(content, clientId);
20831
20830
  }
20832
20831
 
20833
- const METHOD_NAME$M = "function.commit.commitSystemMessage";
20832
+ const METHOD_NAME$N = "function.commit.commitSystemMessage";
20834
20833
  /**
20835
20834
  * Function implementation
20836
20835
  */
20837
20836
  const commitUserMessageForceInternal = beginContext(async (content, mode, clientId, payload) => {
20838
20837
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
20839
20838
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20840
- swarm$1.loggerService.log(METHOD_NAME$M, {
20839
+ swarm$1.loggerService.log(METHOD_NAME$N, {
20841
20840
  content,
20842
20841
  clientId,
20843
20842
  mode,
20844
20843
  });
20845
20844
  // Validate the session and swarm to ensure they exist and are accessible
20846
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$M);
20845
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$N);
20847
20846
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
20848
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$M);
20847
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$N);
20849
20848
  if (payload) {
20850
20849
  return await PayloadContextService.runInContext(async () => {
20851
- await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$M, clientId, swarmName);
20850
+ await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$N, clientId, swarmName);
20852
20851
  }, {
20853
20852
  clientId,
20854
20853
  payload,
20855
20854
  });
20856
20855
  }
20857
20856
  // Commit the user message to the agent's history via the session public service without checking the active agent
20858
- return await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$M, clientId, swarmName);
20857
+ return await swarm$1.sessionPublicService.commitUserMessage(content, mode, METHOD_NAME$N, clientId, swarmName);
20859
20858
  });
20860
20859
  /**
20861
20860
  * Commits a user message to the active agent's history in a swarm session without triggering a response and without checking the active agent.
@@ -20876,27 +20875,27 @@ async function commitUserMessageForce(content, mode, clientId, payload) {
20876
20875
  }
20877
20876
 
20878
20877
  /** @private Constant defining the method name for logging and validation context */
20879
- const METHOD_NAME$L = "function.commit.commitAssistantMessage";
20878
+ const METHOD_NAME$M = "function.commit.commitAssistantMessage";
20880
20879
  /**
20881
20880
  * Function implementation
20882
20881
  */
20883
20882
  const commitAssistantMessageInternal = beginContext(async (content, clientId, agentName) => {
20884
20883
  // Log the commit attempt if enabled
20885
20884
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20886
- swarm$1.loggerService.log(METHOD_NAME$L, {
20885
+ swarm$1.loggerService.log(METHOD_NAME$M, {
20887
20886
  content,
20888
20887
  clientId,
20889
20888
  agentName,
20890
20889
  });
20891
20890
  // Validate the agent exists
20892
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$L);
20891
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$M);
20893
20892
  // Validate the session exists and retrieve the associated swarm
20894
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$L);
20893
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$M);
20895
20894
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
20896
20895
  // Validate the swarm configuration
20897
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$L);
20896
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$M);
20898
20897
  // Check if the current agent matches the provided agent
20899
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$L, clientId, swarmName);
20898
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$M, clientId, swarmName);
20900
20899
  if (currentAgentName !== agentName) {
20901
20900
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20902
20901
  swarm$1.loggerService.log('function "commitAssistantMessage" skipped due to the agent change', {
@@ -20907,7 +20906,7 @@ const commitAssistantMessageInternal = beginContext(async (content, clientId, ag
20907
20906
  return;
20908
20907
  }
20909
20908
  // Commit the assistant message via SessionPublicService
20910
- await swarm$1.sessionPublicService.commitAssistantMessage(content, METHOD_NAME$L, clientId, swarmName);
20909
+ await swarm$1.sessionPublicService.commitAssistantMessage(content, METHOD_NAME$M, clientId, swarmName);
20911
20910
  });
20912
20911
  /**
20913
20912
  * Commits an assistant-generated message to the active agent in the swarm system.
@@ -20928,24 +20927,24 @@ async function commitAssistantMessage(content, clientId, agentName) {
20928
20927
  }
20929
20928
 
20930
20929
  /** @private Constant defining the method name for logging and validation context */
20931
- const METHOD_NAME$K = "function.commit.commitAssistantMessageForce";
20930
+ const METHOD_NAME$L = "function.commit.commitAssistantMessageForce";
20932
20931
  /**
20933
20932
  * Function implementation
20934
20933
  */
20935
20934
  const commitAssistantMessageForceInternal = beginContext(async (content, clientId) => {
20936
20935
  // Log the commit attempt if enabled
20937
20936
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20938
- swarm$1.loggerService.log(METHOD_NAME$K, {
20937
+ swarm$1.loggerService.log(METHOD_NAME$L, {
20939
20938
  content,
20940
20939
  clientId,
20941
20940
  });
20942
20941
  // Validate the session exists and retrieve the associated swarm
20943
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$K);
20942
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$L);
20944
20943
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
20945
20944
  // Validate the swarm configuration
20946
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$K);
20945
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$L);
20947
20946
  // Commit the assistant message via SessionPublicService without agent checks
20948
- await swarm$1.sessionPublicService.commitAssistantMessage(content, METHOD_NAME$K, clientId, swarmName);
20947
+ await swarm$1.sessionPublicService.commitAssistantMessage(content, METHOD_NAME$L, clientId, swarmName);
20949
20948
  });
20950
20949
  /**
20951
20950
  * Forcefully commits an assistant-generated message to a session in the swarm system, without checking the active agent.
@@ -20967,26 +20966,26 @@ async function commitAssistantMessageForce(content, clientId) {
20967
20966
  }
20968
20967
 
20969
20968
  /** @private Constant defining the method name for logging and validation context */
20970
- const METHOD_NAME$J = "function.commit.cancelOutput";
20969
+ const METHOD_NAME$K = "function.commit.cancelOutput";
20971
20970
  /**
20972
20971
  * Function implementation
20973
20972
  */
20974
20973
  const cancelOutputInternal = beginContext(async (clientId, agentName) => {
20975
20974
  // Log the cancellation attempt if enabled
20976
20975
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20977
- swarm$1.loggerService.log(METHOD_NAME$J, {
20976
+ swarm$1.loggerService.log(METHOD_NAME$K, {
20978
20977
  clientId,
20979
20978
  agentName,
20980
20979
  });
20981
20980
  // Validate the agent exists
20982
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$J);
20981
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$K);
20983
20982
  // Validate the session exists and retrieve the associated swarm
20984
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$J);
20983
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$K);
20985
20984
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
20986
20985
  // Validate the swarm configuration
20987
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$J);
20986
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$K);
20988
20987
  // Check if the current agent matches the provided agent
20989
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$J, clientId, swarmName);
20988
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$K, clientId, swarmName);
20990
20989
  if (currentAgentName !== agentName) {
20991
20990
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20992
20991
  swarm$1.loggerService.log('function "cancelOutput" skipped due to the agent change', {
@@ -20997,7 +20996,7 @@ const cancelOutputInternal = beginContext(async (clientId, agentName) => {
20997
20996
  return;
20998
20997
  }
20999
20998
  // Perform the output cancellation via SwarmPublicService
21000
- await swarm$1.swarmPublicService.cancelOutput(METHOD_NAME$J, clientId, swarmName);
20999
+ await swarm$1.swarmPublicService.cancelOutput(METHOD_NAME$K, clientId, swarmName);
21001
21000
  });
21002
21001
  /**
21003
21002
  * Cancels the awaited output for a specific client and agent by emitting an empty string.
@@ -21016,23 +21015,23 @@ async function cancelOutput(clientId, agentName) {
21016
21015
  }
21017
21016
 
21018
21017
  /** @private Constant defining the method name for logging and validation context */
21019
- const METHOD_NAME$I = "function.commit.cancelOutputForce";
21018
+ const METHOD_NAME$J = "function.commit.cancelOutputForce";
21020
21019
  /**
21021
21020
  * Function implementation
21022
21021
  */
21023
21022
  const cancelOutputForceInternal = beginContext(async (clientId) => {
21024
21023
  // Log the cancellation attempt if enabled
21025
21024
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21026
- swarm$1.loggerService.log(METHOD_NAME$I, {
21025
+ swarm$1.loggerService.log(METHOD_NAME$J, {
21027
21026
  clientId,
21028
21027
  });
21029
21028
  // Validate the session exists and retrieve the associated swarm
21030
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$I);
21029
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$J);
21031
21030
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
21032
21031
  // Validate the swarm configuration
21033
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$I);
21032
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$J);
21034
21033
  // Perform the output cancellation via SwarmPublicService without agent checks
21035
- await swarm$1.swarmPublicService.cancelOutput(METHOD_NAME$I, clientId, swarmName);
21034
+ await swarm$1.swarmPublicService.cancelOutput(METHOD_NAME$J, clientId, swarmName);
21036
21035
  });
21037
21036
  /**
21038
21037
  * Forcefully cancels the awaited output for a specific client by emitting an empty string, without checking the active agent.
@@ -21051,22 +21050,22 @@ async function cancelOutputForce(clientId) {
21051
21050
  return await cancelOutputForceInternal(clientId);
21052
21051
  }
21053
21052
 
21054
- const METHOD_NAME$H = "function.commit.commitToolRequest";
21053
+ const METHOD_NAME$I = "function.commit.commitToolRequest";
21055
21054
  /**
21056
21055
  * Function implementation
21057
21056
  */
21058
21057
  const commitToolRequestInternal = beginContext(async (request, clientId, agentName) => {
21059
21058
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21060
- swarm$1.loggerService.log(METHOD_NAME$H, {
21059
+ swarm$1.loggerService.log(METHOD_NAME$I, {
21061
21060
  request,
21062
21061
  clientId,
21063
21062
  agentName,
21064
21063
  });
21065
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$H);
21066
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$H);
21064
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$I);
21065
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$I);
21067
21066
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
21068
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$H);
21069
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$H, clientId, swarmName);
21067
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$I);
21068
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$I, clientId, swarmName);
21070
21069
  if (currentAgentName !== agentName) {
21071
21070
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21072
21071
  swarm$1.loggerService.log('function "commitToolRequest" skipped due to the agent change', {
@@ -21076,7 +21075,7 @@ const commitToolRequestInternal = beginContext(async (request, clientId, agentNa
21076
21075
  });
21077
21076
  return null;
21078
21077
  }
21079
- return await swarm$1.sessionPublicService.commitToolRequest(Array.isArray(request) ? request : [request], METHOD_NAME$H, clientId, swarmName);
21078
+ return await swarm$1.sessionPublicService.commitToolRequest(Array.isArray(request) ? request : [request], METHOD_NAME$I, clientId, swarmName);
21080
21079
  });
21081
21080
  /**
21082
21081
  * Commits a tool request to the active agent in the swarm system.
@@ -21092,21 +21091,21 @@ async function commitToolRequest(request, clientId, agentName) {
21092
21091
  return await commitToolRequestInternal(request, clientId, agentName);
21093
21092
  }
21094
21093
 
21095
- const METHOD_NAME$G = "function.commit.commitToolRequestForce";
21094
+ const METHOD_NAME$H = "function.commit.commitToolRequestForce";
21096
21095
  /**
21097
21096
  * Function implementation
21098
21097
  */
21099
21098
  const commitToolRequestForceInternal = beginContext(async (request, clientId) => {
21100
21099
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21101
- swarm$1.loggerService.log(METHOD_NAME$G, {
21100
+ swarm$1.loggerService.log(METHOD_NAME$H, {
21102
21101
  request,
21103
21102
  clientId,
21104
21103
  });
21105
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$G);
21104
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$H);
21106
21105
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
21107
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$G);
21106
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$H);
21108
21107
  const requests = Array.isArray(request) ? request : [request];
21109
- return await swarm$1.sessionPublicService.commitToolRequest(requests, METHOD_NAME$G, clientId, swarmName);
21108
+ return await swarm$1.sessionPublicService.commitToolRequest(requests, METHOD_NAME$H, clientId, swarmName);
21110
21109
  });
21111
21110
  /**
21112
21111
  * Forcefully commits a tool request to the active agent in the swarm system.
@@ -21123,27 +21122,27 @@ async function commitToolRequestForce(request, clientId) {
21123
21122
  }
21124
21123
 
21125
21124
  /** @constant {string} METHOD_NAME - The name of the method used for logging and validation */
21126
- const METHOD_NAME$F = "function.target.question";
21125
+ const METHOD_NAME$G = "function.target.question";
21127
21126
  /**
21128
21127
  * Function implementation
21129
21128
  */
21130
21129
  const questionInternal = beginContext(async (message, clientId, agentName, wikiName) => {
21131
21130
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21132
- swarm$1.loggerService.log(METHOD_NAME$F, {
21131
+ swarm$1.loggerService.log(METHOD_NAME$G, {
21133
21132
  message,
21134
21133
  clientId,
21135
21134
  agentName,
21136
21135
  wikiName,
21137
21136
  });
21138
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$F);
21139
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$F);
21137
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$G);
21138
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$G);
21140
21139
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
21141
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$F);
21142
- swarm$1.wikiValidationService.validate(wikiName, METHOD_NAME$F);
21140
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$G);
21141
+ swarm$1.wikiValidationService.validate(wikiName, METHOD_NAME$G);
21143
21142
  if (!swarm$1.agentValidationService.hasWiki(agentName, wikiName)) {
21144
- throw new Error(`agent-swarm ${METHOD_NAME$F} ${wikiName} not registered in ${agentName}`);
21143
+ throw new Error(`agent-swarm ${METHOD_NAME$G} ${wikiName} not registered in ${agentName}`);
21145
21144
  }
21146
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$F, clientId, swarmName);
21145
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$G, clientId, swarmName);
21147
21146
  if (currentAgentName !== agentName) {
21148
21147
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21149
21148
  swarm$1.loggerService.log('function "question" skipped due to the agent change', {
@@ -21178,23 +21177,23 @@ async function question(message, clientId, agentName, wikiName) {
21178
21177
  }
21179
21178
 
21180
21179
  /** @constant {string} METHOD_NAME - The name of the method used for logging and validation */
21181
- const METHOD_NAME$E = "function.target.questionForce";
21180
+ const METHOD_NAME$F = "function.target.questionForce";
21182
21181
  /**
21183
21182
  * Function implementation
21184
21183
  */
21185
21184
  const questionForceInternal = beginContext(async (message, clientId, wikiName) => {
21186
21185
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21187
- swarm$1.loggerService.log(METHOD_NAME$E, {
21186
+ swarm$1.loggerService.log(METHOD_NAME$F, {
21188
21187
  message,
21189
21188
  clientId,
21190
21189
  wikiName,
21191
21190
  });
21192
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$E);
21191
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$F);
21193
21192
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
21194
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$E);
21195
- swarm$1.wikiValidationService.validate(wikiName, METHOD_NAME$E);
21193
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$F);
21194
+ swarm$1.wikiValidationService.validate(wikiName, METHOD_NAME$F);
21196
21195
  const { getChat, callbacks } = swarm$1.wikiSchemaService.get(wikiName);
21197
- const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$E, clientId, swarmName);
21196
+ const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$F, clientId, swarmName);
21198
21197
  const args = {
21199
21198
  clientId,
21200
21199
  message,
@@ -21217,7 +21216,7 @@ async function questionForce(message, clientId, wikiName) {
21217
21216
  return await questionForceInternal(message, clientId, wikiName);
21218
21217
  }
21219
21218
 
21220
- const METHOD_NAME$D = "function.target.json";
21219
+ const METHOD_NAME$E = "function.target.json";
21221
21220
  const MAX_ATTEMPTS = 5;
21222
21221
  /**
21223
21222
  * A class implementing the IOutlineHistory interface to manage a history of outline messages.
@@ -21268,11 +21267,11 @@ class OutlineHistory {
21268
21267
  */
21269
21268
  const jsonInternal = beginContext(async (outlineName, param) => {
21270
21269
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21271
- swarm$1.loggerService.log(METHOD_NAME$D, {});
21272
- swarm$1.outlineValidationService.validate(outlineName, METHOD_NAME$D);
21270
+ swarm$1.loggerService.log(METHOD_NAME$E, {});
21271
+ swarm$1.outlineValidationService.validate(outlineName, METHOD_NAME$E);
21273
21272
  const resultId = functoolsKit.randomString();
21274
21273
  const { getOutlineHistory, completion, validations = [], maxAttempts = MAX_ATTEMPTS, format, prompt, system, callbacks: outlineCallbacks, } = swarm$1.outlineSchemaService.get(outlineName);
21275
- swarm$1.completionValidationService.validate(completion, METHOD_NAME$D);
21274
+ swarm$1.completionValidationService.validate(completion, METHOD_NAME$E);
21276
21275
  const { getCompletion, flags = [], callbacks: completionCallbacks, } = swarm$1.completionSchemaService.get(completion);
21277
21276
  let errorMessage = "";
21278
21277
  let history;
@@ -21388,7 +21387,7 @@ async function json(outlineName, param = {}) {
21388
21387
  return await jsonInternal(outlineName, param);
21389
21388
  }
21390
21389
 
21391
- const METHOD_NAME$C = "function.target.disposeConnection";
21390
+ const METHOD_NAME$D = "function.target.disposeConnection";
21392
21391
  /**
21393
21392
  * Disposes of a client session and all related resources within a swarm.
21394
21393
  *
@@ -21405,10 +21404,10 @@ const METHOD_NAME$C = "function.target.disposeConnection";
21405
21404
  * @example
21406
21405
  * await disposeConnection("client-123", "TaskSwarm");
21407
21406
  */
21408
- const disposeConnection = beginContext(async (clientId, swarmName, methodName = METHOD_NAME$C) => {
21407
+ const disposeConnection = beginContext(async (clientId, swarmName, methodName = METHOD_NAME$D) => {
21409
21408
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
21410
21409
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21411
- swarm$1.loggerService.log(METHOD_NAME$C, {
21410
+ swarm$1.loggerService.log(METHOD_NAME$D, {
21412
21411
  clientId,
21413
21412
  swarmName,
21414
21413
  });
@@ -21514,7 +21513,7 @@ const disposeConnection = beginContext(async (clientId, swarmName, methodName =
21514
21513
  PersistMemoryAdapter.dispose(clientId);
21515
21514
  });
21516
21515
 
21517
- const METHOD_NAME$B = "function.target.makeAutoDispose";
21516
+ const METHOD_NAME$C = "function.target.makeAutoDispose";
21518
21517
  /**
21519
21518
  * Default timeout in seconds before auto-dispose is triggered.
21520
21519
  * @constant {number}
@@ -21545,7 +21544,7 @@ const DEFAULT_TIMEOUT = 15 * 60;
21545
21544
  const makeAutoDispose = beginContext((clientId, swarmName, { timeoutSeconds = DEFAULT_TIMEOUT, onDestroy, } = {}) => {
21546
21545
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
21547
21546
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21548
- swarm$1.loggerService.log(METHOD_NAME$B, {
21547
+ swarm$1.loggerService.log(METHOD_NAME$C, {
21549
21548
  clientId,
21550
21549
  swarmName,
21551
21550
  });
@@ -21578,30 +21577,30 @@ const makeAutoDispose = beginContext((clientId, swarmName, { timeoutSeconds = DE
21578
21577
  };
21579
21578
  });
21580
21579
 
21581
- const METHOD_NAME$A = "function.target.notify";
21580
+ const METHOD_NAME$B = "function.target.notify";
21582
21581
  /**
21583
21582
  * Function implementation
21584
21583
  */
21585
21584
  const notifyInternal = beginContext(async (content, clientId, agentName) => {
21586
21585
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
21587
21586
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21588
- swarm$1.loggerService.log(METHOD_NAME$A, {
21587
+ swarm$1.loggerService.log(METHOD_NAME$B, {
21589
21588
  content,
21590
21589
  clientId,
21591
21590
  agentName,
21592
21591
  });
21593
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$A);
21592
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$B);
21594
21593
  // Check if the session mode is "makeConnection"
21595
21594
  if (swarm$1.sessionValidationService.getSessionMode(clientId) !==
21596
21595
  "makeConnection") {
21597
21596
  throw new Error(`agent-swarm-kit notify session is not makeConnection clientId=${clientId}`);
21598
21597
  }
21599
21598
  // Validate the agent, session, and swarm
21600
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$A);
21599
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$B);
21601
21600
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
21602
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$A);
21601
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$B);
21603
21602
  // Check if the specified agent is still the active agent
21604
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$A, clientId, swarmName);
21603
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$B, clientId, swarmName);
21605
21604
  if (currentAgentName !== agentName) {
21606
21605
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21607
21606
  swarm$1.loggerService.log('function "notify" skipped due to the agent change', {
@@ -21612,7 +21611,7 @@ const notifyInternal = beginContext(async (content, clientId, agentName) => {
21612
21611
  return;
21613
21612
  }
21614
21613
  // Notify the content directly via the session public service
21615
- return await swarm$1.sessionPublicService.notify(content, METHOD_NAME$A, clientId, swarmName);
21614
+ return await swarm$1.sessionPublicService.notify(content, METHOD_NAME$B, clientId, swarmName);
21616
21615
  });
21617
21616
  /**
21618
21617
  * Sends a notification message as output from the swarm session without executing an incoming message.
@@ -21634,18 +21633,18 @@ async function notify(content, clientId, agentName) {
21634
21633
  return await notifyInternal(content, clientId, agentName);
21635
21634
  }
21636
21635
 
21637
- const METHOD_NAME$z = "function.target.notifyForce";
21636
+ const METHOD_NAME$A = "function.target.notifyForce";
21638
21637
  /**
21639
21638
  * Function implementation
21640
21639
  */
21641
21640
  const notifyForceInternal = beginContext(async (content, clientId) => {
21642
21641
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
21643
21642
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21644
- swarm$1.loggerService.log(METHOD_NAME$z, {
21643
+ swarm$1.loggerService.log(METHOD_NAME$A, {
21645
21644
  content,
21646
21645
  clientId,
21647
21646
  });
21648
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$z);
21647
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$A);
21649
21648
  // Check if the session mode is "makeConnection"
21650
21649
  if (swarm$1.sessionValidationService.getSessionMode(clientId) !==
21651
21650
  "makeConnection") {
@@ -21653,9 +21652,9 @@ const notifyForceInternal = beginContext(async (content, clientId) => {
21653
21652
  }
21654
21653
  // Validate the agent, session, and swarm
21655
21654
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
21656
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$z);
21655
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$A);
21657
21656
  // Notify the content directly via the session public service
21658
- return await swarm$1.sessionPublicService.notify(content, METHOD_NAME$z, clientId, swarmName);
21657
+ return await swarm$1.sessionPublicService.notify(content, METHOD_NAME$A, clientId, swarmName);
21659
21658
  });
21660
21659
  /**
21661
21660
  * Sends a notification message as output from the swarm session without executing an incoming message.
@@ -21676,7 +21675,7 @@ async function notifyForce(content, clientId) {
21676
21675
  return await notifyForceInternal(content, clientId);
21677
21676
  }
21678
21677
 
21679
- const METHOD_NAME$y = "function.target.runStateless";
21678
+ const METHOD_NAME$z = "function.target.runStateless";
21680
21679
  /**
21681
21680
  * Function implementation
21682
21681
  */
@@ -21684,19 +21683,19 @@ const runStatelessInternal = beginContext(async (content, clientId, agentName) =
21684
21683
  const executionId = functoolsKit.randomString();
21685
21684
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
21686
21685
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21687
- swarm$1.loggerService.log(METHOD_NAME$y, {
21686
+ swarm$1.loggerService.log(METHOD_NAME$z, {
21688
21687
  content,
21689
21688
  clientId,
21690
21689
  agentName,
21691
21690
  executionId,
21692
21691
  });
21693
21692
  // Validate the agent, session, and swarm
21694
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$y);
21695
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$y);
21693
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$z);
21694
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$z);
21696
21695
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
21697
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$y);
21696
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$z);
21698
21697
  // Check if the specified agent is still the active agent
21699
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$y, clientId, swarmName);
21698
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$z, clientId, swarmName);
21700
21699
  if (currentAgentName !== agentName) {
21701
21700
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21702
21701
  swarm$1.loggerService.log('function "runStateless" skipped due to the agent change', {
@@ -21715,7 +21714,7 @@ const runStatelessInternal = beginContext(async (content, clientId, agentName) =
21715
21714
  agentName,
21716
21715
  swarmName,
21717
21716
  });
21718
- const result = await swarm$1.sessionPublicService.run(content, METHOD_NAME$y, clientId, swarmName);
21717
+ const result = await swarm$1.sessionPublicService.run(content, METHOD_NAME$z, clientId, swarmName);
21719
21718
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
21720
21719
  swarm$1.busService.commitExecutionEnd(clientId, {
21721
21720
  agentName,
@@ -21757,7 +21756,7 @@ async function runStateless(content, clientId, agentName) {
21757
21756
  return await runStatelessInternal(content, clientId, agentName);
21758
21757
  }
21759
21758
 
21760
- const METHOD_NAME$x = "function.target.runStatelessForce";
21759
+ const METHOD_NAME$y = "function.target.runStatelessForce";
21761
21760
  /**
21762
21761
  * Function implementation
21763
21762
  */
@@ -21765,22 +21764,22 @@ const runStatelessForceInternal = beginContext(async (content, clientId) => {
21765
21764
  const executionId = functoolsKit.randomString();
21766
21765
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
21767
21766
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21768
- swarm$1.loggerService.log(METHOD_NAME$x, {
21767
+ swarm$1.loggerService.log(METHOD_NAME$y, {
21769
21768
  content,
21770
21769
  clientId,
21771
21770
  executionId,
21772
21771
  });
21773
21772
  // Validate the session and swarm
21774
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$x);
21773
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$y);
21775
21774
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
21776
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$x);
21775
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$y);
21777
21776
  // Execute the command statelessly within an execution context with performance tracking
21778
21777
  return ExecutionContextService.runInContext(async () => {
21779
21778
  let isFinished = false;
21780
21779
  swarm$1.perfService.startExecution(executionId, clientId, content.length);
21781
21780
  try {
21782
21781
  swarm$1.busService.commitExecutionBegin(clientId, { swarmName });
21783
- const result = await swarm$1.sessionPublicService.run(content, METHOD_NAME$x, clientId, swarmName);
21782
+ const result = await swarm$1.sessionPublicService.run(content, METHOD_NAME$y, clientId, swarmName);
21784
21783
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
21785
21784
  swarm$1.busService.commitExecutionEnd(clientId, { swarmName });
21786
21785
  return result;
@@ -21827,7 +21826,7 @@ const SCHEDULED_DELAY$1 = 1000;
21827
21826
  * @constant {number}
21828
21827
  */
21829
21828
  const RATE_DELAY = 10000;
21830
- const METHOD_NAME$w = "function.target.makeConnection";
21829
+ const METHOD_NAME$x = "function.target.makeConnection";
21831
21830
  /**
21832
21831
  * Internal implementation of the connection factory for a client to a swarm.
21833
21832
  *
@@ -21842,21 +21841,21 @@ const METHOD_NAME$w = "function.target.makeConnection";
21842
21841
  const makeConnectionInternal = (connector, clientId, swarmName) => {
21843
21842
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
21844
21843
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
21845
- swarm$1.loggerService.log(METHOD_NAME$w, {
21844
+ swarm$1.loggerService.log(METHOD_NAME$x, {
21846
21845
  clientId,
21847
21846
  swarmName,
21848
21847
  });
21849
21848
  // Validate the swarm and initialize the session
21850
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$w);
21849
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$x);
21851
21850
  swarm$1.sessionValidationService.addSession(clientId, swarmName, "makeConnection");
21852
21851
  // Create a queued send function using the session public service
21853
- const send = functoolsKit.queued(swarm$1.sessionPublicService.connect(connector, METHOD_NAME$w, clientId, swarmName));
21852
+ const send = functoolsKit.queued(swarm$1.sessionPublicService.connect(connector, METHOD_NAME$x, clientId, swarmName));
21854
21853
  // Return a wrapped send function with validation and agent context
21855
21854
  return (async (outgoing) => {
21856
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$w);
21855
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$x);
21857
21856
  return await send({
21858
21857
  data: outgoing,
21859
- agentName: await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$w, clientId, swarmName),
21858
+ agentName: await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$x, clientId, swarmName),
21860
21859
  clientId,
21861
21860
  });
21862
21861
  });
@@ -21939,13 +21938,13 @@ makeConnection.scheduled = (connector, clientId, swarmName, { delay = SCHEDULED_
21939
21938
  await online();
21940
21939
  if (payload) {
21941
21940
  return await PayloadContextService.runInContext(async () => {
21942
- await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$w, clientId, swarmName);
21941
+ await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$x, clientId, swarmName);
21943
21942
  }, {
21944
21943
  clientId,
21945
21944
  payload,
21946
21945
  });
21947
21946
  }
21948
- await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$w, clientId, swarmName);
21947
+ await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$x, clientId, swarmName);
21949
21948
  }),
21950
21949
  delay,
21951
21950
  });
@@ -22008,7 +22007,7 @@ makeConnection.rate = (connector, clientId, swarmName, { delay = RATE_DELAY } =
22008
22007
  };
22009
22008
  };
22010
22009
 
22011
- const METHOD_NAME$v = "function.target.complete";
22010
+ const METHOD_NAME$w = "function.target.complete";
22012
22011
  /**
22013
22012
  * Creates a complete function with time-to-live (TTL) and queuing capabilities.
22014
22013
  *
@@ -22061,7 +22060,7 @@ const complete = beginContext(async (content, clientId, swarmName, payload = nul
22061
22060
  const executionId = functoolsKit.randomString();
22062
22061
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
22063
22062
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22064
- swarm$1.loggerService.log(METHOD_NAME$v, {
22063
+ swarm$1.loggerService.log(METHOD_NAME$w, {
22065
22064
  content,
22066
22065
  clientId,
22067
22066
  executionId,
@@ -22079,7 +22078,7 @@ const complete = beginContext(async (content, clientId, swarmName, payload = nul
22079
22078
  swarm$1.navigationValidationService.beginMonit(clientId, swarmName);
22080
22079
  try {
22081
22080
  swarm$1.busService.commitExecutionBegin(clientId, { swarmName });
22082
- const result = await run(METHOD_NAME$v, content);
22081
+ const result = await run(METHOD_NAME$w, content);
22083
22082
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
22084
22083
  swarm$1.busService.commitExecutionEnd(clientId, { swarmName });
22085
22084
  return result;
@@ -22110,7 +22109,7 @@ const complete = beginContext(async (content, clientId, swarmName, payload = nul
22110
22109
  * @constant {number}
22111
22110
  */
22112
22111
  const SCHEDULED_DELAY = 1000;
22113
- const METHOD_NAME$u = "function.target.session";
22112
+ const METHOD_NAME$v = "function.target.session";
22114
22113
  /**
22115
22114
  * Internal implementation of the session factory for a client and swarm.
22116
22115
  *
@@ -22125,23 +22124,23 @@ const sessionInternal = (clientId, swarmName, { onDispose = () => { } } = {}) =>
22125
22124
  const executionId = functoolsKit.randomString();
22126
22125
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
22127
22126
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22128
- swarm$1.loggerService.log(METHOD_NAME$u, {
22127
+ swarm$1.loggerService.log(METHOD_NAME$v, {
22129
22128
  clientId,
22130
22129
  swarmName,
22131
22130
  executionId,
22132
22131
  });
22133
22132
  // Validate the swarm and initialize the session
22134
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$u);
22133
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$v);
22135
22134
  swarm$1.sessionValidationService.addSession(clientId, swarmName, "session");
22136
22135
  const complete = functoolsKit.queued(async (content) => {
22137
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$u);
22136
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$v);
22138
22137
  return ExecutionContextService.runInContext(async () => {
22139
22138
  let isFinished = false;
22140
22139
  swarm$1.perfService.startExecution(executionId, clientId, content.length);
22141
22140
  swarm$1.navigationValidationService.beginMonit(clientId, swarmName);
22142
22141
  try {
22143
22142
  swarm$1.busService.commitExecutionBegin(clientId, { swarmName });
22144
- const result = await swarm$1.sessionPublicService.execute(content, "user", METHOD_NAME$u, clientId, swarmName);
22143
+ const result = await swarm$1.sessionPublicService.execute(content, "user", METHOD_NAME$v, clientId, swarmName);
22145
22144
  isFinished = swarm$1.perfService.endExecution(executionId, clientId, result.length);
22146
22145
  swarm$1.busService.commitExecutionEnd(clientId, { swarmName });
22147
22146
  return result;
@@ -22163,7 +22162,7 @@ const sessionInternal = (clientId, swarmName, { onDispose = () => { } } = {}) =>
22163
22162
  return await complete(content);
22164
22163
  }),
22165
22164
  dispose: async () => {
22166
- await disposeConnection(clientId, swarmName, METHOD_NAME$u);
22165
+ await disposeConnection(clientId, swarmName, METHOD_NAME$v);
22167
22166
  await onDispose();
22168
22167
  },
22169
22168
  };
@@ -22263,13 +22262,13 @@ session.scheduled = (clientId, swarmName, { delay = SCHEDULED_DELAY, onDispose }
22263
22262
  await online();
22264
22263
  if (payload) {
22265
22264
  return await PayloadContextService.runInContext(async () => {
22266
- return await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$u, clientId, swarmName);
22265
+ return await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$v, clientId, swarmName);
22267
22266
  }, {
22268
22267
  clientId,
22269
22268
  payload,
22270
22269
  });
22271
22270
  }
22272
- return await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$u, clientId, swarmName);
22271
+ return await swarm$1.sessionPublicService.commitUserMessage(content, "user", METHOD_NAME$v, clientId, swarmName);
22273
22272
  }),
22274
22273
  delay,
22275
22274
  });
@@ -22357,13 +22356,13 @@ session.rate = (clientId, swarmName, { delay = SCHEDULED_DELAY, onDispose } = {}
22357
22356
  * @description Method name for the scope operation.
22358
22357
  * @private
22359
22358
  */
22360
- const METHOD_NAME$t = "function.target.fork";
22359
+ const METHOD_NAME$u = "function.target.fork";
22361
22360
  /**
22362
22361
  * Function implementation
22363
22362
  */
22364
22363
  const forkInternal = beginContext(async (runFn, { clientId, swarmName, onError }) => {
22365
22364
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22366
- swarm$1.loggerService.log(METHOD_NAME$t, {
22365
+ swarm$1.loggerService.log(METHOD_NAME$u, {
22367
22366
  clientId,
22368
22367
  swarmName,
22369
22368
  });
@@ -22371,9 +22370,9 @@ const forkInternal = beginContext(async (runFn, { clientId, swarmName, onError }
22371
22370
  throw new Error(`agent-swarm scope Session already exists for clientId=${clientId}`);
22372
22371
  }
22373
22372
  swarm$1.sessionValidationService.addSession(clientId, swarmName, "scope");
22374
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$t);
22375
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$t);
22376
- const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$t, clientId, swarmName);
22373
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$u);
22374
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$u);
22375
+ const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$u, clientId, swarmName);
22377
22376
  let result = null;
22378
22377
  try {
22379
22378
  result = (await runFn(clientId, agentName));
@@ -22383,7 +22382,7 @@ const forkInternal = beginContext(async (runFn, { clientId, swarmName, onError }
22383
22382
  onError && onError(error);
22384
22383
  }
22385
22384
  finally {
22386
- await disposeConnection(clientId, swarmName, METHOD_NAME$t);
22385
+ await disposeConnection(clientId, swarmName, METHOD_NAME$u);
22387
22386
  }
22388
22387
  return result;
22389
22388
  });
@@ -22408,12 +22407,12 @@ async function fork(runFn, options) {
22408
22407
  * @description Method name for the scope operation.
22409
22408
  * @private
22410
22409
  */
22411
- const METHOD_NAME$s = "function.target.scope";
22410
+ const METHOD_NAME$t = "function.target.scope";
22412
22411
  /**
22413
22412
  * Function implementation
22414
22413
  */
22415
22414
  const scopeInternal = beginContext(async (runFn, { agentSchemaService = swarm$1.agentSchemaService.registry, completionSchemaService = swarm$1.completionSchemaService.registry, computeSchemaService = swarm$1.computeSchemaService.registry, embeddingSchemaService = swarm$1.embeddingSchemaService.registry, mcpSchemaService = swarm$1.mcpSchemaService.registry, pipelineSchemaService = swarm$1.pipelineSchemaService.registry, policySchemaService = swarm$1.policySchemaService.registry, stateSchemaService = swarm$1.stateSchemaService.registry, storageSchemaService = swarm$1.storageSchemaService.registry, swarmSchemaService = swarm$1.swarmSchemaService.registry, toolSchemaService = swarm$1.toolSchemaService.registry, wikiSchemaService = swarm$1.wikiSchemaService.registry, outlineSchemaService = swarm$1.outlineSchemaService.registry, } = {}) => {
22416
- GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$s);
22415
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG && swarm$1.loggerService.log(METHOD_NAME$t);
22417
22416
  return await SchemaContextService.runInContext(runFn, {
22418
22417
  registry: {
22419
22418
  agentSchemaService,
@@ -22452,20 +22451,20 @@ async function scope(runFn, options) {
22452
22451
  * @description Method name for the startPipeline operation.
22453
22452
  * @private
22454
22453
  */
22455
- const METHOD_NAME$r = "function.target.startPipeline";
22454
+ const METHOD_NAME$s = "function.target.startPipeline";
22456
22455
  /**
22457
22456
  * Function implementation
22458
22457
  */
22459
22458
  const startPipelineInternal = beginContext(async (clientId, pipelineName, agentName, payload = {}) => {
22460
22459
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22461
- swarm$1.loggerService.log(METHOD_NAME$r, {
22460
+ swarm$1.loggerService.log(METHOD_NAME$s, {
22462
22461
  clientId,
22463
22462
  pipelineName,
22464
22463
  });
22465
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$r);
22466
- swarm$1.pipelineValidationService.validate(pipelineName, METHOD_NAME$r);
22467
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$r);
22468
- const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$r, clientId, await swarm$1.sessionValidationService.getSwarm(clientId));
22464
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$s);
22465
+ swarm$1.pipelineValidationService.validate(pipelineName, METHOD_NAME$s);
22466
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$s);
22467
+ const currentAgentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$s, clientId, await swarm$1.sessionValidationService.getSwarm(clientId));
22469
22468
  if (currentAgentName !== agentName) {
22470
22469
  await changeToAgent(agentName, clientId);
22471
22470
  }
@@ -22510,13 +22509,13 @@ async function startPipeline(clientId, pipelineName, agentName, payload) {
22510
22509
  }
22511
22510
 
22512
22511
  /** @private Constant defining the method name for logging purposes */
22513
- const METHOD_NAME$q = "function.common.hasSession";
22512
+ const METHOD_NAME$r = "function.common.hasSession";
22514
22513
  /**
22515
22514
  * Function implementation
22516
22515
  */
22517
22516
  const hasSessionInternal = (clientId) => {
22518
22517
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22519
- swarm$1.loggerService.log(METHOD_NAME$q, { clientId });
22518
+ swarm$1.loggerService.log(METHOD_NAME$r, { clientId });
22520
22519
  return swarm$1.sessionValidationService.hasSession(clientId);
22521
22520
  };
22522
22521
  /**
@@ -22532,22 +22531,22 @@ function hasSession(clientId) {
22532
22531
  return hasSessionInternal(clientId);
22533
22532
  }
22534
22533
 
22535
- const METHOD_NAME$p = "function.common.getCheckBusy";
22534
+ const METHOD_NAME$q = "function.common.getCheckBusy";
22536
22535
  /**
22537
22536
  * Function implementation
22538
22537
  */
22539
22538
  const getCheckBusyInternal = beginContext(async (clientId) => {
22540
22539
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22541
- swarm$1.loggerService.log(METHOD_NAME$p, {
22540
+ swarm$1.loggerService.log(METHOD_NAME$q, {
22542
22541
  clientId,
22543
22542
  });
22544
22543
  if (!swarm$1.sessionValidationService.hasSession(clientId)) {
22545
22544
  return false;
22546
22545
  }
22547
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$p);
22546
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$q);
22548
22547
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
22549
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$p);
22550
- return await swarm$1.swarmPublicService.getCheckBusy(METHOD_NAME$p, clientId, swarmName);
22548
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$q);
22549
+ return await swarm$1.swarmPublicService.getCheckBusy(METHOD_NAME$q, clientId, swarmName);
22551
22550
  });
22552
22551
  /**
22553
22552
  * Checks if the swarm associated with the given client ID is currently busy.
@@ -22559,27 +22558,27 @@ async function getCheckBusy(clientId) {
22559
22558
  return await getCheckBusyInternal(clientId);
22560
22559
  }
22561
22560
 
22562
- const METHOD_NAME$o = "function.common.getAgentHistory";
22561
+ const METHOD_NAME$p = "function.common.getAgentHistory";
22563
22562
  /**
22564
22563
  * Function implementation
22565
22564
  */
22566
22565
  const getAgentHistoryInternal = beginContext(async (clientId, agentName) => {
22567
22566
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
22568
22567
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22569
- swarm$1.loggerService.log(METHOD_NAME$o, {
22568
+ swarm$1.loggerService.log(METHOD_NAME$p, {
22570
22569
  clientId,
22571
22570
  agentName,
22572
22571
  });
22573
22572
  // Validate the session and agent to ensure they exist and are accessible
22574
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$o);
22575
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$o);
22573
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$p);
22574
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$p);
22576
22575
  // Retrieve the agent's prompt configuration from the agent schema service
22577
22576
  const { prompt: upperPrompt } = swarm$1.agentSchemaService.get(agentName);
22578
22577
  const prompt = typeof upperPrompt === "string"
22579
22578
  ? upperPrompt
22580
22579
  : await upperPrompt(clientId, agentName);
22581
22580
  // Fetch the agent's history using the prompt and rescue tweaks via the history public service
22582
- const history = await swarm$1.historyPublicService.toArrayForAgent(prompt, METHOD_NAME$o, clientId, agentName);
22581
+ const history = await swarm$1.historyPublicService.toArrayForAgent(prompt, METHOD_NAME$p, clientId, agentName);
22583
22582
  // Return a shallow copy of the history array
22584
22583
  return [...history];
22585
22584
  });
@@ -22602,17 +22601,17 @@ async function getAgentHistory(clientId, agentName) {
22602
22601
  return await getAgentHistoryInternal(clientId, agentName);
22603
22602
  }
22604
22603
 
22605
- const METHOD_NAME$n = "function.common.getSessionMode";
22604
+ const METHOD_NAME$o = "function.common.getSessionMode";
22606
22605
  const getSessionModeInternal = beginContext(async (clientId) => {
22607
22606
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
22608
22607
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22609
- swarm$1.loggerService.log(METHOD_NAME$n, {
22608
+ swarm$1.loggerService.log(METHOD_NAME$o, {
22610
22609
  clientId,
22611
22610
  });
22612
22611
  // Validate the session and swarm to ensure they exist and are accessible
22613
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$n);
22612
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$o);
22614
22613
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
22615
- swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$n);
22614
+ swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME$o);
22616
22615
  // Retrieve the session mode from the session validation service
22617
22616
  return swarm$1.sessionValidationService.getSessionMode(clientId);
22618
22617
  });
@@ -22634,14 +22633,14 @@ async function getSessionMode(clientId) {
22634
22633
  return await getSessionModeInternal(clientId);
22635
22634
  }
22636
22635
 
22637
- const METHOD_NAME$m = "function.common.getSessionContext";
22636
+ const METHOD_NAME$n = "function.common.getSessionContext";
22638
22637
  /**
22639
22638
  * Function implementation
22640
22639
  */
22641
22640
  const getSessionContextInternal = async () => {
22642
22641
  // Log the operation if logging is enabled in GLOBAL_CONFIG
22643
22642
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22644
- swarm$1.loggerService.log(METHOD_NAME$m);
22643
+ swarm$1.loggerService.log(METHOD_NAME$n);
22645
22644
  // Determine the method context, if active
22646
22645
  const methodContext = MethodContextService.hasContext()
22647
22646
  ? swarm$1.methodContextService.context
@@ -22681,17 +22680,17 @@ async function getSessionContext() {
22681
22680
  * @private Constant defining the method name for logging purposes.
22682
22681
  * Used as an identifier in log messages to track calls to `getNavigationRoute`.
22683
22682
  */
22684
- const METHOD_NAME$l = "function.common.getNavigationRoute";
22683
+ const METHOD_NAME$m = "function.common.getNavigationRoute";
22685
22684
  /**
22686
22685
  * Function implementation
22687
22686
  */
22688
22687
  const getNavigationRouteInternal = (clientId, swarmName) => {
22689
22688
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22690
- swarm$1.loggerService.log(METHOD_NAME$l, {
22689
+ swarm$1.loggerService.log(METHOD_NAME$m, {
22691
22690
  clientId,
22692
22691
  swarmName,
22693
22692
  });
22694
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$l);
22693
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$m);
22695
22694
  return swarm$1.navigationValidationService.getNavigationRoute(clientId, swarmName);
22696
22695
  };
22697
22696
  /**
@@ -22710,7 +22709,7 @@ function getNavigationRoute(clientId, swarmName) {
22710
22709
  * Provides a utility to retrieve the model-facing name of a tool for a given agent and client context.
22711
22710
  * Validates tool and agent existence, logs the operation if enabled, and supports both static and dynamic tool name resolution.
22712
22711
  */
22713
- const METHOD_NAME$k = "function.common.getToolNameForModel";
22712
+ const METHOD_NAME$l = "function.common.getToolNameForModel";
22714
22713
  /**
22715
22714
  * Internal implementation for resolving the model-facing tool name.
22716
22715
  * Validates the tool and agent, logs the operation, and invokes the tool schema's function property if dynamic.
@@ -22723,13 +22722,13 @@ const METHOD_NAME$k = "function.common.getToolNameForModel";
22723
22722
  */
22724
22723
  const getToolNameForModelInternal = beginContext(async (toolName, clientId, agentName) => {
22725
22724
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22726
- swarm$1.loggerService.log(METHOD_NAME$k, {
22725
+ swarm$1.loggerService.log(METHOD_NAME$l, {
22727
22726
  toolName,
22728
22727
  clientId,
22729
22728
  agentName,
22730
22729
  });
22731
- swarm$1.toolValidationService.validate(toolName, METHOD_NAME$k);
22732
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME$k);
22730
+ swarm$1.toolValidationService.validate(toolName, METHOD_NAME$l);
22731
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$l);
22733
22732
  const { function: fn } = swarm$1.toolSchemaService.get(toolName);
22734
22733
  if (typeof fn === "function") {
22735
22734
  const { name } = await fn(clientId, agentName);
@@ -22752,18 +22751,18 @@ async function getToolNameForModel(toolName, clientId, agentName) {
22752
22751
  return await getToolNameForModelInternal(toolName, clientId, agentName);
22753
22752
  }
22754
22753
 
22755
- const METHOD_NAME$j = "function.history.getUserHistory";
22754
+ const METHOD_NAME$k = "function.history.getUserHistory";
22756
22755
  /**
22757
22756
  * Function implementation
22758
22757
  */
22759
22758
  const getUserHistoryInternal = beginContext(async (clientId) => {
22760
22759
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
22761
22760
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22762
- swarm$1.loggerService.log(METHOD_NAME$j, {
22761
+ swarm$1.loggerService.log(METHOD_NAME$k, {
22763
22762
  clientId,
22764
22763
  });
22765
22764
  // Fetch raw history and filter for user role and mode
22766
- const history = await getRawHistoryInternal(clientId, METHOD_NAME$j);
22765
+ const history = await getRawHistoryInternal(clientId, METHOD_NAME$k);
22767
22766
  return history.filter(({ role, mode }) => role === "user" && mode === "user");
22768
22767
  });
22769
22768
  /**
@@ -22784,18 +22783,18 @@ async function getUserHistory(clientId) {
22784
22783
  return await getUserHistoryInternal(clientId);
22785
22784
  }
22786
22785
 
22787
- const METHOD_NAME$i = "function.history.getAssistantHistory";
22786
+ const METHOD_NAME$j = "function.history.getAssistantHistory";
22788
22787
  /**
22789
22788
  * Function implementation
22790
22789
  */
22791
22790
  const getAssistantHistoryInternal = beginContext(async (clientId) => {
22792
22791
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
22793
22792
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22794
- swarm$1.loggerService.log(METHOD_NAME$i, {
22793
+ swarm$1.loggerService.log(METHOD_NAME$j, {
22795
22794
  clientId,
22796
22795
  });
22797
22796
  // Fetch raw history and filter for assistant role
22798
- const history = await getRawHistoryInternal(clientId, METHOD_NAME$i);
22797
+ const history = await getRawHistoryInternal(clientId, METHOD_NAME$j);
22799
22798
  return history.filter(({ role }) => role === "assistant");
22800
22799
  });
22801
22800
  /**
@@ -22816,18 +22815,18 @@ async function getAssistantHistory(clientId) {
22816
22815
  return await getAssistantHistoryInternal(clientId);
22817
22816
  }
22818
22817
 
22819
- const METHOD_NAME$h = "function.history.getLastAssistantMessage";
22818
+ const METHOD_NAME$i = "function.history.getLastAssistantMessage";
22820
22819
  /**
22821
22820
  * Function implementation
22822
22821
  */
22823
22822
  const getLastAssistantMessageInternal = beginContext(async (clientId) => {
22824
22823
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
22825
22824
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22826
- swarm$1.loggerService.log(METHOD_NAME$h, {
22825
+ swarm$1.loggerService.log(METHOD_NAME$i, {
22827
22826
  clientId,
22828
22827
  });
22829
22828
  // Fetch raw history and find the last assistant message
22830
- const history = await getRawHistoryInternal(clientId, METHOD_NAME$h);
22829
+ const history = await getRawHistoryInternal(clientId, METHOD_NAME$i);
22831
22830
  const last = history.findLast(({ role }) => role === "assistant");
22832
22831
  return last?.content ? last.content : null;
22833
22832
  });
@@ -22849,18 +22848,18 @@ async function getLastAssistantMessage(clientId) {
22849
22848
  return await getLastAssistantMessageInternal(clientId);
22850
22849
  }
22851
22850
 
22852
- const METHOD_NAME$g = "function.history.getLastSystemMessage";
22851
+ const METHOD_NAME$h = "function.history.getLastSystemMessage";
22853
22852
  /**
22854
22853
  * Function implementation
22855
22854
  */
22856
22855
  const getLastSystemMessageInternal = beginContext(async (clientId) => {
22857
22856
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
22858
22857
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22859
- swarm$1.loggerService.log(METHOD_NAME$g, {
22858
+ swarm$1.loggerService.log(METHOD_NAME$h, {
22860
22859
  clientId,
22861
22860
  });
22862
22861
  // Fetch raw history and find the last system message
22863
- const history = await getRawHistoryInternal(clientId, METHOD_NAME$g);
22862
+ const history = await getRawHistoryInternal(clientId, METHOD_NAME$h);
22864
22863
  const last = history.findLast(({ role }) => role === "system");
22865
22864
  return last ? last.content : null;
22866
22865
  });
@@ -22882,7 +22881,7 @@ async function getLastSystemMessage(clientId) {
22882
22881
  return await getLastSystemMessageInternal(clientId);
22883
22882
  }
22884
22883
 
22885
- const METHOD_NAME$f = "function.dump.getAgent";
22884
+ const METHOD_NAME$g = "function.dump.getAgent";
22886
22885
  /**
22887
22886
  * Retrieves an agent schema by its name from the swarm's agent schema service.
22888
22887
  * Logs the operation if logging is enabled in the global configuration.
@@ -22893,13 +22892,13 @@ const METHOD_NAME$f = "function.dump.getAgent";
22893
22892
  */
22894
22893
  function getAgent(agentName) {
22895
22894
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22896
- swarm$1.loggerService.log(METHOD_NAME$f, {
22895
+ swarm$1.loggerService.log(METHOD_NAME$g, {
22897
22896
  agentName,
22898
22897
  });
22899
22898
  return swarm$1.agentSchemaService.get(agentName);
22900
22899
  }
22901
22900
 
22902
- const METHOD_NAME$e = "function.dump.getCompletion";
22901
+ const METHOD_NAME$f = "function.dump.getCompletion";
22903
22902
  /**
22904
22903
  * Retrieves a completion schema by its name from the swarm's completion schema service.
22905
22904
  * Logs the operation if logging is enabled in the global configuration.
@@ -22910,13 +22909,13 @@ const METHOD_NAME$e = "function.dump.getCompletion";
22910
22909
  */
22911
22910
  function getCompletion(completionName) {
22912
22911
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22913
- swarm$1.loggerService.log(METHOD_NAME$e, {
22912
+ swarm$1.loggerService.log(METHOD_NAME$f, {
22914
22913
  completionName,
22915
22914
  });
22916
22915
  return swarm$1.completionSchemaService.get(completionName);
22917
22916
  }
22918
22917
 
22919
- const METHOD_NAME$d = "function.dump.getCompute";
22918
+ const METHOD_NAME$e = "function.dump.getCompute";
22920
22919
  /**
22921
22920
  * Retrieves a compute schema by its name from the swarm's compute schema service.
22922
22921
  * Logs the operation if logging is enabled in the global configuration.
@@ -22927,13 +22926,13 @@ const METHOD_NAME$d = "function.dump.getCompute";
22927
22926
  */
22928
22927
  function getCompute(computeName) {
22929
22928
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22930
- swarm$1.loggerService.log(METHOD_NAME$d, {
22929
+ swarm$1.loggerService.log(METHOD_NAME$e, {
22931
22930
  computeName,
22932
22931
  });
22933
22932
  return swarm$1.computeSchemaService.get(computeName);
22934
22933
  }
22935
22934
 
22936
- const METHOD_NAME$c = "function.dump.getEmbeding";
22935
+ const METHOD_NAME$d = "function.dump.getEmbeding";
22937
22936
  /**
22938
22937
  * Retrieves an embedding schema by its name from the swarm's embedding schema service.
22939
22938
  * Logs the operation if logging is enabled in the global configuration.
@@ -22944,13 +22943,13 @@ const METHOD_NAME$c = "function.dump.getEmbeding";
22944
22943
  */
22945
22944
  function getEmbeding(embeddingName) {
22946
22945
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22947
- swarm$1.loggerService.log(METHOD_NAME$c, {
22946
+ swarm$1.loggerService.log(METHOD_NAME$d, {
22948
22947
  embeddingName,
22949
22948
  });
22950
22949
  return swarm$1.embeddingSchemaService.get(embeddingName);
22951
22950
  }
22952
22951
 
22953
- const METHOD_NAME$b = "function.dump.getMCP";
22952
+ const METHOD_NAME$c = "function.dump.getMCP";
22954
22953
  /**
22955
22954
  * Retrieves an MCP (Model Context Protocol) schema by its name from the swarm's MCP schema service.
22956
22955
  * Logs the operation if logging is enabled in the global configuration.
@@ -22961,13 +22960,13 @@ const METHOD_NAME$b = "function.dump.getMCP";
22961
22960
  */
22962
22961
  function getMCP(mcpName) {
22963
22962
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22964
- swarm$1.loggerService.log(METHOD_NAME$b, {
22963
+ swarm$1.loggerService.log(METHOD_NAME$c, {
22965
22964
  mcpName,
22966
22965
  });
22967
22966
  return swarm$1.mcpSchemaService.get(mcpName);
22968
22967
  }
22969
22968
 
22970
- const METHOD_NAME$a = "function.dump.getPipeline";
22969
+ const METHOD_NAME$b = "function.dump.getPipeline";
22971
22970
  /**
22972
22971
  * Retrieves a pipeline schema by its name from the swarm's pipeline schema service.
22973
22972
  * Logs the operation if logging is enabled in the global configuration.
@@ -22978,13 +22977,13 @@ const METHOD_NAME$a = "function.dump.getPipeline";
22978
22977
  */
22979
22978
  function getPipeline(pipelineName) {
22980
22979
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22981
- swarm$1.loggerService.log(METHOD_NAME$a, {
22980
+ swarm$1.loggerService.log(METHOD_NAME$b, {
22982
22981
  pipelineName,
22983
22982
  });
22984
22983
  return swarm$1.pipelineSchemaService.get(pipelineName);
22985
22984
  }
22986
22985
 
22987
- const METHOD_NAME$9 = "function.dump.getPolicy";
22986
+ const METHOD_NAME$a = "function.dump.getPolicy";
22988
22987
  /**
22989
22988
  * Retrieves a policy schema by its name from the swarm's policy schema service.
22990
22989
  * Logs the operation if logging is enabled in the global configuration.
@@ -22995,13 +22994,13 @@ const METHOD_NAME$9 = "function.dump.getPolicy";
22995
22994
  */
22996
22995
  function getPolicy(policyName) {
22997
22996
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
22998
- swarm$1.loggerService.log(METHOD_NAME$9, {
22997
+ swarm$1.loggerService.log(METHOD_NAME$a, {
22999
22998
  policyName,
23000
22999
  });
23001
23000
  return swarm$1.policySchemaService.get(policyName);
23002
23001
  }
23003
23002
 
23004
- const METHOD_NAME$8 = "function.dump.getState";
23003
+ const METHOD_NAME$9 = "function.dump.getState";
23005
23004
  /**
23006
23005
  * Retrieves a state schema by its name from the swarm's state schema service.
23007
23006
  * Logs the operation if logging is enabled in the global configuration.
@@ -23012,13 +23011,13 @@ const METHOD_NAME$8 = "function.dump.getState";
23012
23011
  */
23013
23012
  function getState(stateName) {
23014
23013
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
23015
- swarm$1.loggerService.log(METHOD_NAME$8, {
23014
+ swarm$1.loggerService.log(METHOD_NAME$9, {
23016
23015
  stateName,
23017
23016
  });
23018
23017
  return swarm$1.stateSchemaService.get(stateName);
23019
23018
  }
23020
23019
 
23021
- const METHOD_NAME$7 = "function.dump.getStorage";
23020
+ const METHOD_NAME$8 = "function.dump.getStorage";
23022
23021
  /**
23023
23022
  * Retrieves a storage schema by its name from the swarm's storage schema service.
23024
23023
  * Logs the operation if logging is enabled in the global configuration.
@@ -23029,13 +23028,13 @@ const METHOD_NAME$7 = "function.dump.getStorage";
23029
23028
  */
23030
23029
  function getStorage(storageName) {
23031
23030
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
23032
- swarm$1.loggerService.log(METHOD_NAME$7, {
23031
+ swarm$1.loggerService.log(METHOD_NAME$8, {
23033
23032
  storageName,
23034
23033
  });
23035
23034
  return swarm$1.storageSchemaService.get(storageName);
23036
23035
  }
23037
23036
 
23038
- const METHOD_NAME$6 = "function.dump.getSwarm";
23037
+ const METHOD_NAME$7 = "function.dump.getSwarm";
23039
23038
  /**
23040
23039
  * Retrieves a swarm schema by its name from the swarm's swarm schema service.
23041
23040
  * Logs the operation if logging is enabled in the global configuration.
@@ -23046,13 +23045,13 @@ const METHOD_NAME$6 = "function.dump.getSwarm";
23046
23045
  */
23047
23046
  function getSwarm(swarmName) {
23048
23047
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
23049
- swarm$1.loggerService.log(METHOD_NAME$6, {
23048
+ swarm$1.loggerService.log(METHOD_NAME$7, {
23050
23049
  swarmName,
23051
23050
  });
23052
23051
  return swarm$1.swarmSchemaService.get(swarmName);
23053
23052
  }
23054
23053
 
23055
- const METHOD_NAME$5 = "function.dump.getTool";
23054
+ const METHOD_NAME$6 = "function.dump.getTool";
23056
23055
  /**
23057
23056
  * Retrieves a tool schema by its name from the swarm's tool schema service.
23058
23057
  * Logs the operation if logging is enabled in the global configuration.
@@ -23063,13 +23062,13 @@ const METHOD_NAME$5 = "function.dump.getTool";
23063
23062
  */
23064
23063
  function getTool(toolName) {
23065
23064
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
23066
- swarm$1.loggerService.log(METHOD_NAME$5, {
23065
+ swarm$1.loggerService.log(METHOD_NAME$6, {
23067
23066
  toolName,
23068
23067
  });
23069
23068
  return swarm$1.toolSchemaService.get(toolName);
23070
23069
  }
23071
23070
 
23072
- const METHOD_NAME$4 = "function.dump.getWiki";
23071
+ const METHOD_NAME$5 = "function.dump.getWiki";
23073
23072
  /**
23074
23073
  * Retrieves a wiki schema by its name from the swarm's wiki schema service.
23075
23074
  * Logs the operation if logging is enabled in the global configuration.
@@ -23080,13 +23079,13 @@ const METHOD_NAME$4 = "function.dump.getWiki";
23080
23079
  */
23081
23080
  function getWiki(wikiName) {
23082
23081
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
23083
- swarm$1.loggerService.log(METHOD_NAME$4, {
23082
+ swarm$1.loggerService.log(METHOD_NAME$5, {
23084
23083
  wikiName,
23085
23084
  });
23086
23085
  return swarm$1.wikiSchemaService.get(wikiName);
23087
23086
  }
23088
23087
 
23089
- const METHOD_NAME$3 = "function.event.listenEvent";
23088
+ const METHOD_NAME$4 = "function.event.listenEvent";
23090
23089
  /**
23091
23090
  * Set of reserved event source names that cannot be used for custom events.
23092
23091
  * @constant {Set<EventSource>}
@@ -23107,7 +23106,7 @@ const DISALLOWED_EVENT_SOURCE_LIST$2 = new Set([
23107
23106
  const eventInternal = beginContext(async (clientId, topicName, payload) => {
23108
23107
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
23109
23108
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
23110
- swarm$1.loggerService.log(METHOD_NAME$3, {
23109
+ swarm$1.loggerService.log(METHOD_NAME$4, {
23111
23110
  clientId,
23112
23111
  });
23113
23112
  // Check if the topic name is reserved
@@ -23143,7 +23142,7 @@ async function event(clientId, topicName, payload) {
23143
23142
  return await eventInternal(clientId, topicName, payload);
23144
23143
  }
23145
23144
 
23146
- const METHOD_NAME$2 = "function.event.listenEvent";
23145
+ const METHOD_NAME$3 = "function.event.listenEvent";
23147
23146
  /**
23148
23147
  * Set of reserved event source names that cannot be used for custom event topics.
23149
23148
  * @constant {Set<EventSource>}
@@ -23178,7 +23177,7 @@ const validateClientId$g = (clientId) => {
23178
23177
  const listenEventInternal = beginContext((clientId, topicName, fn) => {
23179
23178
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
23180
23179
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
23181
- swarm$1.loggerService.log(METHOD_NAME$2, {
23180
+ swarm$1.loggerService.log(METHOD_NAME$3, {
23182
23181
  clientId,
23183
23182
  });
23184
23183
  // Check if the topic name is reserved
@@ -23214,7 +23213,7 @@ function listenEvent(clientId, topicName, fn) {
23214
23213
  return listenEventInternal(clientId, topicName, fn);
23215
23214
  }
23216
23215
 
23217
- const METHOD_NAME$1 = "function.event.listenEventOnce";
23216
+ const METHOD_NAME$2 = "function.event.listenEventOnce";
23218
23217
  /**
23219
23218
  * Set of reserved event source names that cannot be used for custom event topics.
23220
23219
  * @constant {Set<EventSource>}
@@ -23249,7 +23248,7 @@ const validateClientId$f = (clientId) => {
23249
23248
  const listenEventOnceInternal = beginContext((clientId, topicName, filterFn, fn) => {
23250
23249
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
23251
23250
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
23252
- swarm$1.loggerService.log(METHOD_NAME$1, {
23251
+ swarm$1.loggerService.log(METHOD_NAME$2, {
23253
23252
  clientId,
23254
23253
  });
23255
23254
  // Check if the topic name is reserved
@@ -23291,7 +23290,7 @@ function listenEventOnce(clientId, topicName, filterFn, fn) {
23291
23290
  return listenEventOnceInternal(clientId, topicName, filterFn, fn);
23292
23291
  }
23293
23292
 
23294
- const METHOD_NAME = "function.navigate.changeToPrevAgent";
23293
+ const METHOD_NAME$1 = "function.navigate.changeToPrevAgent";
23295
23294
  /**
23296
23295
  * Creates a change agent function with time-to-live (TTL) and queuing capabilities for switching to the previous agent.
23297
23296
  *
@@ -23314,7 +23313,7 @@ const createChangeToPrevAgent = functoolsKit.memoize(([clientId]) => `${clientId
23314
23313
  }));
23315
23314
  {
23316
23315
  // Dispose of the current agent's resources and set up the new agent
23317
- const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME, clientId, swarmName);
23316
+ const agentName = await swarm$1.swarmPublicService.getAgentName(METHOD_NAME$1, clientId, swarmName);
23318
23317
  await swarm$1.agentPublicService.dispose(methodName, clientId, agentName);
23319
23318
  await swarm$1.historyPublicService.dispose(methodName, clientId, agentName);
23320
23319
  await swarm$1.swarmPublicService.setAgentRef(methodName, clientId, swarmName, agentName, await swarm$1.agentPublicService.createAgentRef(methodName, clientId, agentName));
@@ -23342,20 +23341,20 @@ const createGc = functoolsKit.singleshot(async () => {
23342
23341
  const changeToPrevAgentInternal = beginContext(async (clientId) => {
23343
23342
  // Log the operation details if logging is enabled in GLOBAL_CONFIG
23344
23343
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
23345
- swarm$1.loggerService.log(METHOD_NAME, {
23344
+ swarm$1.loggerService.log(METHOD_NAME$1, {
23346
23345
  clientId,
23347
23346
  });
23348
23347
  const swarmName = swarm$1.sessionValidationService.getSwarm(clientId);
23349
- const agentName = await swarm$1.swarmPublicService.navigationPop(METHOD_NAME, clientId, swarmName);
23348
+ const agentName = await swarm$1.swarmPublicService.navigationPop(METHOD_NAME$1, clientId, swarmName);
23350
23349
  {
23351
23350
  // Validate session and the retrieved agent
23352
- swarm$1.sessionValidationService.validate(clientId, METHOD_NAME);
23353
- swarm$1.agentValidationService.validate(agentName, METHOD_NAME);
23351
+ swarm$1.sessionValidationService.validate(clientId, METHOD_NAME$1);
23352
+ swarm$1.agentValidationService.validate(agentName, METHOD_NAME$1);
23354
23353
  }
23355
23354
  // Execute the agent change with TTL and queuing
23356
23355
  const run = await createChangeToPrevAgent(clientId);
23357
23356
  createGc();
23358
- return await run(METHOD_NAME, agentName, swarmName);
23357
+ return await run(METHOD_NAME$1, agentName, swarmName);
23359
23358
  });
23360
23359
  /**
23361
23360
  * Navigates back to the previous or default agent for a given client session in a swarm.
@@ -25665,6 +25664,34 @@ class AdapterUtils {
25665
25664
  */
25666
25665
  const Adapter = new AdapterUtils();
25667
25666
 
25667
+ const METHOD_NAME = "function.common.validate";
25668
+ /**
25669
+ * Runs validation for all swarms, agents, and outlines.
25670
+ * This function is wrapped with `singleshot` to ensure it only runs once per process.
25671
+ * Logs the validation process if logging is enabled in the global config.
25672
+ *
25673
+ * @private
25674
+ */
25675
+ const validateInternal = functoolsKit.singleshot(() => {
25676
+ GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
25677
+ swarm$1.loggerService.log(METHOD_NAME);
25678
+ const swarmList = swarm$1.swarmValidationService.getSwarmList();
25679
+ const agentList = swarmList.flatMap((swarmName) => swarm$1.swarmValidationService.getAgentList(swarmName));
25680
+ const outlineList = swarm$1.outlineValidationService.getOutlineList();
25681
+ swarmList.forEach((swarmName) => swarm$1.swarmValidationService.validate(swarmName, METHOD_NAME));
25682
+ agentList.forEach((agentName) => swarm$1.agentValidationService.validate(agentName, METHOD_NAME));
25683
+ outlineList.forEach((outlineName) => swarm$1.outlineValidationService.validate(outlineName, METHOD_NAME));
25684
+ });
25685
+ /**
25686
+ * Validates all swarms, agents, and outlines in the system.
25687
+ * This function is idempotent and will only perform validation once per process.
25688
+ *
25689
+ * @returns {void}
25690
+ */
25691
+ function validate() {
25692
+ return validateInternal();
25693
+ }
25694
+
25668
25695
  /**
25669
25696
  * Converts a given schema object into a JSON schema format object.
25670
25697
  *
@@ -25852,3 +25879,4 @@ exports.setConfig = setConfig;
25852
25879
  exports.startPipeline = startPipeline;
25853
25880
  exports.swarm = swarm;
25854
25881
  exports.toJsonSchema = toJsonSchema;
25882
+ exports.validate = validate;