@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.
Files changed (149) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +133 -0
  2. package/.turbo/turbo-build.log +129 -41
  3. package/CHANGELOG.md +40 -0
  4. package/LICENSE +21 -0
  5. package/README.md +3 -0
  6. package/dist/agent/agent.entity.d.ts +55 -0
  7. package/dist/agent/agent.entity.d.ts.map +1 -0
  8. package/dist/agent/agent.entity.js +136 -1
  9. package/dist/agent/agent.entity.js.map +1 -0
  10. package/dist/agent/agent.enum.d.ts +18 -0
  11. package/dist/agent/agent.enum.d.ts.map +1 -0
  12. package/dist/agent/agent.enum.js +34 -1
  13. package/dist/agent/agent.enum.js.map +1 -0
  14. package/dist/agent/agent.event.d.ts +128 -0
  15. package/dist/agent/agent.event.d.ts.map +1 -0
  16. package/dist/agent/agent.event.js +210 -1
  17. package/dist/agent/agent.event.js.map +1 -0
  18. package/dist/agent/agent.handler.d.ts +100 -0
  19. package/dist/agent/agent.handler.d.ts.map +1 -0
  20. package/dist/agent/agent.handler.js +84 -1
  21. package/dist/agent/agent.handler.js.map +1 -0
  22. package/dist/agent/agent.operation.d.ts +471 -0
  23. package/dist/agent/agent.operation.d.ts.map +1 -0
  24. package/dist/agent/agent.operation.js +486 -0
  25. package/dist/agent/agent.operation.js.map +1 -0
  26. package/dist/agent/agent.presentation.d.ts +19 -0
  27. package/dist/agent/agent.presentation.d.ts.map +1 -0
  28. package/dist/agent/agent.presentation.js +89 -1
  29. package/dist/agent/agent.presentation.js.map +1 -0
  30. package/dist/agent/agent.schema.d.ts +401 -0
  31. package/dist/agent/agent.schema.d.ts.map +1 -0
  32. package/dist/agent/agent.schema.js +406 -1
  33. package/dist/agent/agent.schema.js.map +1 -0
  34. package/dist/agent/index.d.ts +8 -0
  35. package/dist/agent/index.js +9 -1
  36. package/dist/agent.feature.d.ts +12 -0
  37. package/dist/agent.feature.d.ts.map +1 -0
  38. package/dist/agent.feature.js +303 -1
  39. package/dist/agent.feature.js.map +1 -0
  40. package/dist/docs/agent-console.docblock.d.ts +1 -0
  41. package/dist/docs/agent-console.docblock.js +69 -5
  42. package/dist/docs/agent-console.docblock.js.map +1 -0
  43. package/dist/docs/index.d.ts +1 -0
  44. package/dist/docs/index.js +1 -1
  45. package/dist/example.d.ts +40 -0
  46. package/dist/example.d.ts.map +1 -0
  47. package/dist/example.js +51 -1
  48. package/dist/example.js.map +1 -0
  49. package/dist/handlers/index.d.ts +4 -0
  50. package/dist/handlers/index.js +5 -1
  51. package/dist/index.d.ts +30 -0
  52. package/dist/index.js +32 -1
  53. package/dist/presentations/index.d.ts +4 -0
  54. package/dist/presentations/index.js +5 -1
  55. package/dist/run/index.d.ts +8 -0
  56. package/dist/run/index.js +9 -1
  57. package/dist/run/run.entity.d.ts +82 -0
  58. package/dist/run/run.entity.d.ts.map +1 -0
  59. package/dist/run/run.entity.js +205 -1
  60. package/dist/run/run.entity.js.map +1 -0
  61. package/dist/run/run.enum.d.ts +22 -0
  62. package/dist/run/run.enum.d.ts.map +1 -0
  63. package/dist/run/run.enum.js +45 -1
  64. package/dist/run/run.enum.js.map +1 -0
  65. package/dist/run/run.event.d.ts +290 -0
  66. package/dist/run/run.event.d.ts.map +1 -0
  67. package/dist/run/run.event.js +434 -1
  68. package/dist/run/run.event.js.map +1 -0
  69. package/dist/run/run.handler.d.ts +203 -0
  70. package/dist/run/run.handler.d.ts.map +1 -0
  71. package/dist/run/run.handler.js +83 -1
  72. package/dist/run/run.handler.js.map +1 -0
  73. package/dist/run/run.operation.d.ts +720 -0
  74. package/dist/run/run.operation.d.ts.map +1 -0
  75. package/dist/run/run.operation.js +626 -0
  76. package/dist/run/run.operation.js.map +1 -0
  77. package/dist/run/run.presentation.d.ts +15 -0
  78. package/dist/run/run.presentation.d.ts.map +1 -0
  79. package/dist/run/run.presentation.js +65 -1
  80. package/dist/run/run.presentation.js.map +1 -0
  81. package/dist/run/run.schema.d.ts +416 -0
  82. package/dist/run/run.schema.d.ts.map +1 -0
  83. package/dist/run/run.schema.js +338 -1
  84. package/dist/run/run.schema.js.map +1 -0
  85. package/dist/shared/index.d.ts +4 -0
  86. package/dist/shared/index.js +5 -1
  87. package/dist/shared/mock-agents.d.ts +88 -0
  88. package/dist/shared/mock-agents.d.ts.map +1 -0
  89. package/dist/shared/mock-agents.js +94 -1
  90. package/dist/shared/mock-agents.js.map +1 -0
  91. package/dist/shared/mock-runs.d.ts +120 -0
  92. package/dist/shared/mock-runs.d.ts.map +1 -0
  93. package/dist/shared/mock-runs.js +118 -1
  94. package/dist/shared/mock-runs.js.map +1 -0
  95. package/dist/shared/mock-tools.d.ts +244 -0
  96. package/dist/shared/mock-tools.d.ts.map +1 -0
  97. package/dist/shared/mock-tools.js +181 -1
  98. package/dist/shared/mock-tools.js.map +1 -0
  99. package/dist/tool/index.d.ts +8 -0
  100. package/dist/tool/index.js +9 -1
  101. package/dist/tool/tool.entity.d.ts +42 -0
  102. package/dist/tool/tool.entity.d.ts.map +1 -0
  103. package/dist/tool/tool.entity.js +105 -1
  104. package/dist/tool/tool.entity.js.map +1 -0
  105. package/dist/tool/tool.enum.d.ts +18 -0
  106. package/dist/tool/tool.enum.d.ts.map +1 -0
  107. package/dist/tool/tool.enum.js +35 -1
  108. package/dist/tool/tool.enum.js.map +1 -0
  109. package/dist/tool/tool.event.d.ts +103 -0
  110. package/dist/tool/tool.event.d.ts.map +1 -0
  111. package/dist/tool/tool.event.js +159 -1
  112. package/dist/tool/tool.event.js.map +1 -0
  113. package/dist/tool/tool.handler.d.ts +315 -0
  114. package/dist/tool/tool.handler.d.ts.map +1 -0
  115. package/dist/tool/tool.handler.js +87 -1
  116. package/dist/tool/tool.handler.js.map +1 -0
  117. package/dist/tool/tool.operation.d.ts +411 -0
  118. package/dist/tool/tool.operation.d.ts.map +1 -0
  119. package/dist/tool/tool.operation.js +406 -0
  120. package/dist/tool/tool.operation.js.map +1 -0
  121. package/dist/tool/tool.presentation.d.ts +15 -0
  122. package/dist/tool/tool.presentation.d.ts.map +1 -0
  123. package/dist/tool/tool.presentation.js +65 -1
  124. package/dist/tool/tool.presentation.js.map +1 -0
  125. package/dist/tool/tool.schema.d.ts +218 -0
  126. package/dist/tool/tool.schema.d.ts.map +1 -0
  127. package/dist/tool/tool.schema.js +236 -1
  128. package/dist/tool/tool.schema.js.map +1 -0
  129. package/package.json +59 -49
  130. package/src/agent/agent.entity.ts +1 -6
  131. package/src/agent/agent.event.ts +34 -12
  132. package/src/agent/{agent.contracts.ts → agent.operation.ts} +176 -10
  133. package/src/agent/agent.presentation.ts +20 -7
  134. package/src/agent/index.ts +1 -1
  135. package/src/agent.feature.ts +58 -56
  136. package/src/run/index.ts +1 -1
  137. package/src/run/run.entity.ts +1 -6
  138. package/src/run/run.event.ts +58 -21
  139. package/src/run/{run.contracts.ts → run.operation.ts} +165 -14
  140. package/src/run/run.presentation.ts +14 -5
  141. package/src/tool/index.ts +1 -1
  142. package/src/tool/tool.entity.ts +1 -6
  143. package/src/tool/tool.event.ts +27 -10
  144. package/src/tool/{tool.contracts.ts → tool.operation.ts} +133 -10
  145. package/src/tool/tool.presentation.ts +14 -5
  146. package/tsconfig.tsbuildinfo +1 -1
  147. package/dist/agent/agent.contracts.js +0 -1
  148. package/dist/run/run.contracts.js +0 -1
  149. package/dist/tool/tool.contracts.js +0 -1
@@ -1,21 +1,21 @@
1
- import { defineCommand, defineQuery } from '@lssm/lib.contracts/spec';
1
+ import { defineCommand, defineQuery } from '@lssm/lib.contracts/operations';
2
2
  import { defineSchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';
3
3
  import { ToolCategoryEnum, ToolStatusEnum } from './tool.enum';
4
4
  import {
5
+ CreateToolInputModel,
5
6
  ToolModel,
6
7
  ToolSummaryModel,
7
- CreateToolInputModel,
8
8
  UpdateToolInputModel,
9
9
  } from './tool.schema';
10
10
 
11
- const OWNERS = ['agent-console-team'] as const;
11
+ const OWNERS = ['@agent-console-team'] as const;
12
12
 
13
13
  /**
14
14
  * CreateToolCommand - Creates a new tool definition.
15
15
  */
16
16
  export const CreateToolCommand = defineCommand({
17
17
  meta: {
18
- name: 'agent.tool.create',
18
+ key: 'agent.tool.create',
19
19
  version: 1,
20
20
  stability: 'stable',
21
21
  owners: [...OWNERS],
@@ -48,14 +48,50 @@ export const CreateToolCommand = defineCommand({
48
48
  sideEffects: {
49
49
  emits: [
50
50
  {
51
- name: 'tool.created',
51
+ key: 'tool.created',
52
52
  version: 1,
53
+ stability: 'stable',
54
+ owners: [...OWNERS],
55
+ tags: ['tool', 'created'],
53
56
  when: 'Tool is successfully created',
54
57
  payload: ToolSummaryModel,
55
58
  },
56
59
  ],
57
60
  audit: ['tool.created'],
58
61
  },
62
+ acceptance: {
63
+ scenarios: [
64
+ {
65
+ key: 'create-tool-happy-path',
66
+ given: ['User is authenticated', 'Organization exists'],
67
+ when: ['User submits valid tool configuration'],
68
+ then: ['New tool is created', 'ToolCreated event is emitted'],
69
+ },
70
+ {
71
+ key: 'create-tool-slug-conflict',
72
+ given: ['Tool with same slug exists'],
73
+ when: ['User submits tool with duplicate slug'],
74
+ then: ['SLUG_EXISTS error is returned'],
75
+ },
76
+ ],
77
+ examples: [
78
+ {
79
+ key: 'create-api-tool',
80
+ input: {
81
+ name: 'Weather API',
82
+ slug: 'weather-api',
83
+ category: 'api',
84
+ description: 'Fetches weather data',
85
+ },
86
+ output: {
87
+ id: 'tool-123',
88
+ name: 'Weather API',
89
+ slug: 'weather-api',
90
+ status: 'draft',
91
+ },
92
+ },
93
+ ],
94
+ },
59
95
  });
60
96
 
61
97
  /**
@@ -63,7 +99,7 @@ export const CreateToolCommand = defineCommand({
63
99
  */
64
100
  export const UpdateToolCommand = defineCommand({
65
101
  meta: {
66
- name: 'agent.tool.update',
102
+ key: 'agent.tool.update',
67
103
  version: 1,
68
104
  stability: 'stable',
69
105
  owners: [...OWNERS],
@@ -96,14 +132,39 @@ export const UpdateToolCommand = defineCommand({
96
132
  sideEffects: {
97
133
  emits: [
98
134
  {
99
- name: 'tool.updated',
135
+ key: 'tool.updated',
100
136
  version: 1,
137
+ stability: 'stable',
138
+ owners: [...OWNERS],
139
+ tags: ['tool', 'updated'],
101
140
  when: 'Tool is updated',
102
141
  payload: ToolSummaryModel,
103
142
  },
104
143
  ],
105
144
  audit: ['tool.updated'],
106
145
  },
146
+ acceptance: {
147
+ scenarios: [
148
+ {
149
+ key: 'update-tool-happy-path',
150
+ given: ['Tool exists', 'User owns the tool'],
151
+ when: ['User submits updated configuration'],
152
+ then: ['Tool is updated', 'ToolUpdated event is emitted'],
153
+ },
154
+ ],
155
+ examples: [
156
+ {
157
+ key: 'update-description',
158
+ input: { toolId: 'tool-123', description: 'Updated weather API tool' },
159
+ output: {
160
+ id: 'tool-123',
161
+ name: 'Weather API',
162
+ status: 'draft',
163
+ updatedAt: '2025-01-01T00:00:00Z',
164
+ },
165
+ },
166
+ ],
167
+ },
107
168
  });
108
169
 
109
170
  /**
@@ -111,7 +172,7 @@ export const UpdateToolCommand = defineCommand({
111
172
  */
112
173
  export const GetToolQuery = defineQuery({
113
174
  meta: {
114
- name: 'agent.tool.get',
175
+ key: 'agent.tool.get',
115
176
  version: 1,
116
177
  stability: 'stable',
117
178
  owners: [...OWNERS],
@@ -138,6 +199,28 @@ export const GetToolQuery = defineQuery({
138
199
  },
139
200
  },
140
201
  policy: { auth: 'user' },
202
+ acceptance: {
203
+ scenarios: [
204
+ {
205
+ key: 'get-tool-happy-path',
206
+ given: ['Tool exists'],
207
+ when: ['User requests tool by ID'],
208
+ then: ['Tool details are returned'],
209
+ },
210
+ ],
211
+ examples: [
212
+ {
213
+ key: 'get-basic',
214
+ input: { toolId: 'tool-123' },
215
+ output: {
216
+ id: 'tool-123',
217
+ name: 'Weather API',
218
+ status: 'active',
219
+ category: 'api',
220
+ },
221
+ },
222
+ ],
223
+ },
141
224
  });
142
225
 
143
226
  /**
@@ -145,7 +228,7 @@ export const GetToolQuery = defineQuery({
145
228
  */
146
229
  export const ListToolsQuery = defineQuery({
147
230
  meta: {
148
- name: 'agent.tool.list',
231
+ key: 'agent.tool.list',
149
232
  version: 1,
150
233
  stability: 'stable',
151
234
  owners: [...OWNERS],
@@ -187,6 +270,23 @@ export const ListToolsQuery = defineQuery({
187
270
  }),
188
271
  },
189
272
  policy: { auth: 'user' },
273
+ acceptance: {
274
+ scenarios: [
275
+ {
276
+ key: 'list-tools-happy-path',
277
+ given: ['Organization has tools'],
278
+ when: ['User lists tools'],
279
+ then: ['Paginated list of tools is returned'],
280
+ },
281
+ ],
282
+ examples: [
283
+ {
284
+ key: 'list-by-category',
285
+ input: { organizationId: 'org-123', category: 'api', limit: 10 },
286
+ output: { items: [], total: 0, hasMore: false },
287
+ },
288
+ ],
289
+ },
190
290
  });
191
291
 
192
292
  /**
@@ -194,7 +294,7 @@ export const ListToolsQuery = defineQuery({
194
294
  */
195
295
  export const TestToolCommand = defineCommand({
196
296
  meta: {
197
- name: 'agent.tool.test',
297
+ key: 'agent.tool.test',
198
298
  version: 1,
199
299
  stability: 'stable',
200
300
  owners: [...OWNERS],
@@ -237,4 +337,27 @@ export const TestToolCommand = defineCommand({
237
337
  },
238
338
  policy: { auth: 'user' },
239
339
  sideEffects: { audit: ['tool.tested'] },
340
+ acceptance: {
341
+ scenarios: [
342
+ {
343
+ key: 'test-tool-success',
344
+ given: ['Tool exists', 'Tool is configured correctly'],
345
+ when: ['User runs test with valid input'],
346
+ then: ['Tool executes successfully', 'Output is returned'],
347
+ },
348
+ {
349
+ key: 'test-tool-failure',
350
+ given: ['Tool exists', 'Tool has configuration error'],
351
+ when: ['User runs test'],
352
+ then: ['TOOL_EXECUTION_ERROR is returned'],
353
+ },
354
+ ],
355
+ examples: [
356
+ {
357
+ key: 'test-weather-api',
358
+ input: { toolId: 'tool-123', testInput: { city: 'Paris' } },
359
+ output: { success: true, output: { temperature: 22 }, durationMs: 150 },
360
+ },
361
+ ],
362
+ },
240
363
  });
@@ -1,18 +1,23 @@
1
- import type { PresentationDescriptorV2 } from '@lssm/lib.contracts';
1
+ import type { PresentationSpec } from '@lssm/lib.contracts';
2
+ import { StabilityEnum } from '@lssm/lib.contracts';
2
3
  import { ToolSummaryModel } from './tool.schema';
3
4
 
4
5
  /**
5
6
  * Presentation for displaying a list of tools.
6
7
  */
7
- export const ToolListPresentation: PresentationDescriptorV2 = {
8
+ export const ToolListPresentation: PresentationSpec = {
8
9
  meta: {
9
- name: 'agent-console.tool.list',
10
+ key: 'agent-console.tool.list',
10
11
  version: 1,
12
+ title: 'Tool List',
11
13
  description:
12
14
  'List view of AI tools with category, status, and version info',
15
+ goal: 'Provide an overview of all available tools for agents.',
16
+ context: 'Tool management dashboard.',
13
17
  domain: 'agent-console',
14
18
  owners: ['@agent-console-team'],
15
19
  tags: ['tool', 'list', 'dashboard'],
20
+ stability: StabilityEnum.Experimental,
16
21
  },
17
22
  source: {
18
23
  type: 'component',
@@ -27,15 +32,19 @@ export const ToolListPresentation: PresentationDescriptorV2 = {
27
32
  /**
28
33
  * Presentation for tool detail view.
29
34
  */
30
- export const ToolDetailPresentation: PresentationDescriptorV2 = {
35
+ export const ToolDetailPresentation: PresentationSpec = {
31
36
  meta: {
32
- name: 'agent-console.tool.detail',
37
+ key: 'agent-console.tool.detail',
33
38
  version: 1,
39
+ title: 'Tool Details',
34
40
  description:
35
41
  'Detailed view of an AI tool with configuration and test panel',
42
+ goal: 'Allow users to inspect and test a specific tool.',
43
+ context: 'Detailed view of a tool.',
36
44
  domain: 'agent-console',
37
45
  owners: ['@agent-console-team'],
38
46
  tags: ['tool', 'detail'],
47
+ stability: StabilityEnum.Experimental,
39
48
  },
40
49
  source: {
41
50
  type: 'component',