agent-swarm-kit 1.0.48 → 1.0.49

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
@@ -4584,6 +4584,34 @@ var emitForce = function (content, clientId) { return __awaiter(void 0, void 0,
4584
4584
  });
4585
4585
  }); };
4586
4586
 
4587
+ /**
4588
+ * Send the message to the active agent in the swarm content like it income from client side
4589
+ * Should be used to review tool output and initiate conversation from the model side to client
4590
+ *
4591
+ * Will execute even if the agent is inactive
4592
+ *
4593
+ * @param {string} content - The content to be executed.
4594
+ * @param {string} clientId - The ID of the client requesting execution.
4595
+ * @returns {Promise<void>} - A promise that resolves when the execution is complete.
4596
+ */
4597
+ var executeForce = function (content, clientId) { return __awaiter(void 0, void 0, void 0, function () {
4598
+ var swarmName;
4599
+ return __generator(this, function (_a) {
4600
+ switch (_a.label) {
4601
+ case 0:
4602
+ swarm.loggerService.log("function executeForce", {
4603
+ content: content,
4604
+ clientId: clientId,
4605
+ });
4606
+ swarm.sessionValidationService.validate(clientId, "executeForce");
4607
+ swarmName = swarm.sessionValidationService.getSwarm(clientId);
4608
+ swarm.swarmValidationService.validate(swarmName, "executeForce");
4609
+ return [4 /*yield*/, swarm.sessionPublicService.execute(content, "tool", clientId, swarmName)];
4610
+ case 1: return [2 /*return*/, _a.sent()];
4611
+ }
4612
+ });
4613
+ }); };
4614
+
4587
4615
  /**
4588
4616
  * Retrieves the last message sent by the user from the client's message history.
4589
4617
  *
@@ -4785,6 +4813,7 @@ exports.disposeConnection = disposeConnection;
4785
4813
  exports.emit = emit;
4786
4814
  exports.emitForce = emitForce;
4787
4815
  exports.execute = execute;
4816
+ exports.executeForce = executeForce;
4788
4817
  exports.getAgentHistory = getAgentHistory;
4789
4818
  exports.getAgentName = getAgentName;
4790
4819
  exports.getAssistantHistory = getAssistantHistory;
package/build/index.mjs CHANGED
@@ -4582,6 +4582,34 @@ var emitForce = function (content, clientId) { return __awaiter(void 0, void 0,
4582
4582
  });
4583
4583
  }); };
4584
4584
 
4585
+ /**
4586
+ * Send the message to the active agent in the swarm content like it income from client side
4587
+ * Should be used to review tool output and initiate conversation from the model side to client
4588
+ *
4589
+ * Will execute even if the agent is inactive
4590
+ *
4591
+ * @param {string} content - The content to be executed.
4592
+ * @param {string} clientId - The ID of the client requesting execution.
4593
+ * @returns {Promise<void>} - A promise that resolves when the execution is complete.
4594
+ */
4595
+ var executeForce = function (content, clientId) { return __awaiter(void 0, void 0, void 0, function () {
4596
+ var swarmName;
4597
+ return __generator(this, function (_a) {
4598
+ switch (_a.label) {
4599
+ case 0:
4600
+ swarm.loggerService.log("function executeForce", {
4601
+ content: content,
4602
+ clientId: clientId,
4603
+ });
4604
+ swarm.sessionValidationService.validate(clientId, "executeForce");
4605
+ swarmName = swarm.sessionValidationService.getSwarm(clientId);
4606
+ swarm.swarmValidationService.validate(swarmName, "executeForce");
4607
+ return [4 /*yield*/, swarm.sessionPublicService.execute(content, "tool", clientId, swarmName)];
4608
+ case 1: return [2 /*return*/, _a.sent()];
4609
+ }
4610
+ });
4611
+ }); };
4612
+
4585
4613
  /**
4586
4614
  * Retrieves the last message sent by the user from the client's message history.
4587
4615
  *
@@ -4764,4 +4792,4 @@ var makeAutoDispose = function (clientId, swarmName, _a) {
4764
4792
  };
4765
4793
  };
4766
4794
 
4767
- export { ContextService, addAgent, addCompletion, addSwarm, addTool, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, emit, emitForce, execute, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, makeAutoDispose, makeConnection, session, setConfig, swarm };
4795
+ export { ContextService, addAgent, addCompletion, addSwarm, addTool, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, emit, emitForce, execute, executeForce, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, makeAutoDispose, makeConnection, session, setConfig, swarm };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -2063,6 +2063,18 @@ declare const commitUserMessageForce: (content: string, clientId: string) => Pro
2063
2063
  */
2064
2064
  declare const emitForce: (content: string, clientId: string) => Promise<void>;
2065
2065
 
2066
+ /**
2067
+ * Send the message to the active agent in the swarm content like it income from client side
2068
+ * Should be used to review tool output and initiate conversation from the model side to client
2069
+ *
2070
+ * Will execute even if the agent is inactive
2071
+ *
2072
+ * @param {string} content - The content to be executed.
2073
+ * @param {string} clientId - The ID of the client requesting execution.
2074
+ * @returns {Promise<void>} - A promise that resolves when the execution is complete.
2075
+ */
2076
+ declare const executeForce: (content: string, clientId: string) => Promise<string>;
2077
+
2066
2078
  /**
2067
2079
  * Retrieves the last message sent by the user from the client's message history.
2068
2080
  *
@@ -2162,4 +2174,4 @@ declare const GLOBAL_CONFIG: {
2162
2174
  };
2163
2175
  declare const setConfig: (config: Partial<typeof GLOBAL_CONFIG>) => void;
2164
2176
 
2165
- export { ContextService, type IAgentSchema, type IAgentTool, type ICompletionArgs, type ICompletionSchema, type IIncomingMessage, type IMakeConnectionConfig, type IMakeDisposeParams, type IModelMessage, type IOutgoingMessage, type ISessionConfig, type ISwarmSchema, type ITool, type IToolCall, type ReceiveMessageFn, type SendMessageFn$1 as SendMessageFn, addAgent, addCompletion, addSwarm, addTool, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, emit, emitForce, execute, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, makeAutoDispose, makeConnection, session, setConfig, swarm };
2177
+ export { ContextService, type IAgentSchema, type IAgentTool, type ICompletionArgs, type ICompletionSchema, type IIncomingMessage, type IMakeConnectionConfig, type IMakeDisposeParams, type IModelMessage, type IOutgoingMessage, type ISessionConfig, type ISwarmSchema, type ITool, type IToolCall, type ReceiveMessageFn, type SendMessageFn$1 as SendMessageFn, addAgent, addCompletion, addSwarm, addTool, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, emit, emitForce, execute, executeForce, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, makeAutoDispose, makeConnection, session, setConfig, swarm };