@lssm/example.agent-console 1.41.0 → 1.42.2
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$colon$bundle.log +133 -0
- package/.turbo/turbo-build.log +129 -41
- package/CHANGELOG.md +40 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/agent/agent.entity.d.ts +55 -0
- package/dist/agent/agent.entity.d.ts.map +1 -0
- package/dist/agent/agent.entity.js +136 -1
- package/dist/agent/agent.entity.js.map +1 -0
- package/dist/agent/agent.enum.d.ts +18 -0
- package/dist/agent/agent.enum.d.ts.map +1 -0
- package/dist/agent/agent.enum.js +34 -1
- package/dist/agent/agent.enum.js.map +1 -0
- package/dist/agent/agent.event.d.ts +128 -0
- package/dist/agent/agent.event.d.ts.map +1 -0
- package/dist/agent/agent.event.js +210 -1
- package/dist/agent/agent.event.js.map +1 -0
- package/dist/agent/agent.handler.d.ts +100 -0
- package/dist/agent/agent.handler.d.ts.map +1 -0
- package/dist/agent/agent.handler.js +84 -1
- package/dist/agent/agent.handler.js.map +1 -0
- package/dist/agent/agent.operation.d.ts +471 -0
- package/dist/agent/agent.operation.d.ts.map +1 -0
- package/dist/agent/agent.operation.js +486 -0
- package/dist/agent/agent.operation.js.map +1 -0
- package/dist/agent/agent.presentation.d.ts +19 -0
- package/dist/agent/agent.presentation.d.ts.map +1 -0
- package/dist/agent/agent.presentation.js +89 -1
- package/dist/agent/agent.presentation.js.map +1 -0
- package/dist/agent/agent.schema.d.ts +401 -0
- package/dist/agent/agent.schema.d.ts.map +1 -0
- package/dist/agent/agent.schema.js +406 -1
- package/dist/agent/agent.schema.js.map +1 -0
- package/dist/agent/index.d.ts +8 -0
- package/dist/agent/index.js +9 -1
- package/dist/agent.feature.d.ts +12 -0
- package/dist/agent.feature.d.ts.map +1 -0
- package/dist/agent.feature.js +303 -1
- package/dist/agent.feature.js.map +1 -0
- package/dist/docs/agent-console.docblock.d.ts +1 -0
- package/dist/docs/agent-console.docblock.js +69 -5
- package/dist/docs/agent-console.docblock.js.map +1 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -1
- package/dist/example.d.ts +40 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +51 -1
- package/dist/example.js.map +1 -0
- package/dist/handlers/index.d.ts +4 -0
- package/dist/handlers/index.js +5 -1
- package/dist/index.d.ts +30 -0
- package/dist/index.js +32 -1
- package/dist/presentations/index.d.ts +4 -0
- package/dist/presentations/index.js +5 -1
- package/dist/run/index.d.ts +8 -0
- package/dist/run/index.js +9 -1
- package/dist/run/run.entity.d.ts +82 -0
- package/dist/run/run.entity.d.ts.map +1 -0
- package/dist/run/run.entity.js +205 -1
- package/dist/run/run.entity.js.map +1 -0
- package/dist/run/run.enum.d.ts +22 -0
- package/dist/run/run.enum.d.ts.map +1 -0
- package/dist/run/run.enum.js +45 -1
- package/dist/run/run.enum.js.map +1 -0
- package/dist/run/run.event.d.ts +290 -0
- package/dist/run/run.event.d.ts.map +1 -0
- package/dist/run/run.event.js +434 -1
- package/dist/run/run.event.js.map +1 -0
- package/dist/run/run.handler.d.ts +203 -0
- package/dist/run/run.handler.d.ts.map +1 -0
- package/dist/run/run.handler.js +83 -1
- package/dist/run/run.handler.js.map +1 -0
- package/dist/run/run.operation.d.ts +720 -0
- package/dist/run/run.operation.d.ts.map +1 -0
- package/dist/run/run.operation.js +626 -0
- package/dist/run/run.operation.js.map +1 -0
- package/dist/run/run.presentation.d.ts +15 -0
- package/dist/run/run.presentation.d.ts.map +1 -0
- package/dist/run/run.presentation.js +65 -1
- package/dist/run/run.presentation.js.map +1 -0
- package/dist/run/run.schema.d.ts +416 -0
- package/dist/run/run.schema.d.ts.map +1 -0
- package/dist/run/run.schema.js +338 -1
- package/dist/run/run.schema.js.map +1 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.js +5 -1
- package/dist/shared/mock-agents.d.ts +88 -0
- package/dist/shared/mock-agents.d.ts.map +1 -0
- package/dist/shared/mock-agents.js +94 -1
- package/dist/shared/mock-agents.js.map +1 -0
- package/dist/shared/mock-runs.d.ts +120 -0
- package/dist/shared/mock-runs.d.ts.map +1 -0
- package/dist/shared/mock-runs.js +118 -1
- package/dist/shared/mock-runs.js.map +1 -0
- package/dist/shared/mock-tools.d.ts +244 -0
- package/dist/shared/mock-tools.d.ts.map +1 -0
- package/dist/shared/mock-tools.js +181 -1
- package/dist/shared/mock-tools.js.map +1 -0
- package/dist/tool/index.d.ts +8 -0
- package/dist/tool/index.js +9 -1
- package/dist/tool/tool.entity.d.ts +42 -0
- package/dist/tool/tool.entity.d.ts.map +1 -0
- package/dist/tool/tool.entity.js +105 -1
- package/dist/tool/tool.entity.js.map +1 -0
- package/dist/tool/tool.enum.d.ts +18 -0
- package/dist/tool/tool.enum.d.ts.map +1 -0
- package/dist/tool/tool.enum.js +35 -1
- package/dist/tool/tool.enum.js.map +1 -0
- package/dist/tool/tool.event.d.ts +103 -0
- package/dist/tool/tool.event.d.ts.map +1 -0
- package/dist/tool/tool.event.js +159 -1
- package/dist/tool/tool.event.js.map +1 -0
- package/dist/tool/tool.handler.d.ts +315 -0
- package/dist/tool/tool.handler.d.ts.map +1 -0
- package/dist/tool/tool.handler.js +87 -1
- package/dist/tool/tool.handler.js.map +1 -0
- package/dist/tool/tool.operation.d.ts +411 -0
- package/dist/tool/tool.operation.d.ts.map +1 -0
- package/dist/tool/tool.operation.js +406 -0
- package/dist/tool/tool.operation.js.map +1 -0
- package/dist/tool/tool.presentation.d.ts +15 -0
- package/dist/tool/tool.presentation.d.ts.map +1 -0
- package/dist/tool/tool.presentation.js +65 -1
- package/dist/tool/tool.presentation.js.map +1 -0
- package/dist/tool/tool.schema.d.ts +218 -0
- package/dist/tool/tool.schema.d.ts.map +1 -0
- package/dist/tool/tool.schema.js +236 -1
- package/dist/tool/tool.schema.js.map +1 -0
- package/package.json +59 -49
- package/src/agent/agent.entity.ts +1 -6
- package/src/agent/agent.event.ts +34 -12
- package/src/agent/{agent.contracts.ts → agent.operation.ts} +176 -10
- package/src/agent/agent.presentation.ts +20 -7
- package/src/agent/index.ts +1 -1
- package/src/agent.feature.ts +58 -56
- package/src/run/index.ts +1 -1
- package/src/run/run.entity.ts +1 -6
- package/src/run/run.event.ts +58 -21
- package/src/run/{run.contracts.ts → run.operation.ts} +165 -14
- package/src/run/run.presentation.ts +14 -5
- package/src/tool/index.ts +1 -1
- package/src/tool/tool.entity.ts +1 -6
- package/src/tool/tool.event.ts +27 -10
- package/src/tool/{tool.contracts.ts → tool.operation.ts} +133 -10
- package/src/tool/tool.presentation.ts +14 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/agent/agent.contracts.js +0 -1
- package/dist/run/run.contracts.js +0 -1
- package/dist/tool/tool.contracts.js +0 -1
package/src/run/run.event.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defineEvent, defineSchemaModel } from '@lssm/lib.contracts';
|
|
2
2
|
import { ScalarTypeEnum, defineEnum } from '@lssm/lib.schema';
|
|
3
3
|
|
|
4
|
+
const OWNERS = ['@agent-console-team'] as const;
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* Payload for run started event.
|
|
6
8
|
*/
|
|
@@ -26,9 +28,14 @@ const RunStartedPayload = defineSchemaModel({
|
|
|
26
28
|
* RunStartedEvent - An agent run was started.
|
|
27
29
|
*/
|
|
28
30
|
export const RunStartedEvent = defineEvent({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
meta: {
|
|
32
|
+
key: 'agent.run.started',
|
|
33
|
+
version: 1,
|
|
34
|
+
description: 'An agent run was started.',
|
|
35
|
+
stability: 'stable',
|
|
36
|
+
owners: [...OWNERS],
|
|
37
|
+
tags: ['run', 'started'],
|
|
38
|
+
},
|
|
32
39
|
payload: RunStartedPayload,
|
|
33
40
|
});
|
|
34
41
|
|
|
@@ -68,9 +75,14 @@ const RunCompletedPayload = defineSchemaModel({
|
|
|
68
75
|
* RunCompletedEvent - An agent run completed successfully.
|
|
69
76
|
*/
|
|
70
77
|
export const RunCompletedEvent = defineEvent({
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
meta: {
|
|
79
|
+
key: 'agent.run.completed',
|
|
80
|
+
version: 1,
|
|
81
|
+
description: 'An agent run completed successfully.',
|
|
82
|
+
stability: 'stable',
|
|
83
|
+
owners: [...OWNERS],
|
|
84
|
+
tags: ['run', 'completed'],
|
|
85
|
+
},
|
|
74
86
|
payload: RunCompletedPayload,
|
|
75
87
|
});
|
|
76
88
|
|
|
@@ -102,9 +114,14 @@ const RunFailedPayload = defineSchemaModel({
|
|
|
102
114
|
* RunFailedEvent - An agent run failed.
|
|
103
115
|
*/
|
|
104
116
|
export const RunFailedEvent = defineEvent({
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
117
|
+
meta: {
|
|
118
|
+
key: 'agent.run.failed',
|
|
119
|
+
version: 1,
|
|
120
|
+
description: 'An agent run encountered an error.',
|
|
121
|
+
stability: 'stable',
|
|
122
|
+
owners: [...OWNERS],
|
|
123
|
+
tags: ['run', 'failed'],
|
|
124
|
+
},
|
|
108
125
|
payload: RunFailedPayload,
|
|
109
126
|
});
|
|
110
127
|
|
|
@@ -134,9 +151,14 @@ const RunCancelledPayload = defineSchemaModel({
|
|
|
134
151
|
* RunCancelledEvent - An agent run was cancelled.
|
|
135
152
|
*/
|
|
136
153
|
export const RunCancelledEvent = defineEvent({
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
meta: {
|
|
155
|
+
key: 'agent.run.cancelled',
|
|
156
|
+
version: 1,
|
|
157
|
+
description: 'An agent run was cancelled by the user.',
|
|
158
|
+
stability: 'stable',
|
|
159
|
+
owners: [...OWNERS],
|
|
160
|
+
tags: ['run', 'cancelled'],
|
|
161
|
+
},
|
|
140
162
|
payload: RunCancelledPayload,
|
|
141
163
|
});
|
|
142
164
|
|
|
@@ -160,9 +182,14 @@ const ToolInvokedPayload = defineSchemaModel({
|
|
|
160
182
|
* ToolInvokedEvent - A tool was invoked during a run.
|
|
161
183
|
*/
|
|
162
184
|
export const ToolInvokedEvent = defineEvent({
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
185
|
+
meta: {
|
|
186
|
+
key: 'agent.run.toolInvoked',
|
|
187
|
+
version: 1,
|
|
188
|
+
description: 'A tool was invoked during an agent run.',
|
|
189
|
+
stability: 'stable',
|
|
190
|
+
owners: [...OWNERS],
|
|
191
|
+
tags: ['run', 'tool', 'invoked'],
|
|
192
|
+
},
|
|
166
193
|
payload: ToolInvokedPayload,
|
|
167
194
|
});
|
|
168
195
|
|
|
@@ -189,9 +216,14 @@ const ToolCompletedPayload = defineSchemaModel({
|
|
|
189
216
|
* ToolCompletedEvent - A tool invocation completed.
|
|
190
217
|
*/
|
|
191
218
|
export const ToolCompletedEvent = defineEvent({
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
219
|
+
meta: {
|
|
220
|
+
key: 'agent.run.toolCompleted',
|
|
221
|
+
version: 1,
|
|
222
|
+
description: 'A tool invocation completed during an agent run.',
|
|
223
|
+
stability: 'stable',
|
|
224
|
+
owners: [...OWNERS],
|
|
225
|
+
tags: ['run', 'tool', 'completed'],
|
|
226
|
+
},
|
|
195
227
|
payload: ToolCompletedPayload,
|
|
196
228
|
});
|
|
197
229
|
|
|
@@ -220,8 +252,13 @@ const MessageGeneratedPayload = defineSchemaModel({
|
|
|
220
252
|
* MessageGeneratedEvent - Agent generated a message.
|
|
221
253
|
*/
|
|
222
254
|
export const MessageGeneratedEvent = defineEvent({
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
255
|
+
meta: {
|
|
256
|
+
key: 'agent.run.messageGenerated',
|
|
257
|
+
version: 1,
|
|
258
|
+
description: 'An agent generated a message during a run.',
|
|
259
|
+
stability: 'stable',
|
|
260
|
+
owners: [...OWNERS],
|
|
261
|
+
tags: ['run', 'message', 'generated'],
|
|
262
|
+
},
|
|
226
263
|
payload: MessageGeneratedPayload,
|
|
227
264
|
});
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineCommand, defineQuery } from '@lssm/lib.contracts/
|
|
1
|
+
import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';
|
|
2
2
|
import { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';
|
|
3
|
-
import {
|
|
3
|
+
import { GranularityEnum, LogLevelEnum, RunStatusEnum } from './run.enum';
|
|
4
4
|
import {
|
|
5
5
|
RunInputModel,
|
|
6
|
+
RunLogModel,
|
|
6
7
|
RunModel,
|
|
7
|
-
RunSummaryModel,
|
|
8
8
|
RunStepModel,
|
|
9
|
-
|
|
9
|
+
RunSummaryModel,
|
|
10
10
|
TimelineDataPointModel,
|
|
11
11
|
} from './run.schema';
|
|
12
12
|
|
|
13
|
-
const OWNERS = ['agent-console-team'] as const;
|
|
13
|
+
const OWNERS = ['@agent-console-team'] as const;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* ExecuteAgentCommand - Starts a new agent run.
|
|
17
17
|
*/
|
|
18
18
|
export const ExecuteAgentCommand = defineCommand({
|
|
19
19
|
meta: {
|
|
20
|
-
|
|
20
|
+
key: 'agent.run.execute',
|
|
21
21
|
version: 1,
|
|
22
22
|
stability: 'stable',
|
|
23
23
|
owners: [...OWNERS],
|
|
@@ -72,14 +72,40 @@ export const ExecuteAgentCommand = defineCommand({
|
|
|
72
72
|
sideEffects: {
|
|
73
73
|
emits: [
|
|
74
74
|
{
|
|
75
|
-
|
|
75
|
+
key: 'run.started',
|
|
76
76
|
version: 1,
|
|
77
|
+
stability: 'stable',
|
|
78
|
+
owners: [...OWNERS],
|
|
79
|
+
tags: ['run', 'started'],
|
|
77
80
|
when: 'Run is queued',
|
|
78
81
|
payload: RunSummaryModel,
|
|
79
82
|
},
|
|
80
83
|
],
|
|
81
84
|
audit: ['run.started'],
|
|
82
85
|
},
|
|
86
|
+
acceptance: {
|
|
87
|
+
scenarios: [
|
|
88
|
+
{
|
|
89
|
+
key: 'execute-agent-happy-path',
|
|
90
|
+
given: ['Agent exists', 'Agent is active'],
|
|
91
|
+
when: ['User submits execution request'],
|
|
92
|
+
then: ['Run is created', 'RunStarted event is emitted'],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'execute-agent-not-active',
|
|
96
|
+
given: ['Agent exists but is not active'],
|
|
97
|
+
when: ['User attempts to execute'],
|
|
98
|
+
then: ['AGENT_NOT_ACTIVE error is returned'],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
examples: [
|
|
102
|
+
{
|
|
103
|
+
key: 'basic-execute',
|
|
104
|
+
input: { agentId: 'agent-123', input: { message: 'Hello' } },
|
|
105
|
+
output: { runId: 'run-456', status: 'pending', estimatedWaitMs: 5000 },
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
83
109
|
});
|
|
84
110
|
|
|
85
111
|
/**
|
|
@@ -87,7 +113,7 @@ export const ExecuteAgentCommand = defineCommand({
|
|
|
87
113
|
*/
|
|
88
114
|
export const CancelRunCommand = defineCommand({
|
|
89
115
|
meta: {
|
|
90
|
-
|
|
116
|
+
key: 'agent.run.cancel',
|
|
91
117
|
version: 1,
|
|
92
118
|
stability: 'stable',
|
|
93
119
|
owners: [...OWNERS],
|
|
@@ -130,14 +156,40 @@ export const CancelRunCommand = defineCommand({
|
|
|
130
156
|
sideEffects: {
|
|
131
157
|
emits: [
|
|
132
158
|
{
|
|
133
|
-
|
|
159
|
+
key: 'run.cancelled',
|
|
134
160
|
version: 1,
|
|
161
|
+
stability: 'stable',
|
|
162
|
+
owners: [...OWNERS],
|
|
163
|
+
tags: ['run', 'cancelled'],
|
|
135
164
|
when: 'Run is cancelled',
|
|
136
165
|
payload: RunSummaryModel,
|
|
137
166
|
},
|
|
138
167
|
],
|
|
139
168
|
audit: ['run.cancelled'],
|
|
140
169
|
},
|
|
170
|
+
acceptance: {
|
|
171
|
+
scenarios: [
|
|
172
|
+
{
|
|
173
|
+
key: 'cancel-run-happy-path',
|
|
174
|
+
given: ['Run exists', 'Run is in progress'],
|
|
175
|
+
when: ['User cancels run'],
|
|
176
|
+
then: ['Run is cancelled', 'RunCancelled event is emitted'],
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
key: 'cancel-run-already-completed',
|
|
180
|
+
given: ['Run exists but is already completed'],
|
|
181
|
+
when: ['User attempts to cancel'],
|
|
182
|
+
then: ['RUN_NOT_CANCELLABLE error is returned'],
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
examples: [
|
|
186
|
+
{
|
|
187
|
+
key: 'cancel-basic',
|
|
188
|
+
input: { runId: 'run-456', reason: 'User requested' },
|
|
189
|
+
output: { success: true, status: 'cancelled' },
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
},
|
|
141
193
|
});
|
|
142
194
|
|
|
143
195
|
/**
|
|
@@ -145,7 +197,7 @@ export const CancelRunCommand = defineCommand({
|
|
|
145
197
|
*/
|
|
146
198
|
export const GetRunQuery = defineQuery({
|
|
147
199
|
meta: {
|
|
148
|
-
|
|
200
|
+
key: 'agent.run.get',
|
|
149
201
|
version: 1,
|
|
150
202
|
stability: 'stable',
|
|
151
203
|
owners: [...OWNERS],
|
|
@@ -174,6 +226,23 @@ export const GetRunQuery = defineQuery({
|
|
|
174
226
|
},
|
|
175
227
|
},
|
|
176
228
|
policy: { auth: 'user' },
|
|
229
|
+
acceptance: {
|
|
230
|
+
scenarios: [
|
|
231
|
+
{
|
|
232
|
+
key: 'get-run-happy-path',
|
|
233
|
+
given: ['Run exists'],
|
|
234
|
+
when: ['User requests run by ID'],
|
|
235
|
+
then: ['Run details are returned'],
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
examples: [
|
|
239
|
+
{
|
|
240
|
+
key: 'get-with-steps',
|
|
241
|
+
input: { runId: 'run-456', includeSteps: true, includeLogs: false },
|
|
242
|
+
output: { id: 'run-456', status: 'completed', steps: [] },
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
},
|
|
177
246
|
});
|
|
178
247
|
|
|
179
248
|
/**
|
|
@@ -181,7 +250,7 @@ export const GetRunQuery = defineQuery({
|
|
|
181
250
|
*/
|
|
182
251
|
export const ListRunsQuery = defineQuery({
|
|
183
252
|
meta: {
|
|
184
|
-
|
|
253
|
+
key: 'agent.run.list',
|
|
185
254
|
version: 1,
|
|
186
255
|
stability: 'stable',
|
|
187
256
|
owners: [...OWNERS],
|
|
@@ -226,6 +295,23 @@ export const ListRunsQuery = defineQuery({
|
|
|
226
295
|
}),
|
|
227
296
|
},
|
|
228
297
|
policy: { auth: 'user' },
|
|
298
|
+
acceptance: {
|
|
299
|
+
scenarios: [
|
|
300
|
+
{
|
|
301
|
+
key: 'list-runs-happy-path',
|
|
302
|
+
given: ['Organization has runs'],
|
|
303
|
+
when: ['User lists runs'],
|
|
304
|
+
then: ['Paginated list of runs is returned'],
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
examples: [
|
|
308
|
+
{
|
|
309
|
+
key: 'list-by-agent',
|
|
310
|
+
input: { agentId: 'agent-123', limit: 20, offset: 0 },
|
|
311
|
+
output: { items: [], total: 0, hasMore: false },
|
|
312
|
+
},
|
|
313
|
+
],
|
|
314
|
+
},
|
|
229
315
|
});
|
|
230
316
|
|
|
231
317
|
/**
|
|
@@ -233,7 +319,7 @@ export const ListRunsQuery = defineQuery({
|
|
|
233
319
|
*/
|
|
234
320
|
export const GetRunStepsQuery = defineQuery({
|
|
235
321
|
meta: {
|
|
236
|
-
|
|
322
|
+
key: 'agent.run.getSteps',
|
|
237
323
|
version: 1,
|
|
238
324
|
stability: 'stable',
|
|
239
325
|
owners: [...OWNERS],
|
|
@@ -257,6 +343,23 @@ export const GetRunStepsQuery = defineQuery({
|
|
|
257
343
|
}),
|
|
258
344
|
},
|
|
259
345
|
policy: { auth: 'user' },
|
|
346
|
+
acceptance: {
|
|
347
|
+
scenarios: [
|
|
348
|
+
{
|
|
349
|
+
key: 'get-run-steps-happy-path',
|
|
350
|
+
given: ['Run exists with steps'],
|
|
351
|
+
when: ['User requests steps'],
|
|
352
|
+
then: ['Steps list is returned'],
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
examples: [
|
|
356
|
+
{
|
|
357
|
+
key: 'get-steps-basic',
|
|
358
|
+
input: { runId: 'run-456' },
|
|
359
|
+
output: { steps: [] },
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
},
|
|
260
363
|
});
|
|
261
364
|
|
|
262
365
|
/**
|
|
@@ -264,7 +367,7 @@ export const GetRunStepsQuery = defineQuery({
|
|
|
264
367
|
*/
|
|
265
368
|
export const GetRunLogsQuery = defineQuery({
|
|
266
369
|
meta: {
|
|
267
|
-
|
|
370
|
+
key: 'agent.run.getLogs',
|
|
268
371
|
version: 1,
|
|
269
372
|
stability: 'stable',
|
|
270
373
|
owners: [...OWNERS],
|
|
@@ -302,6 +405,23 @@ export const GetRunLogsQuery = defineQuery({
|
|
|
302
405
|
}),
|
|
303
406
|
},
|
|
304
407
|
policy: { auth: 'user' },
|
|
408
|
+
acceptance: {
|
|
409
|
+
scenarios: [
|
|
410
|
+
{
|
|
411
|
+
key: 'get-run-logs-happy-path',
|
|
412
|
+
given: ['Run exists with logs'],
|
|
413
|
+
when: ['User requests logs'],
|
|
414
|
+
then: ['Paginated logs list is returned'],
|
|
415
|
+
},
|
|
416
|
+
],
|
|
417
|
+
examples: [
|
|
418
|
+
{
|
|
419
|
+
key: 'get-logs-filtered',
|
|
420
|
+
input: { runId: 'run-456', level: 'error', limit: 50 },
|
|
421
|
+
output: { items: [], total: 0, hasMore: false },
|
|
422
|
+
},
|
|
423
|
+
],
|
|
424
|
+
},
|
|
305
425
|
});
|
|
306
426
|
|
|
307
427
|
/**
|
|
@@ -309,7 +429,7 @@ export const GetRunLogsQuery = defineQuery({
|
|
|
309
429
|
*/
|
|
310
430
|
export const GetRunMetricsQuery = defineQuery({
|
|
311
431
|
meta: {
|
|
312
|
-
|
|
432
|
+
key: 'agent.run.getMetrics',
|
|
313
433
|
version: 1,
|
|
314
434
|
stability: 'stable',
|
|
315
435
|
owners: [...OWNERS],
|
|
@@ -367,4 +487,35 @@ export const GetRunMetricsQuery = defineQuery({
|
|
|
367
487
|
}),
|
|
368
488
|
},
|
|
369
489
|
policy: { auth: 'user' },
|
|
490
|
+
acceptance: {
|
|
491
|
+
scenarios: [
|
|
492
|
+
{
|
|
493
|
+
key: 'get-run-metrics-happy-path',
|
|
494
|
+
given: ['Organization has run history'],
|
|
495
|
+
when: ['User requests metrics for date range'],
|
|
496
|
+
then: ['Aggregated metrics are returned'],
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
examples: [
|
|
500
|
+
{
|
|
501
|
+
key: 'get-daily-metrics',
|
|
502
|
+
input: {
|
|
503
|
+
organizationId: 'org-123',
|
|
504
|
+
startDate: '2025-01-01',
|
|
505
|
+
endDate: '2025-01-31',
|
|
506
|
+
granularity: 'day',
|
|
507
|
+
},
|
|
508
|
+
output: {
|
|
509
|
+
totalRuns: 100,
|
|
510
|
+
completedRuns: 90,
|
|
511
|
+
failedRuns: 10,
|
|
512
|
+
totalTokens: 50000,
|
|
513
|
+
totalCostUsd: 5.0,
|
|
514
|
+
averageDurationMs: 2500,
|
|
515
|
+
successRate: 0.9,
|
|
516
|
+
timeline: [],
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
],
|
|
520
|
+
},
|
|
370
521
|
});
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PresentationSpec } from '@lssm/lib.contracts';
|
|
2
|
+
import { StabilityEnum } from '@lssm/lib.contracts';
|
|
2
3
|
import { RunSummaryModel } from './run.schema';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Presentation for displaying a list of agent runs.
|
|
6
7
|
*/
|
|
7
|
-
export const RunListPresentation:
|
|
8
|
+
export const RunListPresentation: PresentationSpec = {
|
|
8
9
|
meta: {
|
|
9
|
-
|
|
10
|
+
key: 'agent-console.run.list',
|
|
10
11
|
version: 1,
|
|
12
|
+
title: 'Run List',
|
|
11
13
|
description:
|
|
12
14
|
'List view of agent runs with status, tokens, and duration info',
|
|
15
|
+
goal: 'Provide an overview of agent execution history and performance.',
|
|
16
|
+
context: 'Run history dashboard.',
|
|
13
17
|
domain: 'agent-console',
|
|
14
18
|
owners: ['@agent-console-team'],
|
|
15
19
|
tags: ['run', 'list', 'dashboard'],
|
|
20
|
+
stability: StabilityEnum.Experimental,
|
|
16
21
|
},
|
|
17
22
|
source: {
|
|
18
23
|
type: 'component',
|
|
@@ -27,14 +32,18 @@ export const RunListPresentation: PresentationDescriptorV2 = {
|
|
|
27
32
|
/**
|
|
28
33
|
* Presentation for run detail view.
|
|
29
34
|
*/
|
|
30
|
-
export const RunDetailPresentation:
|
|
35
|
+
export const RunDetailPresentation: PresentationSpec = {
|
|
31
36
|
meta: {
|
|
32
|
-
|
|
37
|
+
key: 'agent-console.run.detail',
|
|
33
38
|
version: 1,
|
|
39
|
+
title: 'Run Details',
|
|
34
40
|
description: 'Detailed view of an agent run with steps, logs, and metrics',
|
|
41
|
+
goal: 'Allow users to inspect and debug a specific agent run.',
|
|
42
|
+
context: 'Detailed view of an agent run.',
|
|
35
43
|
domain: 'agent-console',
|
|
36
44
|
owners: ['@agent-console-team'],
|
|
37
45
|
tags: ['run', 'detail'],
|
|
46
|
+
stability: StabilityEnum.Experimental,
|
|
38
47
|
},
|
|
39
48
|
source: {
|
|
40
49
|
type: 'component',
|
package/src/tool/index.ts
CHANGED
package/src/tool/tool.entity.ts
CHANGED
package/src/tool/tool.event.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defineEvent, defineSchemaModel } from '@lssm/lib.contracts';
|
|
2
2
|
import { ScalarTypeEnum } from '@lssm/lib.schema';
|
|
3
3
|
|
|
4
|
+
const OWNERS = ['@agent-console-team'] as const;
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* Payload for tool created event.
|
|
6
8
|
*/
|
|
@@ -29,9 +31,14 @@ const ToolCreatedPayload = defineSchemaModel({
|
|
|
29
31
|
* ToolCreatedEvent - A new tool was created.
|
|
30
32
|
*/
|
|
31
33
|
export const ToolCreatedEvent = defineEvent({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
meta: {
|
|
35
|
+
key: 'agent.tool.created',
|
|
36
|
+
version: 1,
|
|
37
|
+
description: 'A new AI tool was created.',
|
|
38
|
+
stability: 'stable',
|
|
39
|
+
owners: [...OWNERS],
|
|
40
|
+
tags: ['tool', 'created'],
|
|
41
|
+
},
|
|
35
42
|
payload: ToolCreatedPayload,
|
|
36
43
|
});
|
|
37
44
|
|
|
@@ -62,9 +69,14 @@ const ToolUpdatedPayload = defineSchemaModel({
|
|
|
62
69
|
* ToolUpdatedEvent - A tool was updated.
|
|
63
70
|
*/
|
|
64
71
|
export const ToolUpdatedEvent = defineEvent({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
meta: {
|
|
73
|
+
key: 'agent.tool.updated',
|
|
74
|
+
version: 1,
|
|
75
|
+
description: 'An AI tool configuration was updated.',
|
|
76
|
+
stability: 'stable',
|
|
77
|
+
owners: [...OWNERS],
|
|
78
|
+
tags: ['tool', 'updated'],
|
|
79
|
+
},
|
|
68
80
|
payload: ToolUpdatedPayload,
|
|
69
81
|
});
|
|
70
82
|
|
|
@@ -94,9 +106,14 @@ const ToolStatusChangedPayload = defineSchemaModel({
|
|
|
94
106
|
* ToolStatusChangedEvent - A tool's status was changed.
|
|
95
107
|
*/
|
|
96
108
|
export const ToolStatusChangedEvent = defineEvent({
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
109
|
+
meta: {
|
|
110
|
+
key: 'agent.tool.statusChanged',
|
|
111
|
+
version: 1,
|
|
112
|
+
description:
|
|
113
|
+
'An AI tool status was changed (activated, deprecated, disabled).',
|
|
114
|
+
stability: 'stable',
|
|
115
|
+
owners: [...OWNERS],
|
|
116
|
+
tags: ['tool', 'status'],
|
|
117
|
+
},
|
|
101
118
|
payload: ToolStatusChangedPayload,
|
|
102
119
|
});
|