agent-swarm-kit 1.0.76 → 1.0.77

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
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
@@ -2,6 +2,24 @@ 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
4
 
5
+ /**
6
+ * Interface representing the context.
7
+ */
8
+ interface IExecutionContext {
9
+ clientId: string;
10
+ executionId: string;
11
+ }
12
+ /**
13
+ * Service providing execution context information.
14
+ */
15
+ declare const ExecutionContextService: (new () => {
16
+ readonly context: IExecutionContext;
17
+ }) & Omit<{
18
+ new (context: IExecutionContext): {
19
+ readonly context: IExecutionContext;
20
+ };
21
+ }, "prototype"> & di_scoped.IScopedClassRun<[context: IExecutionContext]>;
22
+
5
23
  /**
6
24
  * Interface representing an incoming message.
7
25
  */
@@ -1421,31 +1439,32 @@ type ToolName = string;
1421
1439
  /**
1422
1440
  * Interface representing the context.
1423
1441
  */
1424
- interface IContext {
1442
+ interface IMethodContext {
1425
1443
  clientId: string;
1426
- requestId: string;
1444
+ methodName: string;
1427
1445
  agentName: AgentName;
1428
1446
  swarmName: SwarmName;
1429
1447
  storageName: StorageName;
1430
1448
  stateName: StateName;
1431
1449
  }
1432
1450
  /**
1433
- * Service providing context information.
1451
+ * Service providing method call context information.
1434
1452
  */
1435
- declare const ContextService: (new () => {
1436
- readonly context: IContext;
1453
+ declare const MethodContextService: (new () => {
1454
+ readonly context: IMethodContext;
1437
1455
  }) & Omit<{
1438
- new (context: IContext): {
1439
- readonly context: IContext;
1456
+ new (context: IMethodContext): {
1457
+ readonly context: IMethodContext;
1440
1458
  };
1441
- }, "prototype"> & di_scoped.IScopedClassRun<[context: IContext]>;
1459
+ }, "prototype"> & di_scoped.IScopedClassRun<[context: IMethodContext]>;
1442
1460
 
1443
1461
  /**
1444
1462
  * LoggerService class that implements the ILogger interface.
1445
1463
  * Provides methods to log and debug messages.
1446
1464
  */
1447
1465
  declare class LoggerService implements ILogger {
1448
- private readonly contextService;
1466
+ private readonly methodContextService;
1467
+ private readonly executionContextService;
1449
1468
  private _logger;
1450
1469
  /**
1451
1470
  * Logs messages using the current logger.
@@ -1552,7 +1571,7 @@ declare class ClientAgent implements IAgent {
1552
1571
  declare class AgentConnectionService implements IAgent {
1553
1572
  private readonly loggerService;
1554
1573
  private readonly busService;
1555
- private readonly contextService;
1574
+ private readonly methodContextService;
1556
1575
  private readonly sessionValidationService;
1557
1576
  private readonly historyConnectionService;
1558
1577
  private readonly storageConnectionService;
@@ -1660,7 +1679,7 @@ declare class ClientHistory implements IHistory {
1660
1679
  declare class HistoryConnectionService implements IHistory {
1661
1680
  private readonly loggerService;
1662
1681
  private readonly busService;
1663
- private readonly contextService;
1682
+ private readonly methodContextService;
1664
1683
  private readonly sessionValidationService;
1665
1684
  /**
1666
1685
  * Retrieves the history for a given client and agent.
@@ -1788,7 +1807,7 @@ declare class ClientSwarm implements ISwarm {
1788
1807
  declare class SwarmConnectionService implements ISwarm {
1789
1808
  private readonly loggerService;
1790
1809
  private readonly busService;
1791
- private readonly contextService;
1810
+ private readonly methodContextService;
1792
1811
  private readonly agentConnectionService;
1793
1812
  private readonly swarmSchemaService;
1794
1813
  /**
@@ -1946,7 +1965,7 @@ declare class ClientSession implements ISession {
1946
1965
  declare class SessionConnectionService implements ISession {
1947
1966
  private readonly loggerService;
1948
1967
  private readonly busService;
1949
- private readonly contextService;
1968
+ private readonly methodContextService;
1950
1969
  private readonly swarmConnectionService;
1951
1970
  private readonly swarmSchemaService;
1952
1971
  /**
@@ -2026,7 +2045,7 @@ declare class AgentPublicService implements TAgentConnectionService {
2026
2045
  * @param {AgentName} agentName - The name of the agent.
2027
2046
  * @returns {Promise<unknown>} The agent reference.
2028
2047
  */
2029
- createAgentRef: (requestId: string, clientId: string, agentName: AgentName) => Promise<ClientAgent>;
2048
+ createAgentRef: (methodName: string, clientId: string, agentName: AgentName) => Promise<ClientAgent>;
2030
2049
  /**
2031
2050
  * Executes a command on the agent.
2032
2051
  * @param {string} input - The input command.
@@ -2034,14 +2053,14 @@ declare class AgentPublicService implements TAgentConnectionService {
2034
2053
  * @param {AgentName} agentName - The name of the agent.
2035
2054
  * @returns {Promise<unknown>} The execution result.
2036
2055
  */
2037
- execute: (input: string, mode: ExecutionMode, requestId: string, clientId: string, agentName: AgentName) => Promise<void>;
2056
+ execute: (input: string, mode: ExecutionMode, methodName: string, clientId: string, agentName: AgentName) => Promise<void>;
2038
2057
  /**
2039
2058
  * Waits for the agent's output.
2040
2059
  * @param {string} clientId - The client ID.
2041
2060
  * @param {AgentName} agentName - The name of the agent.
2042
2061
  * @returns {Promise<unknown>} The output result.
2043
2062
  */
2044
- waitForOutput: (requestId: string, clientId: string, agentName: AgentName) => Promise<string>;
2063
+ waitForOutput: (methodName: string, clientId: string, agentName: AgentName) => Promise<string>;
2045
2064
  /**
2046
2065
  * Commits tool output to the agent.
2047
2066
  * @param {string} toolId - The `tool_call_id` for openai history
@@ -2050,7 +2069,7 @@ declare class AgentPublicService implements TAgentConnectionService {
2050
2069
  * @param {AgentName} agentName - The name of the agent.
2051
2070
  * @returns {Promise<unknown>} The commit result.
2052
2071
  */
2053
- commitToolOutput: (toolId: string, content: string, requestId: string, clientId: string, agentName: AgentName) => Promise<void>;
2072
+ commitToolOutput: (toolId: string, content: string, methodName: string, clientId: string, agentName: AgentName) => Promise<void>;
2054
2073
  /**
2055
2074
  * Commits a system message to the agent.
2056
2075
  * @param {string} message - The message to commit.
@@ -2058,7 +2077,7 @@ declare class AgentPublicService implements TAgentConnectionService {
2058
2077
  * @param {AgentName} agentName - The name of the agent.
2059
2078
  * @returns {Promise<unknown>} The commit result.
2060
2079
  */
2061
- commitSystemMessage: (message: string, requestId: string, clientId: string, agentName: AgentName) => Promise<void>;
2080
+ commitSystemMessage: (message: string, methodName: string, clientId: string, agentName: AgentName) => Promise<void>;
2062
2081
  /**
2063
2082
  * Commits user message to the agent without answer.
2064
2083
  * @param {string} message - The message to commit.
@@ -2066,28 +2085,28 @@ declare class AgentPublicService implements TAgentConnectionService {
2066
2085
  * @param {AgentName} agentName - The name of the agent.
2067
2086
  * @returns {Promise<unknown>} The commit result.
2068
2087
  */
2069
- commitUserMessage: (message: string, requestId: string, clientId: string, agentName: AgentName) => Promise<void>;
2088
+ commitUserMessage: (message: string, methodName: string, clientId: string, agentName: AgentName) => Promise<void>;
2070
2089
  /**
2071
2090
  * Commits flush of agent history
2072
2091
  * @param {string} clientId - The client ID.
2073
2092
  * @param {AgentName} agentName - The name of the agent.
2074
2093
  * @returns {Promise<unknown>} The commit result.
2075
2094
  */
2076
- commitFlush: (requestId: string, clientId: string, agentName: AgentName) => Promise<void>;
2095
+ commitFlush: (methodName: string, clientId: string, agentName: AgentName) => Promise<void>;
2077
2096
  /**
2078
2097
  * Commits change of agent to prevent the next tool execution from being called.
2079
2098
  * @param {string} clientId - The client ID.
2080
2099
  * @param {AgentName} agentName - The name of the agent.
2081
2100
  * @returns {Promise<unknown>} The commit result.
2082
2101
  */
2083
- commitAgentChange: (requestId: string, clientId: string, agentName: AgentName) => Promise<void>;
2102
+ commitAgentChange: (methodName: string, clientId: string, agentName: AgentName) => Promise<void>;
2084
2103
  /**
2085
2104
  * Disposes of the agent.
2086
2105
  * @param {string} clientId - The client ID.
2087
2106
  * @param {AgentName} agentName - The name of the agent.
2088
2107
  * @returns {Promise<unknown>} The dispose result.
2089
2108
  */
2090
- dispose: (requestId: string, clientId: string, agentName: AgentName) => Promise<void>;
2109
+ dispose: (methodName: string, clientId: string, agentName: AgentName) => Promise<void>;
2091
2110
  }
2092
2111
 
2093
2112
  interface IHistoryConnectionService extends HistoryConnectionService {
@@ -2112,7 +2131,7 @@ declare class HistoryPublicService implements THistoryConnectionService {
2112
2131
  * @param {AgentName} agentName - The agent name.
2113
2132
  * @returns {Promise<void>} A promise that resolves when the operation is complete.
2114
2133
  */
2115
- push: (message: IModelMessage, requestId: string, clientId: string, agentName: AgentName) => Promise<void>;
2134
+ push: (message: IModelMessage, methodName: string, clientId: string, agentName: AgentName) => Promise<void>;
2116
2135
  /**
2117
2136
  * Converts history to an array for a specific agent.
2118
2137
  * @param {string} prompt - The prompt.
@@ -2120,21 +2139,21 @@ declare class HistoryPublicService implements THistoryConnectionService {
2120
2139
  * @param {AgentName} agentName - The agent name.
2121
2140
  * @returns {Promise<any[]>} A promise that resolves to an array of history items.
2122
2141
  */
2123
- toArrayForAgent: (prompt: string, requestId: string, clientId: string, agentName: AgentName) => Promise<IModelMessage[]>;
2142
+ toArrayForAgent: (prompt: string, methodName: string, clientId: string, agentName: AgentName) => Promise<IModelMessage[]>;
2124
2143
  /**
2125
2144
  * Converts history to a raw array.
2126
2145
  * @param {string} clientId - The client ID.
2127
2146
  * @param {AgentName} agentName - The agent name.
2128
2147
  * @returns {Promise<any[]>} A promise that resolves to a raw array of history items.
2129
2148
  */
2130
- toArrayForRaw: (requestId: string, clientId: string, agentName: AgentName) => Promise<IModelMessage[]>;
2149
+ toArrayForRaw: (methodName: string, clientId: string, agentName: AgentName) => Promise<IModelMessage[]>;
2131
2150
  /**
2132
2151
  * Disposes of the history.
2133
2152
  * @param {string} clientId - The client ID.
2134
2153
  * @param {AgentName} agentName - The agent name.
2135
2154
  * @returns {Promise<void>} A promise that resolves when the operation is complete.
2136
2155
  */
2137
- dispose: (requestId: string, clientId: string, agentName: AgentName) => Promise<void>;
2156
+ dispose: (methodName: string, clientId: string, agentName: AgentName) => Promise<void>;
2138
2157
  }
2139
2158
 
2140
2159
  interface ISessionConnectionService extends SessionConnectionService {
@@ -2158,7 +2177,7 @@ declare class SessionPublicService implements TSessionConnectionService {
2158
2177
  * @param {SwarmName} swarmName - The swarm name.
2159
2178
  * @returns {Promise<void>}
2160
2179
  */
2161
- emit: (content: string, requestId: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2180
+ emit: (content: string, methodName: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2162
2181
  /**
2163
2182
  * Executes a command in the session.
2164
2183
  * @param {string} content - The content to execute.
@@ -2166,7 +2185,7 @@ declare class SessionPublicService implements TSessionConnectionService {
2166
2185
  * @param {SwarmName} swarmName - The swarm name.
2167
2186
  * @returns {Promise<void>}
2168
2187
  */
2169
- execute: (content: string, mode: ExecutionMode, requestId: string, clientId: string, swarmName: SwarmName) => Promise<string>;
2188
+ execute: (content: string, mode: ExecutionMode, methodName: string, clientId: string, swarmName: SwarmName) => Promise<string>;
2170
2189
  /**
2171
2190
  * Connects to the session.
2172
2191
  * @param {SendMessageFn} connector - The function to send messages.
@@ -2174,7 +2193,7 @@ declare class SessionPublicService implements TSessionConnectionService {
2174
2193
  * @param {SwarmName} swarmName - The swarm name.
2175
2194
  * @returns {ReceiveMessageFn}
2176
2195
  */
2177
- connect: (connector: SendMessageFn$1, requestId: string, clientId: string, swarmName: SwarmName) => ReceiveMessageFn;
2196
+ connect: (connector: SendMessageFn$1, methodName: string, clientId: string, swarmName: SwarmName) => ReceiveMessageFn;
2178
2197
  /**
2179
2198
  * Commits tool output to the session.
2180
2199
  * @param {string} toolId - The `tool_call_id` for openai history
@@ -2183,7 +2202,7 @@ declare class SessionPublicService implements TSessionConnectionService {
2183
2202
  * @param {SwarmName} swarmName - The swarm name.
2184
2203
  * @returns {Promise<void>}
2185
2204
  */
2186
- commitToolOutput: (toolId: string, content: string, requestId: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2205
+ commitToolOutput: (toolId: string, content: string, methodName: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2187
2206
  /**
2188
2207
  * Commits a system message to the session.
2189
2208
  * @param {string} message - The message to commit.
@@ -2191,7 +2210,7 @@ declare class SessionPublicService implements TSessionConnectionService {
2191
2210
  * @param {SwarmName} swarmName - The swarm name.
2192
2211
  * @returns {Promise<void>}
2193
2212
  */
2194
- commitSystemMessage: (message: string, requestId: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2213
+ commitSystemMessage: (message: string, methodName: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2195
2214
  /**
2196
2215
  * Commits user message to the agent without answer.
2197
2216
  * @param {string} message - The message to commit.
@@ -2199,21 +2218,21 @@ declare class SessionPublicService implements TSessionConnectionService {
2199
2218
  * @param {SwarmName} swarmName - The swarm name.
2200
2219
  * @returns {Promise<void>}
2201
2220
  */
2202
- commitUserMessage: (message: string, requestId: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2221
+ commitUserMessage: (message: string, methodName: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2203
2222
  /**
2204
2223
  * Commits flush of agent history
2205
2224
  * @param {string} clientId - The client ID.
2206
2225
  * @param {SwarmName} swarmName - The swarm name.
2207
2226
  * @returns {Promise<void>}
2208
2227
  */
2209
- commitFlush: (requestId: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2228
+ commitFlush: (methodName: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2210
2229
  /**
2211
2230
  * Disposes of the session.
2212
2231
  * @param {string} clientId - The client ID.
2213
2232
  * @param {SwarmName} swarmName - The swarm name.
2214
2233
  * @returns {Promise<void>}
2215
2234
  */
2216
- dispose: (requestId: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2235
+ dispose: (methodName: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2217
2236
  }
2218
2237
 
2219
2238
  interface ISwarmConnectionService extends SwarmConnectionService {
@@ -2236,28 +2255,28 @@ declare class SwarmPublicService implements TSwarmConnectionService {
2236
2255
  * @param {SwarmName} swarmName - The swarm name.
2237
2256
  * @returns {Promise<void>}
2238
2257
  */
2239
- cancelOutput: (requestId: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2258
+ cancelOutput: (methodName: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2240
2259
  /**
2241
2260
  * Waits for output from the swarm.
2242
2261
  * @param {string} clientId - The client ID.
2243
2262
  * @param {SwarmName} swarmName - The swarm name.
2244
2263
  * @returns {Promise<void>}
2245
2264
  */
2246
- waitForOutput: (requestId: string, clientId: string, swarmName: SwarmName) => Promise<string>;
2265
+ waitForOutput: (methodName: string, clientId: string, swarmName: SwarmName) => Promise<string>;
2247
2266
  /**
2248
2267
  * Gets the agent name from the swarm.
2249
2268
  * @param {string} clientId - The client ID.
2250
2269
  * @param {SwarmName} swarmName - The swarm name.
2251
2270
  * @returns {Promise<string>}
2252
2271
  */
2253
- getAgentName: (requestId: string, clientId: string, swarmName: SwarmName) => Promise<string>;
2272
+ getAgentName: (methodName: string, clientId: string, swarmName: SwarmName) => Promise<string>;
2254
2273
  /**
2255
2274
  * Gets the agent from the swarm.
2256
2275
  * @param {string} clientId - The client ID.
2257
2276
  * @param {SwarmName} swarmName - The swarm name.
2258
2277
  * @returns {Promise<IAgent>}
2259
2278
  */
2260
- getAgent: (requestId: string, clientId: string, swarmName: SwarmName) => Promise<IAgent>;
2279
+ getAgent: (methodName: string, clientId: string, swarmName: SwarmName) => Promise<IAgent>;
2261
2280
  /**
2262
2281
  * Sets the agent reference in the swarm.
2263
2282
  * @param {string} clientId - The client ID.
@@ -2266,7 +2285,7 @@ declare class SwarmPublicService implements TSwarmConnectionService {
2266
2285
  * @param {IAgent} agent - The agent instance.
2267
2286
  * @returns {Promise<void>}
2268
2287
  */
2269
- setAgentRef: (requestId: string, clientId: string, swarmName: SwarmName, agentName: AgentName, agent: IAgent) => Promise<void>;
2288
+ setAgentRef: (methodName: string, clientId: string, swarmName: SwarmName, agentName: AgentName, agent: IAgent) => Promise<void>;
2270
2289
  /**
2271
2290
  * Sets the agent name in the swarm.
2272
2291
  * @param {AgentName} agentName - The agent name.
@@ -2274,14 +2293,14 @@ declare class SwarmPublicService implements TSwarmConnectionService {
2274
2293
  * @param {SwarmName} swarmName - The swarm name.
2275
2294
  * @returns {Promise<void>}
2276
2295
  */
2277
- setAgentName: (agentName: AgentName, requestId: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2296
+ setAgentName: (agentName: AgentName, methodName: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2278
2297
  /**
2279
2298
  * Disposes of the swarm.
2280
2299
  * @param {string} clientId - The client ID.
2281
2300
  * @param {SwarmName} swarmName - The swarm name.
2282
2301
  * @returns {Promise<void>}
2283
2302
  */
2284
- dispose: (requestId: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2303
+ dispose: (methodName: string, clientId: string, swarmName: SwarmName) => Promise<void>;
2285
2304
  }
2286
2305
 
2287
2306
  /**
@@ -2639,7 +2658,7 @@ declare class ClientStorage<T extends IStorageData = IStorageData> implements IS
2639
2658
  declare class StorageConnectionService implements IStorage {
2640
2659
  private readonly loggerService;
2641
2660
  private readonly busService;
2642
- private readonly contextService;
2661
+ private readonly methodContextService;
2643
2662
  private readonly storageSchemaService;
2644
2663
  private readonly sessionValidationService;
2645
2664
  private readonly embeddingSchemaService;
@@ -2721,43 +2740,43 @@ declare class StoragePublicService implements TStorageConnectionService {
2721
2740
  * @param {number} total - The total number of items to retrieve.
2722
2741
  * @returns {Promise<IStorageData[]>} The list of storage data.
2723
2742
  */
2724
- take: (search: string, total: number, requestId: string, clientId: string, storageName: StorageName, score?: number) => Promise<IStorageData[]>;
2743
+ take: (search: string, total: number, methodName: string, clientId: string, storageName: StorageName, score?: number) => Promise<IStorageData[]>;
2725
2744
  /**
2726
2745
  * Upserts an item in the storage.
2727
2746
  * @param {IStorageData} item - The item to upsert.
2728
2747
  * @returns {Promise<void>}
2729
2748
  */
2730
- upsert: (item: IStorageData, requestId: string, clientId: string, storageName: StorageName) => Promise<void>;
2749
+ upsert: (item: IStorageData, methodName: string, clientId: string, storageName: StorageName) => Promise<void>;
2731
2750
  /**
2732
2751
  * Removes an item from the storage.
2733
2752
  * @param {IStorageData["id"]} itemId - The ID of the item to remove.
2734
2753
  * @returns {Promise<void>}
2735
2754
  */
2736
- remove: (itemId: IStorageData["id"], requestId: string, clientId: string, storageName: StorageName) => Promise<void>;
2755
+ remove: (itemId: IStorageData["id"], methodName: string, clientId: string, storageName: StorageName) => Promise<void>;
2737
2756
  /**
2738
2757
  * Retrieves an item from the storage by its ID.
2739
2758
  * @param {IStorageData["id"]} itemId - The ID of the item to retrieve.
2740
2759
  * @returns {Promise<IStorageData>} The retrieved item.
2741
2760
  */
2742
- get: (itemId: IStorageData["id"], requestId: string, clientId: string, storageName: StorageName) => Promise<IStorageData | null>;
2761
+ get: (itemId: IStorageData["id"], methodName: string, clientId: string, storageName: StorageName) => Promise<IStorageData | null>;
2743
2762
  /**
2744
2763
  * Retrieves a list of items from the storage, optionally filtered by a predicate function.
2745
2764
  * @param {function(IStorageData): boolean} [filter] - The optional filter function.
2746
2765
  * @returns {Promise<IStorageData[]>} The list of items.
2747
2766
  */
2748
- list: (requestId: string, clientId: string, storageName: StorageName, filter?: (item: IStorageData) => boolean) => Promise<IStorageData[]>;
2767
+ list: (methodName: string, clientId: string, storageName: StorageName, filter?: (item: IStorageData) => boolean) => Promise<IStorageData[]>;
2749
2768
  /**
2750
2769
  * Clears all items from the storage.
2751
2770
  * @returns {Promise<void>}
2752
2771
  */
2753
- clear: (requestId: string, clientId: string, storageName: StorageName) => Promise<void>;
2772
+ clear: (methodName: string, clientId: string, storageName: StorageName) => Promise<void>;
2754
2773
  /**
2755
2774
  * Disposes of the storage.
2756
2775
  * @param {string} clientId - The client ID.
2757
2776
  * @param {StorageName} storageName - The storage name.
2758
2777
  * @returns {Promise<void>}
2759
2778
  */
2760
- dispose: (requestId: string, clientId: string, storageName: StorageName) => Promise<void>;
2779
+ dispose: (methodName: string, clientId: string, storageName: StorageName) => Promise<void>;
2761
2780
  }
2762
2781
 
2763
2782
  /**
@@ -2851,7 +2870,7 @@ declare class ClientState<State extends IStateData = IStateData> implements ISta
2851
2870
  declare class StateConnectionService<T extends IStateData = IStateData> implements IState<T> {
2852
2871
  private readonly loggerService;
2853
2872
  private readonly busService;
2854
- private readonly contextService;
2873
+ private readonly methodContextService;
2855
2874
  private readonly stateSchemaService;
2856
2875
  private readonly sessionValidationService;
2857
2876
  /**
@@ -2905,21 +2924,21 @@ declare class StatePublicService<T extends IStateData = IStateData> implements T
2905
2924
  * @param {StateName} stateName - The name of the state.
2906
2925
  * @returns {Promise<T>} - The updated state.
2907
2926
  */
2908
- setState: (dispatchFn: (prevState: T) => Promise<T>, requestId: string, clientId: string, stateName: StateName) => Promise<T>;
2927
+ setState: (dispatchFn: (prevState: T) => Promise<T>, methodName: string, clientId: string, stateName: StateName) => Promise<T>;
2909
2928
  /**
2910
2929
  * Gets the current state.
2911
2930
  * @param {string} clientId - The client ID.
2912
2931
  * @param {StateName} stateName - The name of the state.
2913
2932
  * @returns {Promise<T>} - The current state.
2914
2933
  */
2915
- getState: (requestId: string, clientId: string, stateName: StateName) => Promise<T>;
2934
+ getState: (methodName: string, clientId: string, stateName: StateName) => Promise<T>;
2916
2935
  /**
2917
2936
  * Disposes the state.
2918
2937
  * @param {string} clientId - The client ID.
2919
2938
  * @param {StateName} stateName - The name of the state.
2920
2939
  * @returns {Promise<void>} - A promise that resolves when the state is disposed.
2921
2940
  */
2922
- dispose: (requestId: string, clientId: string, stateName: StateName) => Promise<void>;
2941
+ dispose: (methodName: string, clientId: string, stateName: StateName) => Promise<void>;
2923
2942
  }
2924
2943
 
2925
2944
  /**
@@ -3005,11 +3024,14 @@ declare const swarm: {
3005
3024
  sessionConnectionService: SessionConnectionService;
3006
3025
  storageConnectionService: StorageConnectionService;
3007
3026
  stateConnectionService: StateConnectionService<any>;
3027
+ methodContextService: {
3028
+ readonly context: IMethodContext;
3029
+ };
3030
+ executionContextService: {
3031
+ readonly context: IExecutionContext;
3032
+ };
3008
3033
  busService: BusService;
3009
3034
  loggerService: LoggerService;
3010
- contextService: {
3011
- readonly context: IContext;
3012
- };
3013
3035
  };
3014
3036
 
3015
3037
  /**
@@ -3160,7 +3182,7 @@ declare const session: {
3160
3182
  * @returns {TComplete} complete - A function to complete the session with content.
3161
3183
  * @returns {Function} dispose - A function to dispose of the session.
3162
3184
  */
3163
- scheduled(clientId: string, swarmName: SwarmName, { delay, }?: Partial<ISessionConfig>): {
3185
+ scheduled(clientId: string, swarmName: SwarmName, { delay }?: Partial<ISessionConfig>): {
3164
3186
  /**
3165
3187
  * Completes the scheduled session with the given content.
3166
3188
  *
@@ -3193,7 +3215,7 @@ interface ISessionConfig {
3193
3215
  * @param {SwarmName} swarmName - The name of the swarm.
3194
3216
  * @returns {Promise<void>} A promise that resolves when the connection is disposed.
3195
3217
  */
3196
- declare const disposeConnection: (clientId: string, swarmName: SwarmName, requestId?: string) => Promise<void>;
3218
+ declare const disposeConnection: (clientId: string, swarmName: SwarmName, methodName?: string) => Promise<void>;
3197
3219
 
3198
3220
  /**
3199
3221
  * Retrieves the raw history as it is for a given client ID without any modifications.
@@ -3201,7 +3223,7 @@ declare const disposeConnection: (clientId: string, swarmName: SwarmName, reques
3201
3223
  * @param {string} clientId - The ID of the client whose history is to be retrieved.
3202
3224
  * @returns {Promise<Array>} A promise that resolves to an array containing the raw history.
3203
3225
  */
3204
- declare const getRawHistory: (clientId: string, requestId?: string) => Promise<IModelMessage[]>;
3226
+ declare const getRawHistory: (clientId: string, methodName?: string) => Promise<IModelMessage[]>;
3205
3227
 
3206
3228
  /**
3207
3229
  * Retrieves the history prepared for a specific agent with resque algorithm tweaks
@@ -3737,4 +3759,4 @@ declare class LoggerUtils {
3737
3759
  */
3738
3760
  declare const Logger: LoggerUtils;
3739
3761
 
3740
- export { ContextService, type EventSource, History, HistoryAdapter, HistoryInstance, type IAgentSchema, type IAgentTool, type IBaseEvent, type IBusEvent, type IBusEventContext, type ICompletionArgs, type ICompletionSchema, type ICustomEvent, type IEmbeddingSchema, type IHistoryAdapter, type IHistoryInstance, type IHistoryInstanceCallbacks, type IIncomingMessage, type IMakeConnectionConfig, type IMakeDisposeParams, type IModelMessage, type IOutgoingMessage, type ISessionConfig, type IStateSchema, type IStorageSchema, type ISwarmSchema, type ITool, type IToolCall, Logger, type ReceiveMessageFn, type SendMessageFn$1 as SendMessageFn, State, Storage, addAgent, addCompletion, addEmbedding, addState, addStorage, addSwarm, addTool, cancelOutput, cancelOutputForce, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, emit, emitForce, event, execute, executeForce, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, listenAgentEvent, listenAgentEventOnce, listenEvent, listenEventOnce, listenHistoryEvent, listenHistoryEventOnce, listenSessionEvent, listenSessionEventOnce, listenStateEvent, listenStateEventOnce, listenStorageEvent, listenStorageEventOnce, listenSwarmEvent, listenSwarmEventOnce, makeAutoDispose, makeConnection, session, setConfig, swarm };
3762
+ export { type EventSource, ExecutionContextService, History, HistoryAdapter, HistoryInstance, type IAgentSchema, type IAgentTool, type IBaseEvent, type IBusEvent, type IBusEventContext, type ICompletionArgs, type ICompletionSchema, type ICustomEvent, type IEmbeddingSchema, type IHistoryAdapter, type IHistoryInstance, type IHistoryInstanceCallbacks, type IIncomingMessage, type IMakeConnectionConfig, type IMakeDisposeParams, type IModelMessage, type IOutgoingMessage, type ISessionConfig, type IStateSchema, type IStorageSchema, type ISwarmSchema, type ITool, type IToolCall, Logger, MethodContextService, type ReceiveMessageFn, type SendMessageFn$1 as SendMessageFn, State, Storage, addAgent, addCompletion, addEmbedding, addState, addStorage, addSwarm, addTool, cancelOutput, cancelOutputForce, changeAgent, commitFlush, commitFlushForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitUserMessage, commitUserMessageForce, complete, disposeConnection, emit, emitForce, event, execute, executeForce, getAgentHistory, getAgentName, getAssistantHistory, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getRawHistory, getSessionMode, getUserHistory, listenAgentEvent, listenAgentEventOnce, listenEvent, listenEventOnce, listenHistoryEvent, listenHistoryEventOnce, listenSessionEvent, listenSessionEventOnce, listenStateEvent, listenStateEventOnce, listenStorageEvent, listenStorageEventOnce, listenSwarmEvent, listenSwarmEventOnce, makeAutoDispose, makeConnection, session, setConfig, swarm };