@agentxjs/core 1.9.10-dev → 2.0.1
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/README.md +342 -0
- package/dist/{Processor-DT0N1qI6.d.ts → Processor-CeMyXtsX.d.ts} +1 -1
- package/dist/RpcClient-CMdhJxjS.d.ts +304 -0
- package/dist/agent/engine/internal/index.d.ts +22 -18
- package/dist/agent/engine/internal/index.js +1 -2
- package/dist/agent/engine/mealy/index.d.ts +4 -4
- package/dist/agent/engine/mealy/index.js +1 -2
- package/dist/agent/index.d.ts +92 -92
- package/dist/agent/index.js +16 -16
- package/dist/agent/types/index.d.ts +4 -4
- package/dist/agent/types/index.js +1 -2
- package/dist/bash/index.d.ts +29 -0
- package/dist/bash/index.js +7 -0
- package/dist/{bus-uF1DM2ox.d.ts → bus-C9FLWIu8.d.ts} +3 -1
- package/dist/{chunk-E5FPOAPO.js → chunk-22NTRYNO.js} +60 -60
- package/dist/chunk-22NTRYNO.js.map +1 -0
- package/dist/{chunk-7ZDX3O6I.js → chunk-AAFPAF67.js} +2 -2
- package/dist/{chunk-7ZDX3O6I.js.map → chunk-AAFPAF67.js.map} +1 -1
- package/dist/{chunk-EKHT54KN.js → chunk-APCBNCOW.js} +1 -1
- package/dist/{chunk-EKHT54KN.js.map → chunk-APCBNCOW.js.map} +1 -1
- package/dist/chunk-BHOD5PKR.js +55 -0
- package/dist/chunk-BHOD5PKR.js.map +1 -0
- package/dist/chunk-FI7WQFGV.js +37 -0
- package/dist/chunk-FI7WQFGV.js.map +1 -0
- package/dist/{chunk-AT5P47YA.js → chunk-RWIYC65R.js} +115 -115
- package/dist/chunk-RWIYC65R.js.map +1 -0
- package/dist/chunk-SKS7S2RY.js +1 -0
- package/dist/{chunk-I7GYR3MN.js → chunk-TUFZ2YH6.js} +77 -91
- package/dist/chunk-TUFZ2YH6.js.map +1 -0
- package/dist/{chunk-K6WXQ2RW.js → chunk-YSZG6XIM.js} +1 -2
- package/dist/chunk-YSZG6XIM.js.map +1 -0
- package/dist/{combinators-nEa5dD0T.d.ts → combinators-Dy-7lxKV.d.ts} +50 -50
- package/dist/common/logger/index.js +14 -16
- package/dist/common/logger/index.js.map +1 -1
- package/dist/container/index.d.ts +3 -4
- package/dist/container/index.js +0 -2
- package/dist/container/index.js.map +1 -1
- package/dist/driver/index.d.ts +2 -310
- package/dist/event/index.d.ts +4 -4
- package/dist/event/index.js +2 -3
- package/dist/event/types/index.d.ts +202 -208
- package/dist/event/types/index.js +1 -2
- package/dist/{event-CDuTzs__.d.ts → event-DNsF9EkO.d.ts} +5 -8
- package/dist/image/index.d.ts +9 -5
- package/dist/image/index.js +5 -2
- package/dist/image/index.js.map +1 -1
- package/dist/index--gxNpY5W.d.ts +609 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +17 -17
- package/dist/{message-BMrMm1pq.d.ts → message-Dn-I2vr0.d.ts} +10 -33
- package/dist/mq/index.d.ts +25 -25
- package/dist/mq/index.js +1 -3
- package/dist/mq/index.js.map +1 -1
- package/dist/network/index.d.ts +59 -347
- package/dist/network/index.js +30 -41
- package/dist/network/index.js.map +1 -1
- package/dist/persistence/index.d.ts +2 -155
- package/dist/platform/index.d.ts +76 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/runtime/index.d.ts +26 -59
- package/dist/runtime/index.js +117 -33
- package/dist/runtime/index.js.map +1 -1
- package/dist/session/index.d.ts +4 -52
- package/dist/session/index.js +4 -51
- package/dist/session/index.js.map +1 -1
- package/dist/types-Cb8tKM6Y.d.ts +90 -0
- package/package.json +10 -5
- package/src/agent/AgentStateMachine.ts +2 -2
- package/src/agent/__tests__/AgentStateMachine.test.ts +2 -2
- package/src/agent/__tests__/createAgent.test.ts +4 -4
- package/src/agent/__tests__/engine/internal/messageAssemblerProcessor.test.ts +301 -97
- package/src/agent/__tests__/engine/internal/stateEventProcessor.test.ts +6 -6
- package/src/agent/__tests__/engine/internal/turnTrackerProcessor.test.ts +59 -78
- package/src/agent/__tests__/engine/mealy/Mealy.test.ts +3 -3
- package/src/agent/__tests__/engine/mealy/Store.test.ts +1 -1
- package/src/agent/__tests__/engine/mealy/combinators.test.ts +4 -4
- package/src/agent/createAgent.ts +15 -15
- package/src/agent/engine/AgentProcessor.ts +7 -7
- package/src/agent/engine/MealyMachine.ts +4 -4
- package/src/agent/engine/internal/index.ts +11 -11
- package/src/agent/engine/internal/messageAssemblerProcessor.ts +113 -128
- package/src/agent/engine/internal/stateEventProcessor.ts +13 -15
- package/src/agent/engine/internal/turnTrackerProcessor.ts +27 -31
- package/src/agent/engine/mealy/Mealy.ts +2 -2
- package/src/agent/engine/mealy/combinators.ts +10 -10
- package/src/agent/engine/mealy/index.ts +9 -11
- package/src/agent/index.ts +30 -32
- package/src/agent/types/engine.ts +3 -3
- package/src/agent/types/event.ts +4 -12
- package/src/agent/types/index.ts +86 -88
- package/src/agent/types/message.ts +9 -43
- package/src/bash/index.ts +21 -0
- package/src/bash/tool.ts +57 -0
- package/src/bash/types.ts +108 -0
- package/src/common/logger/ConsoleLogger.ts +1 -1
- package/src/common/logger/LoggerFactoryImpl.ts +14 -14
- package/src/common/logger/index.ts +3 -3
- package/src/container/index.ts +4 -5
- package/src/container/types.ts +1 -1
- package/src/driver/index.ts +15 -16
- package/src/driver/types.ts +201 -73
- package/src/event/EventBus.ts +10 -10
- package/src/event/__tests__/EventBus.test.ts +2 -2
- package/src/event/index.ts +2 -3
- package/src/event/types/agent.ts +186 -191
- package/src/event/types/bus.ts +1 -1
- package/src/event/types/command.ts +293 -264
- package/src/event/types/container.ts +207 -222
- package/src/event/types/driver.ts +153 -155
- package/src/event/types/index.ts +6 -12
- package/src/event/types/session.ts +117 -130
- package/src/image/Image.ts +12 -2
- package/src/image/index.ts +4 -5
- package/src/image/types.ts +8 -2
- package/src/mq/OffsetGenerator.ts +1 -1
- package/src/mq/__tests__/OffsetGenerator.test.ts +1 -1
- package/src/mq/index.ts +4 -5
- package/src/network/RpcClient.ts +26 -25
- package/src/network/index.ts +41 -44
- package/src/network/jsonrpc.ts +5 -5
- package/src/persistence/index.ts +5 -5
- package/src/persistence/types.ts +5 -2
- package/src/platform/index.ts +21 -0
- package/src/platform/types.ts +84 -0
- package/src/runtime/AgentXRuntime.ts +188 -61
- package/src/runtime/__tests__/AgentXRuntime.test.ts +343 -0
- package/src/runtime/index.ts +12 -25
- package/src/runtime/types.ts +10 -62
- package/src/session/index.ts +2 -3
- package/dist/chunk-7D4SUZUM.js +0 -38
- package/dist/chunk-AT5P47YA.js.map +0 -1
- package/dist/chunk-E5FPOAPO.js.map +0 -1
- package/dist/chunk-I7GYR3MN.js.map +0 -1
- package/dist/chunk-K6WXQ2RW.js.map +0 -1
- package/dist/workspace/index.d.ts +0 -111
- package/dist/wrapper-Y3UTVU2E.js +0 -3635
- package/dist/wrapper-Y3UTVU2E.js.map +0 -1
- package/src/workspace/index.ts +0 -27
- package/src/workspace/types.ts +0 -131
- /package/dist/{workspace → bash}/index.js.map +0 -0
- /package/dist/{chunk-7D4SUZUM.js.map → chunk-SKS7S2RY.js.map} +0 -0
- /package/dist/{workspace → platform}/index.js +0 -0
|
@@ -13,62 +13,61 @@ import type { SystemEvent } from "./base";
|
|
|
13
13
|
/**
|
|
14
14
|
* Base ContainerLifecycleEvent
|
|
15
15
|
*/
|
|
16
|
-
interface BaseContainerLifecycleEvent<T extends string, D = unknown>
|
|
17
|
-
T,
|
|
18
|
-
D,
|
|
19
|
-
"container",
|
|
20
|
-
"lifecycle",
|
|
21
|
-
"notification"
|
|
22
|
-
> {}
|
|
16
|
+
interface BaseContainerLifecycleEvent<T extends string, D = unknown>
|
|
17
|
+
extends SystemEvent<T, D, "container", "lifecycle", "notification"> {}
|
|
23
18
|
|
|
24
19
|
/**
|
|
25
20
|
* ContainerCreatedEvent - Container was created
|
|
26
21
|
*/
|
|
27
|
-
export interface ContainerCreatedEvent
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
export interface ContainerCreatedEvent
|
|
23
|
+
extends BaseContainerLifecycleEvent<
|
|
24
|
+
"container_created",
|
|
25
|
+
{
|
|
26
|
+
containerId: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
createdAt: number;
|
|
29
|
+
}
|
|
30
|
+
> {}
|
|
35
31
|
|
|
36
32
|
/**
|
|
37
33
|
* ContainerDestroyedEvent - Container was destroyed
|
|
38
34
|
*/
|
|
39
|
-
export interface ContainerDestroyedEvent
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
export interface ContainerDestroyedEvent
|
|
36
|
+
extends BaseContainerLifecycleEvent<
|
|
37
|
+
"container_destroyed",
|
|
38
|
+
{
|
|
39
|
+
containerId: string;
|
|
40
|
+
reason?: string;
|
|
41
|
+
agentCount: number;
|
|
42
|
+
}
|
|
43
|
+
> {}
|
|
47
44
|
|
|
48
45
|
/**
|
|
49
46
|
* AgentRegisteredEvent - Agent was registered to container
|
|
50
47
|
*/
|
|
51
|
-
export interface AgentRegisteredEvent
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
export interface AgentRegisteredEvent
|
|
49
|
+
extends BaseContainerLifecycleEvent<
|
|
50
|
+
"agent_registered",
|
|
51
|
+
{
|
|
52
|
+
containerId: string;
|
|
53
|
+
agentId: string;
|
|
54
|
+
definitionName: string;
|
|
55
|
+
registeredAt: number;
|
|
56
|
+
}
|
|
57
|
+
> {}
|
|
60
58
|
|
|
61
59
|
/**
|
|
62
60
|
* AgentUnregisteredEvent - Agent was unregistered from container
|
|
63
61
|
*/
|
|
64
|
-
export interface AgentUnregisteredEvent
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
export interface AgentUnregisteredEvent
|
|
63
|
+
extends BaseContainerLifecycleEvent<
|
|
64
|
+
"agent_unregistered",
|
|
65
|
+
{
|
|
66
|
+
containerId: string;
|
|
67
|
+
agentId: string;
|
|
68
|
+
reason?: string;
|
|
69
|
+
}
|
|
70
|
+
> {}
|
|
72
71
|
|
|
73
72
|
/**
|
|
74
73
|
* ContainerLifecycleEvent - All container lifecycle events
|
|
@@ -96,147 +95,141 @@ export function isContainerLifecycleEvent(event: {
|
|
|
96
95
|
/**
|
|
97
96
|
* Base WorkdirRequest
|
|
98
97
|
*/
|
|
99
|
-
interface BaseWorkdirRequest<T extends string, D = unknown>
|
|
100
|
-
T,
|
|
101
|
-
D,
|
|
102
|
-
"sandbox",
|
|
103
|
-
"workdir",
|
|
104
|
-
"request"
|
|
105
|
-
> {}
|
|
98
|
+
interface BaseWorkdirRequest<T extends string, D = unknown>
|
|
99
|
+
extends SystemEvent<T, D, "sandbox", "workdir", "request"> {}
|
|
106
100
|
|
|
107
101
|
/**
|
|
108
102
|
* Base WorkdirResult
|
|
109
103
|
*/
|
|
110
|
-
interface BaseWorkdirResult<T extends string, D = unknown>
|
|
111
|
-
T,
|
|
112
|
-
D,
|
|
113
|
-
"sandbox",
|
|
114
|
-
"workdir",
|
|
115
|
-
"result"
|
|
116
|
-
> {}
|
|
104
|
+
interface BaseWorkdirResult<T extends string, D = unknown>
|
|
105
|
+
extends SystemEvent<T, D, "sandbox", "workdir", "result"> {}
|
|
117
106
|
|
|
118
107
|
/**
|
|
119
108
|
* Base WorkdirNotification
|
|
120
109
|
*/
|
|
121
|
-
interface BaseWorkdirNotification<T extends string, D = unknown>
|
|
122
|
-
T,
|
|
123
|
-
D,
|
|
124
|
-
"sandbox",
|
|
125
|
-
"workdir",
|
|
126
|
-
"notification"
|
|
127
|
-
> {}
|
|
110
|
+
interface BaseWorkdirNotification<T extends string, D = unknown>
|
|
111
|
+
extends SystemEvent<T, D, "sandbox", "workdir", "notification"> {}
|
|
128
112
|
|
|
129
113
|
/**
|
|
130
114
|
* FileReadRequest - Request to read a file
|
|
131
115
|
*/
|
|
132
|
-
export interface FileReadRequest
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
116
|
+
export interface FileReadRequest
|
|
117
|
+
extends BaseWorkdirRequest<
|
|
118
|
+
"file_read_request",
|
|
119
|
+
{
|
|
120
|
+
path: string;
|
|
121
|
+
encoding?: string;
|
|
122
|
+
}
|
|
123
|
+
> {}
|
|
139
124
|
|
|
140
125
|
/**
|
|
141
126
|
* FileReadResult - File read result
|
|
142
127
|
*/
|
|
143
|
-
export interface FileReadResult
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
128
|
+
export interface FileReadResult
|
|
129
|
+
extends BaseWorkdirResult<
|
|
130
|
+
"file_read_result",
|
|
131
|
+
{
|
|
132
|
+
path: string;
|
|
133
|
+
content: string;
|
|
134
|
+
size: number;
|
|
135
|
+
encoding: string;
|
|
136
|
+
}
|
|
137
|
+
> {}
|
|
152
138
|
|
|
153
139
|
/**
|
|
154
140
|
* FileWriteRequest - Request to write a file
|
|
155
141
|
*/
|
|
156
|
-
export interface FileWriteRequest
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
142
|
+
export interface FileWriteRequest
|
|
143
|
+
extends BaseWorkdirRequest<
|
|
144
|
+
"file_write_request",
|
|
145
|
+
{
|
|
146
|
+
path: string;
|
|
147
|
+
content: string;
|
|
148
|
+
encoding?: string;
|
|
149
|
+
createDirectories?: boolean;
|
|
150
|
+
}
|
|
151
|
+
> {}
|
|
165
152
|
|
|
166
153
|
/**
|
|
167
154
|
* FileWrittenEvent - File was written
|
|
168
155
|
*/
|
|
169
|
-
export interface FileWrittenEvent
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
156
|
+
export interface FileWrittenEvent
|
|
157
|
+
extends BaseWorkdirResult<
|
|
158
|
+
"file_written",
|
|
159
|
+
{
|
|
160
|
+
path: string;
|
|
161
|
+
size: number;
|
|
162
|
+
timestamp: number;
|
|
163
|
+
}
|
|
164
|
+
> {}
|
|
177
165
|
|
|
178
166
|
/**
|
|
179
167
|
* FileDeleteRequest - Request to delete a file
|
|
180
168
|
*/
|
|
181
|
-
export interface FileDeleteRequest
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
169
|
+
export interface FileDeleteRequest
|
|
170
|
+
extends BaseWorkdirRequest<
|
|
171
|
+
"file_delete_request",
|
|
172
|
+
{
|
|
173
|
+
path: string;
|
|
174
|
+
recursive?: boolean;
|
|
175
|
+
}
|
|
176
|
+
> {}
|
|
188
177
|
|
|
189
178
|
/**
|
|
190
179
|
* FileDeletedEvent - File was deleted
|
|
191
180
|
*/
|
|
192
|
-
export interface FileDeletedEvent
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
181
|
+
export interface FileDeletedEvent
|
|
182
|
+
extends BaseWorkdirResult<
|
|
183
|
+
"file_deleted",
|
|
184
|
+
{
|
|
185
|
+
path: string;
|
|
186
|
+
timestamp: number;
|
|
187
|
+
}
|
|
188
|
+
> {}
|
|
199
189
|
|
|
200
190
|
/**
|
|
201
191
|
* DirectoryListRequest - Request to list directory
|
|
202
192
|
*/
|
|
203
|
-
export interface DirectoryListRequest
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
193
|
+
export interface DirectoryListRequest
|
|
194
|
+
extends BaseWorkdirRequest<
|
|
195
|
+
"directory_list_request",
|
|
196
|
+
{
|
|
197
|
+
path: string;
|
|
198
|
+
recursive?: boolean;
|
|
199
|
+
pattern?: string;
|
|
200
|
+
}
|
|
201
|
+
> {}
|
|
211
202
|
|
|
212
203
|
/**
|
|
213
204
|
* DirectoryListResult - Directory listing result
|
|
214
205
|
*/
|
|
215
|
-
export interface DirectoryListResult
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
206
|
+
export interface DirectoryListResult
|
|
207
|
+
extends BaseWorkdirResult<
|
|
208
|
+
"directory_list_result",
|
|
209
|
+
{
|
|
210
|
+
path: string;
|
|
211
|
+
entries: Array<{
|
|
212
|
+
name: string;
|
|
213
|
+
type: "file" | "directory";
|
|
214
|
+
size?: number;
|
|
215
|
+
modifiedAt?: number;
|
|
216
|
+
}>;
|
|
217
|
+
}
|
|
218
|
+
> {}
|
|
227
219
|
|
|
228
220
|
/**
|
|
229
221
|
* WorkdirErrorEvent - Workdir operation error
|
|
230
222
|
*/
|
|
231
|
-
export interface WorkdirErrorEvent
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
223
|
+
export interface WorkdirErrorEvent
|
|
224
|
+
extends BaseWorkdirNotification<
|
|
225
|
+
"workdir_error",
|
|
226
|
+
{
|
|
227
|
+
operation: string;
|
|
228
|
+
path: string;
|
|
229
|
+
code: string;
|
|
230
|
+
message: string;
|
|
231
|
+
}
|
|
232
|
+
> {}
|
|
240
233
|
|
|
241
234
|
/**
|
|
242
235
|
* WorkdirEvent - All workdir events
|
|
@@ -287,127 +280,119 @@ export function isWorkdirEvent(event: {
|
|
|
287
280
|
/**
|
|
288
281
|
* Base MCPRequest
|
|
289
282
|
*/
|
|
290
|
-
interface BaseMCPRequest<T extends string, D = unknown>
|
|
291
|
-
T,
|
|
292
|
-
D,
|
|
293
|
-
"sandbox",
|
|
294
|
-
"mcp",
|
|
295
|
-
"request"
|
|
296
|
-
> {}
|
|
283
|
+
interface BaseMCPRequest<T extends string, D = unknown>
|
|
284
|
+
extends SystemEvent<T, D, "sandbox", "mcp", "request"> {}
|
|
297
285
|
|
|
298
286
|
/**
|
|
299
287
|
* Base MCPResult
|
|
300
288
|
*/
|
|
301
|
-
interface BaseMCPResult<T extends string, D = unknown>
|
|
302
|
-
T,
|
|
303
|
-
D,
|
|
304
|
-
"sandbox",
|
|
305
|
-
"mcp",
|
|
306
|
-
"result"
|
|
307
|
-
> {}
|
|
289
|
+
interface BaseMCPResult<T extends string, D = unknown>
|
|
290
|
+
extends SystemEvent<T, D, "sandbox", "mcp", "result"> {}
|
|
308
291
|
|
|
309
292
|
/**
|
|
310
293
|
* Base MCPNotification
|
|
311
294
|
*/
|
|
312
|
-
interface BaseMCPNotification<T extends string, D = unknown>
|
|
313
|
-
T,
|
|
314
|
-
D,
|
|
315
|
-
"sandbox",
|
|
316
|
-
"mcp",
|
|
317
|
-
"notification"
|
|
318
|
-
> {}
|
|
295
|
+
interface BaseMCPNotification<T extends string, D = unknown>
|
|
296
|
+
extends SystemEvent<T, D, "sandbox", "mcp", "notification"> {}
|
|
319
297
|
|
|
320
298
|
/**
|
|
321
299
|
* ToolExecuteRequest - Request to execute a tool
|
|
322
300
|
*/
|
|
323
|
-
export interface ToolExecuteRequest
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
301
|
+
export interface ToolExecuteRequest
|
|
302
|
+
extends BaseMCPRequest<
|
|
303
|
+
"tool_execute_request",
|
|
304
|
+
{
|
|
305
|
+
toolId: string;
|
|
306
|
+
toolName: string;
|
|
307
|
+
serverName: string;
|
|
308
|
+
input: Record<string, unknown>;
|
|
309
|
+
timestamp: number;
|
|
310
|
+
}
|
|
311
|
+
> {}
|
|
333
312
|
|
|
334
313
|
/**
|
|
335
314
|
* ToolExecutedEvent - Tool execution completed
|
|
336
315
|
*/
|
|
337
|
-
export interface ToolExecutedEvent
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
316
|
+
export interface ToolExecutedEvent
|
|
317
|
+
extends BaseMCPResult<
|
|
318
|
+
"tool_executed",
|
|
319
|
+
{
|
|
320
|
+
toolId: string;
|
|
321
|
+
toolName: string;
|
|
322
|
+
result: unknown;
|
|
323
|
+
duration: number;
|
|
324
|
+
timestamp: number;
|
|
325
|
+
}
|
|
326
|
+
> {}
|
|
347
327
|
|
|
348
328
|
/**
|
|
349
329
|
* ToolExecutionErrorEvent - Tool execution failed
|
|
350
330
|
*/
|
|
351
|
-
export interface ToolExecutionErrorEvent
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
331
|
+
export interface ToolExecutionErrorEvent
|
|
332
|
+
extends BaseMCPNotification<
|
|
333
|
+
"tool_execution_error",
|
|
334
|
+
{
|
|
335
|
+
toolId: string;
|
|
336
|
+
toolName: string;
|
|
337
|
+
code: string;
|
|
338
|
+
message: string;
|
|
339
|
+
timestamp: number;
|
|
340
|
+
}
|
|
341
|
+
> {}
|
|
361
342
|
|
|
362
343
|
/**
|
|
363
344
|
* MCPServerConnectedEvent - MCP server connected
|
|
364
345
|
*/
|
|
365
|
-
export interface MCPServerConnectedEvent
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
346
|
+
export interface MCPServerConnectedEvent
|
|
347
|
+
extends BaseMCPNotification<
|
|
348
|
+
"mcp_server_connected",
|
|
349
|
+
{
|
|
350
|
+
serverName: string;
|
|
351
|
+
version?: string;
|
|
352
|
+
toolCount: number;
|
|
353
|
+
resourceCount: number;
|
|
354
|
+
timestamp: number;
|
|
355
|
+
}
|
|
356
|
+
> {}
|
|
375
357
|
|
|
376
358
|
/**
|
|
377
359
|
* MCPServerDisconnectedEvent - MCP server disconnected
|
|
378
360
|
*/
|
|
379
|
-
export interface MCPServerDisconnectedEvent
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
361
|
+
export interface MCPServerDisconnectedEvent
|
|
362
|
+
extends BaseMCPNotification<
|
|
363
|
+
"mcp_server_disconnected",
|
|
364
|
+
{
|
|
365
|
+
serverName: string;
|
|
366
|
+
reason?: string;
|
|
367
|
+
timestamp: number;
|
|
368
|
+
}
|
|
369
|
+
> {}
|
|
387
370
|
|
|
388
371
|
/**
|
|
389
372
|
* ResourceReadRequest - Request to read an MCP resource
|
|
390
373
|
*/
|
|
391
|
-
export interface ResourceReadRequest
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
374
|
+
export interface ResourceReadRequest
|
|
375
|
+
extends BaseMCPRequest<
|
|
376
|
+
"resource_read_request",
|
|
377
|
+
{
|
|
378
|
+
serverName: string;
|
|
379
|
+
uri: string;
|
|
380
|
+
}
|
|
381
|
+
> {}
|
|
398
382
|
|
|
399
383
|
/**
|
|
400
384
|
* ResourceReadResult - Resource read result
|
|
401
385
|
*/
|
|
402
|
-
export interface ResourceReadResult
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
386
|
+
export interface ResourceReadResult
|
|
387
|
+
extends BaseMCPResult<
|
|
388
|
+
"resource_read_result",
|
|
389
|
+
{
|
|
390
|
+
serverName: string;
|
|
391
|
+
uri: string;
|
|
392
|
+
content: unknown;
|
|
393
|
+
mimeType?: string;
|
|
394
|
+
}
|
|
395
|
+
> {}
|
|
411
396
|
|
|
412
397
|
/**
|
|
413
398
|
* MCPEvent - All MCP events
|