@lssm/example.agent-console 0.0.0-canary-20251215234153 → 0.0.0-canary-20251216023757
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/.turbo/turbo-build.log +38 -28
- package/CHANGELOG.md +6 -6
- package/dist/agent/agent.contracts.js +1 -0
- package/dist/{entities/agent.js → agent/agent.entity.js} +1 -1
- package/dist/agent/agent.enum.js +1 -0
- package/dist/agent/agent.event.js +1 -0
- package/dist/agent/agent.handler.js +1 -0
- package/dist/agent/agent.presentation.js +1 -0
- package/dist/agent/agent.schema.js +1 -0
- package/dist/agent/index.js +1 -0
- package/dist/handlers/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/presentations/index.js +1 -1
- package/dist/run/index.js +1 -0
- package/dist/run/run.contracts.js +1 -0
- package/dist/run/run.entity.js +1 -0
- package/dist/run/run.enum.js +1 -0
- package/dist/run/run.event.js +1 -0
- package/dist/run/run.handler.js +1 -0
- package/dist/run/run.presentation.js +1 -0
- package/dist/run/run.schema.js +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/mock-agents.js +1 -0
- package/dist/shared/mock-runs.js +1 -0
- package/dist/shared/mock-tools.js +1 -0
- package/dist/tool/index.js +1 -0
- package/dist/tool/tool.contracts.js +1 -0
- package/dist/tool/tool.entity.js +1 -0
- package/dist/tool/tool.enum.js +1 -0
- package/dist/tool/tool.event.js +1 -0
- package/dist/tool/tool.handler.js +1 -0
- package/dist/tool/tool.presentation.js +1 -0
- package/dist/tool/tool.schema.js +1 -0
- package/package.json +59 -39
- package/src/agent/agent.contracts.ts +275 -0
- package/src/agent/agent.entity.ts +84 -0
- package/src/agent/agent.enum.ts +31 -0
- package/src/agent/agent.event.ts +109 -0
- package/src/{handlers/agent.handlers.ts → agent/agent.handler.ts} +23 -78
- package/src/{presentations/agent-list.ts → agent/agent.presentation.ts} +26 -14
- package/src/agent/agent.schema.ts +147 -0
- package/src/agent/index.ts +65 -0
- package/src/handlers/index.ts +17 -44
- package/src/index.ts +6 -15
- package/src/presentations/index.ts +13 -34
- package/src/run/index.ts +65 -0
- package/src/run/run.contracts.ts +266 -0
- package/src/run/run.entity.ts +126 -0
- package/src/run/run.enum.ts +45 -0
- package/src/run/run.event.ts +211 -0
- package/src/run/run.handler.ts +103 -0
- package/src/run/run.presentation.ts +47 -0
- package/src/run/run.schema.ts +139 -0
- package/src/shared/index.ts +6 -0
- package/src/shared/mock-agents.ts +83 -0
- package/src/shared/mock-runs.ts +108 -0
- package/src/shared/mock-tools.ts +146 -0
- package/src/tool/index.ts +35 -0
- package/src/tool/tool.contracts.ts +180 -0
- package/src/tool/tool.entity.ts +66 -0
- package/src/tool/tool.enum.ts +34 -0
- package/src/tool/tool.event.ts +84 -0
- package/src/tool/tool.handler.ts +107 -0
- package/src/{presentations/tool-registry.ts → tool/tool.presentation.ts} +12 -17
- package/src/tool/tool.schema.ts +134 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/contracts/agent.js +0 -1
- package/dist/contracts/index.js +0 -1
- package/dist/contracts/run.js +0 -1
- package/dist/contracts/tool.js +0 -1
- package/dist/entities/index.js +0 -1
- package/dist/entities/log.js +0 -1
- package/dist/entities/run.js +0 -1
- package/dist/entities/tool.js +0 -1
- package/dist/events.js +0 -1
- package/dist/handlers/agent.handlers.js +0 -1
- package/dist/handlers/mock-data.js +0 -1
- package/dist/handlers/run.handlers.js +0 -1
- package/dist/handlers/tool.handlers.js +0 -1
- package/dist/presentations/agent-list.js +0 -1
- package/dist/presentations/dashboard.js +0 -1
- package/dist/presentations/run-list.js +0 -1
- package/dist/presentations/tool-registry.js +0 -1
- package/src/contracts/agent.ts +0 -501
- package/src/contracts/index.ts +0 -29
- package/src/contracts/run.ts +0 -561
- package/src/contracts/tool.ts +0 -392
- package/src/entities/agent.ts +0 -151
- package/src/entities/index.ts +0 -20
- package/src/entities/log.ts +0 -76
- package/src/entities/run.ts +0 -240
- package/src/entities/tool.ts +0 -105
- package/src/events.ts +0 -419
- package/src/handlers/mock-data.ts +0 -413
- package/src/handlers/run.handlers.ts +0 -331
- package/src/handlers/tool.handlers.ts +0 -188
- package/src/presentations/dashboard.ts +0 -29
- package/src/presentations/run-list.ts +0 -76
- /package/dist/{feature.js → agent.feature.js} +0 -0
- /package/src/{feature.ts → agent.feature.ts} +0 -0
package/src/events.ts
DELETED
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
import { defineEvent, defineSchemaModel } from '@lssm/lib.contracts';
|
|
2
|
-
import { ScalarTypeEnum, defineEnum } from '@lssm/lib.schema';
|
|
3
|
-
|
|
4
|
-
// ============================================
|
|
5
|
-
// Tool Events
|
|
6
|
-
// ============================================
|
|
7
|
-
|
|
8
|
-
export const ToolCreatedPayload = defineSchemaModel({
|
|
9
|
-
name: 'ToolCreatedPayload',
|
|
10
|
-
description: 'Payload for tool created event',
|
|
11
|
-
fields: {
|
|
12
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
-
organizationId: {
|
|
14
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
15
|
-
isOptional: false,
|
|
16
|
-
},
|
|
17
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
|
-
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
-
category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
-
implementationType: {
|
|
21
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
22
|
-
isOptional: false,
|
|
23
|
-
},
|
|
24
|
-
createdById: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
-
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* ToolCreatedEvent - A new tool was created
|
|
31
|
-
*/
|
|
32
|
-
export const ToolCreatedEvent = defineEvent({
|
|
33
|
-
name: 'agent.tool.created',
|
|
34
|
-
version: 1,
|
|
35
|
-
description: 'A new AI tool was created.',
|
|
36
|
-
payload: ToolCreatedPayload,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export const ToolUpdatedPayload = defineSchemaModel({
|
|
40
|
-
name: 'ToolUpdatedPayload',
|
|
41
|
-
description: 'Payload for tool updated event',
|
|
42
|
-
fields: {
|
|
43
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
44
|
-
organizationId: {
|
|
45
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
46
|
-
isOptional: false,
|
|
47
|
-
},
|
|
48
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
49
|
-
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
50
|
-
updatedFields: {
|
|
51
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
52
|
-
isArray: true,
|
|
53
|
-
isOptional: false,
|
|
54
|
-
},
|
|
55
|
-
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* ToolUpdatedEvent - A tool was updated
|
|
61
|
-
*/
|
|
62
|
-
export const ToolUpdatedEvent = defineEvent({
|
|
63
|
-
name: 'agent.tool.updated',
|
|
64
|
-
version: 1,
|
|
65
|
-
description: 'An AI tool configuration was updated.',
|
|
66
|
-
payload: ToolUpdatedPayload,
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
export const ToolStatusChangedPayload = defineSchemaModel({
|
|
70
|
-
name: 'ToolStatusChangedPayload',
|
|
71
|
-
description: 'Payload for tool status changed event',
|
|
72
|
-
fields: {
|
|
73
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
74
|
-
organizationId: {
|
|
75
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
76
|
-
isOptional: false,
|
|
77
|
-
},
|
|
78
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
79
|
-
previousStatus: {
|
|
80
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
81
|
-
isOptional: false,
|
|
82
|
-
},
|
|
83
|
-
newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
84
|
-
changedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* ToolStatusChangedEvent - A tool's status was changed
|
|
90
|
-
*/
|
|
91
|
-
export const ToolStatusChangedEvent = defineEvent({
|
|
92
|
-
name: 'agent.tool.statusChanged',
|
|
93
|
-
version: 1,
|
|
94
|
-
description:
|
|
95
|
-
'An AI tool status was changed (activated, deprecated, disabled).',
|
|
96
|
-
payload: ToolStatusChangedPayload,
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
// ============================================
|
|
100
|
-
// Agent Events
|
|
101
|
-
// ============================================
|
|
102
|
-
|
|
103
|
-
export const AgentCreatedPayload = defineSchemaModel({
|
|
104
|
-
name: 'AgentCreatedPayload',
|
|
105
|
-
description: 'Payload for agent created event',
|
|
106
|
-
fields: {
|
|
107
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
108
|
-
organizationId: {
|
|
109
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
110
|
-
isOptional: false,
|
|
111
|
-
},
|
|
112
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
113
|
-
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
114
|
-
modelProvider: {
|
|
115
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
116
|
-
isOptional: false,
|
|
117
|
-
},
|
|
118
|
-
modelName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
119
|
-
toolCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
120
|
-
createdById: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
121
|
-
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* AgentCreatedEvent - A new agent was created
|
|
127
|
-
*/
|
|
128
|
-
export const AgentCreatedEvent = defineEvent({
|
|
129
|
-
name: 'agent.agent.created',
|
|
130
|
-
version: 1,
|
|
131
|
-
description: 'A new AI agent was configured.',
|
|
132
|
-
payload: AgentCreatedPayload,
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
export const AgentUpdatedPayload = defineSchemaModel({
|
|
136
|
-
name: 'AgentUpdatedPayload',
|
|
137
|
-
description: 'Payload for agent updated event',
|
|
138
|
-
fields: {
|
|
139
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
140
|
-
organizationId: {
|
|
141
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
142
|
-
isOptional: false,
|
|
143
|
-
},
|
|
144
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
145
|
-
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
146
|
-
updatedFields: {
|
|
147
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
148
|
-
isArray: true,
|
|
149
|
-
isOptional: false,
|
|
150
|
-
},
|
|
151
|
-
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* AgentUpdatedEvent - An agent was updated
|
|
157
|
-
*/
|
|
158
|
-
export const AgentUpdatedEvent = defineEvent({
|
|
159
|
-
name: 'agent.agent.updated',
|
|
160
|
-
version: 1,
|
|
161
|
-
description: 'An AI agent configuration was updated.',
|
|
162
|
-
payload: AgentUpdatedPayload,
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
export const AgentToolAssignedPayload = defineSchemaModel({
|
|
166
|
-
name: 'AgentToolAssignedPayload',
|
|
167
|
-
description: 'Payload for agent tool assigned event',
|
|
168
|
-
fields: {
|
|
169
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
170
|
-
toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
171
|
-
agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
172
|
-
toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
173
|
-
assignedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
174
|
-
},
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* AgentToolAssignedEvent - A tool was assigned to an agent
|
|
179
|
-
*/
|
|
180
|
-
export const AgentToolAssignedEvent = defineEvent({
|
|
181
|
-
name: 'agent.agent.toolAssigned',
|
|
182
|
-
version: 1,
|
|
183
|
-
description: 'A tool was assigned to an agent.',
|
|
184
|
-
payload: AgentToolAssignedPayload,
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
export const AgentToolRemovedPayload = defineSchemaModel({
|
|
188
|
-
name: 'AgentToolRemovedPayload',
|
|
189
|
-
description: 'Payload for agent tool removed event',
|
|
190
|
-
fields: {
|
|
191
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
192
|
-
toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
193
|
-
agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
194
|
-
toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
195
|
-
removedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
196
|
-
},
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* AgentToolRemovedEvent - A tool was removed from an agent
|
|
201
|
-
*/
|
|
202
|
-
export const AgentToolRemovedEvent = defineEvent({
|
|
203
|
-
name: 'agent.agent.toolRemoved',
|
|
204
|
-
version: 1,
|
|
205
|
-
description: 'A tool was removed from an agent.',
|
|
206
|
-
payload: AgentToolRemovedPayload,
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
// ============================================
|
|
210
|
-
// Run Events
|
|
211
|
-
// ============================================
|
|
212
|
-
|
|
213
|
-
export const RunStartedPayload = defineSchemaModel({
|
|
214
|
-
name: 'RunStartedPayload',
|
|
215
|
-
description: 'Payload for run started event',
|
|
216
|
-
fields: {
|
|
217
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
218
|
-
organizationId: {
|
|
219
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
220
|
-
isOptional: false,
|
|
221
|
-
},
|
|
222
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
223
|
-
agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
224
|
-
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
225
|
-
sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
226
|
-
input: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
|
|
227
|
-
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
228
|
-
},
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* RunStartedEvent - An agent run was started
|
|
233
|
-
*/
|
|
234
|
-
export const RunStartedEvent = defineEvent({
|
|
235
|
-
name: 'agent.run.started',
|
|
236
|
-
version: 1,
|
|
237
|
-
description: 'An agent run was started.',
|
|
238
|
-
payload: RunStartedPayload,
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
export const RunCompletedPayload = defineSchemaModel({
|
|
242
|
-
name: 'RunCompletedPayload',
|
|
243
|
-
description: 'Payload for run completed event',
|
|
244
|
-
fields: {
|
|
245
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
246
|
-
organizationId: {
|
|
247
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
248
|
-
isOptional: false,
|
|
249
|
-
},
|
|
250
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
251
|
-
agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
252
|
-
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
253
|
-
output: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
|
|
254
|
-
totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
255
|
-
promptTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
256
|
-
completionTokens: {
|
|
257
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
258
|
-
isOptional: false,
|
|
259
|
-
},
|
|
260
|
-
totalIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
261
|
-
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
262
|
-
estimatedCostUsd: {
|
|
263
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
264
|
-
isOptional: true,
|
|
265
|
-
},
|
|
266
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
267
|
-
},
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* RunCompletedEvent - An agent run completed successfully
|
|
272
|
-
*/
|
|
273
|
-
export const RunCompletedEvent = defineEvent({
|
|
274
|
-
name: 'agent.run.completed',
|
|
275
|
-
version: 1,
|
|
276
|
-
description: 'An agent run completed successfully.',
|
|
277
|
-
payload: RunCompletedPayload,
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
export const RunFailedPayload = defineSchemaModel({
|
|
281
|
-
name: 'RunFailedPayload',
|
|
282
|
-
description: 'Payload for run failed event',
|
|
283
|
-
fields: {
|
|
284
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
285
|
-
organizationId: {
|
|
286
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
287
|
-
isOptional: false,
|
|
288
|
-
},
|
|
289
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
290
|
-
agentName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
291
|
-
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
292
|
-
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
293
|
-
errorCode: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
294
|
-
totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
295
|
-
totalIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
296
|
-
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
297
|
-
failedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
298
|
-
},
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* RunFailedEvent - An agent run failed
|
|
303
|
-
*/
|
|
304
|
-
export const RunFailedEvent = defineEvent({
|
|
305
|
-
name: 'agent.run.failed',
|
|
306
|
-
version: 1,
|
|
307
|
-
description: 'An agent run encountered an error.',
|
|
308
|
-
payload: RunFailedPayload,
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
export const RunCancelledPayload = defineSchemaModel({
|
|
312
|
-
name: 'RunCancelledPayload',
|
|
313
|
-
description: 'Payload for run cancelled event',
|
|
314
|
-
fields: {
|
|
315
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
316
|
-
organizationId: {
|
|
317
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
318
|
-
isOptional: false,
|
|
319
|
-
},
|
|
320
|
-
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
321
|
-
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
322
|
-
cancelledBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
323
|
-
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
324
|
-
totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
325
|
-
totalIterations: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
326
|
-
cancelledAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
327
|
-
},
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* RunCancelledEvent - An agent run was cancelled
|
|
332
|
-
*/
|
|
333
|
-
export const RunCancelledEvent = defineEvent({
|
|
334
|
-
name: 'agent.run.cancelled',
|
|
335
|
-
version: 1,
|
|
336
|
-
description: 'An agent run was cancelled by the user.',
|
|
337
|
-
payload: RunCancelledPayload,
|
|
338
|
-
});
|
|
339
|
-
|
|
340
|
-
// ============================================
|
|
341
|
-
// Step Events
|
|
342
|
-
// ============================================
|
|
343
|
-
|
|
344
|
-
export const ToolInvokedPayload = defineSchemaModel({
|
|
345
|
-
name: 'ToolInvokedPayload',
|
|
346
|
-
description: 'Payload for tool invoked event',
|
|
347
|
-
fields: {
|
|
348
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
349
|
-
stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
350
|
-
toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
351
|
-
toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
352
|
-
input: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
|
|
353
|
-
invokedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
354
|
-
},
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* ToolInvokedEvent - A tool was invoked during a run
|
|
359
|
-
*/
|
|
360
|
-
export const ToolInvokedEvent = defineEvent({
|
|
361
|
-
name: 'agent.run.toolInvoked',
|
|
362
|
-
version: 1,
|
|
363
|
-
description: 'A tool was invoked during an agent run.',
|
|
364
|
-
payload: ToolInvokedPayload,
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
export const ToolCompletedPayload = defineSchemaModel({
|
|
368
|
-
name: 'ToolCompletedPayload',
|
|
369
|
-
description: 'Payload for tool completed event',
|
|
370
|
-
fields: {
|
|
371
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
372
|
-
stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
373
|
-
toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
374
|
-
toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
375
|
-
success: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
376
|
-
output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
377
|
-
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
378
|
-
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
379
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
380
|
-
},
|
|
381
|
-
});
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* ToolCompletedEvent - A tool invocation completed
|
|
385
|
-
*/
|
|
386
|
-
export const ToolCompletedEvent = defineEvent({
|
|
387
|
-
name: 'agent.run.toolCompleted',
|
|
388
|
-
version: 1,
|
|
389
|
-
description: 'A tool invocation completed during an agent run.',
|
|
390
|
-
payload: ToolCompletedPayload,
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
export const MessageTypeEnum = defineEnum('MessageType', [
|
|
394
|
-
'assistant',
|
|
395
|
-
'system',
|
|
396
|
-
]);
|
|
397
|
-
|
|
398
|
-
export const MessageGeneratedPayload = defineSchemaModel({
|
|
399
|
-
name: 'MessageGeneratedPayload',
|
|
400
|
-
description: 'Payload for message generated event',
|
|
401
|
-
fields: {
|
|
402
|
-
runId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
403
|
-
stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
404
|
-
messageType: { type: MessageTypeEnum, isOptional: false },
|
|
405
|
-
content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
406
|
-
tokensUsed: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
407
|
-
generatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
408
|
-
},
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* MessageGeneratedEvent - Agent generated a message
|
|
413
|
-
*/
|
|
414
|
-
export const MessageGeneratedEvent = defineEvent({
|
|
415
|
-
name: 'agent.run.messageGenerated',
|
|
416
|
-
version: 1,
|
|
417
|
-
description: 'An agent generated a message during a run.',
|
|
418
|
-
payload: MessageGeneratedPayload,
|
|
419
|
-
});
|