agent-swarm-kit 1.0.196 → 1.0.197
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 +21 -0
- package/build/index.mjs +21 -0
- package/package.json +1 -1
- package/types.d.ts +11 -3
package/build/index.cjs
CHANGED
|
@@ -16854,6 +16854,8 @@ const CHAT_UTILS_METHOD_NAME_SEND_MESSAGE = "ChatUtils.sendMessage";
|
|
|
16854
16854
|
/** @constant {string} */
|
|
16855
16855
|
const CHAT_UTILS_METHOD_NAME_LISTEN_DISPOSE = "ChatUtils.listenDispose";
|
|
16856
16856
|
/** @constant {string} */
|
|
16857
|
+
const CHAT_UTILS_METHOD_NAME_DISPOSE = "ChatUtils.dispose";
|
|
16858
|
+
/** @constant {string} */
|
|
16857
16859
|
const CHAT_INSTANCE_METHOD_NAME_SEND_MESSAGE = "ChatInstance.sendMessage";
|
|
16858
16860
|
/** @constant {string} */
|
|
16859
16861
|
const CHAT_INSTANCE_METHOD_NAME_DISPOSE = "ChatInstance.dispose";
|
|
@@ -17018,6 +17020,25 @@ class ChatUtils {
|
|
|
17018
17020
|
});
|
|
17019
17021
|
return this.getChatInstance(clientId, swarmName).listenDispose(fn);
|
|
17020
17022
|
};
|
|
17023
|
+
/**
|
|
17024
|
+
* Disposes of a specific chat instance for a client
|
|
17025
|
+
* @public
|
|
17026
|
+
* @async
|
|
17027
|
+
* @param {SessionId} clientId - The client identifier for the chat instance to dispose
|
|
17028
|
+
* @param {SwarmName} swarmName - The swarm name associated with the chat instance
|
|
17029
|
+
* @returns {Promise<void>} A promise that resolves when the chat instance has been disposed
|
|
17030
|
+
*/
|
|
17031
|
+
this.dispose = async (clientId, swarmName) => {
|
|
17032
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17033
|
+
swarm$1.loggerService.log(CHAT_UTILS_METHOD_NAME_DISPOSE, {
|
|
17034
|
+
clientId,
|
|
17035
|
+
swarmName,
|
|
17036
|
+
});
|
|
17037
|
+
if (!this._chats.has(clientId)) {
|
|
17038
|
+
return;
|
|
17039
|
+
}
|
|
17040
|
+
return await this.getChatInstance(clientId, swarmName).dispose();
|
|
17041
|
+
};
|
|
17021
17042
|
}
|
|
17022
17043
|
}
|
|
17023
17044
|
/** @constant {ChatUtils} Singleton instance of ChatUtils */
|
package/build/index.mjs
CHANGED
|
@@ -16852,6 +16852,8 @@ const CHAT_UTILS_METHOD_NAME_SEND_MESSAGE = "ChatUtils.sendMessage";
|
|
|
16852
16852
|
/** @constant {string} */
|
|
16853
16853
|
const CHAT_UTILS_METHOD_NAME_LISTEN_DISPOSE = "ChatUtils.listenDispose";
|
|
16854
16854
|
/** @constant {string} */
|
|
16855
|
+
const CHAT_UTILS_METHOD_NAME_DISPOSE = "ChatUtils.dispose";
|
|
16856
|
+
/** @constant {string} */
|
|
16855
16857
|
const CHAT_INSTANCE_METHOD_NAME_SEND_MESSAGE = "ChatInstance.sendMessage";
|
|
16856
16858
|
/** @constant {string} */
|
|
16857
16859
|
const CHAT_INSTANCE_METHOD_NAME_DISPOSE = "ChatInstance.dispose";
|
|
@@ -17016,6 +17018,25 @@ class ChatUtils {
|
|
|
17016
17018
|
});
|
|
17017
17019
|
return this.getChatInstance(clientId, swarmName).listenDispose(fn);
|
|
17018
17020
|
};
|
|
17021
|
+
/**
|
|
17022
|
+
* Disposes of a specific chat instance for a client
|
|
17023
|
+
* @public
|
|
17024
|
+
* @async
|
|
17025
|
+
* @param {SessionId} clientId - The client identifier for the chat instance to dispose
|
|
17026
|
+
* @param {SwarmName} swarmName - The swarm name associated with the chat instance
|
|
17027
|
+
* @returns {Promise<void>} A promise that resolves when the chat instance has been disposed
|
|
17028
|
+
*/
|
|
17029
|
+
this.dispose = async (clientId, swarmName) => {
|
|
17030
|
+
GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
|
|
17031
|
+
swarm$1.loggerService.log(CHAT_UTILS_METHOD_NAME_DISPOSE, {
|
|
17032
|
+
clientId,
|
|
17033
|
+
swarmName,
|
|
17034
|
+
});
|
|
17035
|
+
if (!this._chats.has(clientId)) {
|
|
17036
|
+
return;
|
|
17037
|
+
}
|
|
17038
|
+
return await this.getChatInstance(clientId, swarmName).dispose();
|
|
17039
|
+
};
|
|
17019
17040
|
}
|
|
17020
17041
|
}
|
|
17021
17042
|
/** @constant {ChatUtils} Singleton instance of ChatUtils */
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as di_scoped from 'di-scoped';
|
|
2
2
|
import * as functools_kit from 'functools-kit';
|
|
3
3
|
import { SortedArray, Subject } from 'functools-kit';
|
|
4
|
-
import { SessionId as SessionId$1 } from 'src/interfaces/Session.interface';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Interface defining the structure of execution context in the swarm system.
|
|
@@ -10500,7 +10499,7 @@ declare class ChatUtils {
|
|
|
10500
10499
|
* @param {SwarmName} swarmName - The swarm name
|
|
10501
10500
|
* @returns {Promise<any>} Result of the message sending
|
|
10502
10501
|
*/
|
|
10503
|
-
sendMessage: (clientId: SessionId
|
|
10502
|
+
sendMessage: (clientId: SessionId, message: string, swarmName: SwarmName) => Promise<string>;
|
|
10504
10503
|
/**
|
|
10505
10504
|
* Subscribes to disposal events for a specific client
|
|
10506
10505
|
* @public
|
|
@@ -10509,7 +10508,16 @@ declare class ChatUtils {
|
|
|
10509
10508
|
* @param {(clientId: SessionId) => void} fn - Callback function for disposal events
|
|
10510
10509
|
* @returns {any} Subscription object
|
|
10511
10510
|
*/
|
|
10512
|
-
listenDispose: (clientId: SessionId
|
|
10511
|
+
listenDispose: (clientId: SessionId, swarmName: SwarmName, fn: (clientId: SessionId) => void) => () => void;
|
|
10512
|
+
/**
|
|
10513
|
+
* Disposes of a specific chat instance for a client
|
|
10514
|
+
* @public
|
|
10515
|
+
* @async
|
|
10516
|
+
* @param {SessionId} clientId - The client identifier for the chat instance to dispose
|
|
10517
|
+
* @param {SwarmName} swarmName - The swarm name associated with the chat instance
|
|
10518
|
+
* @returns {Promise<void>} A promise that resolves when the chat instance has been disposed
|
|
10519
|
+
*/
|
|
10520
|
+
dispose: (clientId: SessionId, swarmName: SwarmName) => Promise<void>;
|
|
10513
10521
|
}
|
|
10514
10522
|
/** @constant {ChatUtils} Singleton instance of ChatUtils */
|
|
10515
10523
|
declare const Chat: ChatUtils;
|