@lssm/example.agent-console 0.0.0-canary-20251206160926
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 +202 -0
- package/CHANGELOG.md +13 -0
- package/README.md +83 -0
- package/dist/contracts/agent.d.ts +886 -0
- package/dist/contracts/agent.js +1 -0
- package/dist/contracts/index.d.ts +4 -0
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/run.d.ts +1106 -0
- package/dist/contracts/run.js +1 -0
- package/dist/contracts/tool.d.ts +607 -0
- package/dist/contracts/tool.js +1 -0
- package/dist/entities/agent.d.ts +54 -0
- package/dist/entities/agent.js +1 -0
- package/dist/entities/index.d.ts +4 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/log.d.ts +31 -0
- package/dist/entities/log.js +1 -0
- package/dist/entities/run.d.ts +85 -0
- package/dist/entities/run.js +1 -0
- package/dist/entities/tool.d.ts +36 -0
- package/dist/entities/tool.js +1 -0
- package/dist/events.d.ts +965 -0
- package/dist/events.js +1 -0
- package/dist/feature.d.ts +11 -0
- package/dist/feature.js +1 -0
- package/dist/handlers/agent.handlers.d.ts +99 -0
- package/dist/handlers/agent.handlers.js +1 -0
- package/dist/handlers/index.d.ts +5 -0
- package/dist/handlers/index.js +1 -0
- package/dist/handlers/mock-data.d.ts +533 -0
- package/dist/handlers/mock-data.js +1 -0
- package/dist/handlers/run.handlers.d.ts +145 -0
- package/dist/handlers/run.handlers.js +1 -0
- package/dist/handlers/tool.handlers.d.ts +86 -0
- package/dist/handlers/tool.handlers.js +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +1 -0
- package/dist/libs/contracts/dist/capabilities/openbanking.js +1 -0
- package/dist/libs/contracts/dist/client/index.js +1 -0
- package/dist/libs/contracts/dist/client/react/feature-render.js +1 -0
- package/dist/libs/contracts/dist/client/react/form-render.js +1 -0
- package/dist/libs/contracts/dist/client/react/index.js +1 -0
- package/dist/libs/contracts/dist/events.js +1 -0
- package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
- package/dist/libs/contracts/dist/graphql-federation/dist/index.js +1 -0
- package/dist/libs/contracts/dist/index.js +1 -0
- package/dist/libs/contracts/dist/install.js +1 -0
- package/dist/libs/contracts/dist/integrations/contracts.js +1 -0
- package/dist/libs/contracts/dist/integrations/index.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +1 -0
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/elevenlabs-voice.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/gcs-storage.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/gmail-inbound.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/gmail-outbound.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/google-calendar.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/index.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/mistral-embedding.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/mistral-llm.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/postmark-email.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/powens-client.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/powens-openbanking.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/provider-factory.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/qdrant-vector.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/stripe-payments.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/impls/twilio-sms.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/index.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/powens.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +1 -0
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +1 -0
- package/dist/libs/contracts/dist/integrations/runtime.js +1 -0
- package/dist/libs/contracts/dist/integrations/secrets/env-secret-provider.js +1 -0
- package/dist/libs/contracts/dist/integrations/secrets/gcp-secret-manager.js +1 -0
- package/dist/libs/contracts/dist/integrations/secrets/index.js +1 -0
- package/dist/libs/contracts/dist/integrations/secrets/manager.js +1 -0
- package/dist/libs/contracts/dist/integrations/secrets/provider.js +1 -0
- package/dist/libs/contracts/dist/jsonschema.js +1 -0
- package/dist/libs/contracts/dist/knowledge/contracts.js +1 -0
- package/dist/libs/contracts/dist/knowledge/index.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +1 -0
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +1 -0
- package/dist/libs/contracts/dist/onboarding-base.js +1 -0
- package/dist/libs/contracts/dist/ownership.js +1 -0
- package/dist/libs/contracts/dist/presentations.js +1 -0
- package/dist/libs/contracts/dist/presentations.v2.js +1 -0
- package/dist/libs/contracts/dist/prompt.js +1 -0
- package/dist/libs/contracts/dist/promptRegistry.js +1 -0
- package/dist/libs/contracts/dist/regenerator/index.js +1 -0
- package/dist/libs/contracts/dist/regenerator/service.js +1 -0
- package/dist/libs/contracts/dist/registry.js +1 -0
- package/dist/libs/contracts/dist/resources.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/index.js +1 -0
- package/dist/libs/contracts/dist/server/graphql-pothos.js +1 -0
- package/dist/libs/contracts/dist/server/graphql-schema-export.js +1 -0
- package/dist/libs/contracts/dist/server/index.js +1 -0
- package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
- package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
- package/dist/libs/contracts/dist/server/rest-express.js +1 -0
- package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
- package/dist/libs/contracts/dist/spec.js +1 -0
- package/dist/libs/contracts/dist/telemetry/index.js +1 -0
- package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
- package/dist/libs/contracts/dist/tests/index.js +1 -0
- package/dist/libs/contracts/dist/tests/runner.js +1 -0
- package/dist/libs/contracts/dist/workflow/index.js +1 -0
- package/dist/libs/contracts/dist/workflow/runner.js +1 -0
- package/dist/libs/schema/dist/EnumType.js +1 -0
- package/dist/libs/schema/dist/FieldType.js +1 -0
- package/dist/libs/schema/dist/ScalarTypeEnum.js +1 -0
- package/dist/libs/schema/dist/SchemaModel.js +1 -0
- package/dist/libs/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/schema/dist/entity/index.js +1 -0
- package/dist/libs/schema/dist/entity/types.js +1 -0
- package/dist/libs/schema/dist/index.js +1 -0
- package/dist/presentations/agent-list.d.ts +15 -0
- package/dist/presentations/agent-list.js +1 -0
- package/dist/presentations/dashboard.d.ts +11 -0
- package/dist/presentations/dashboard.js +1 -0
- package/dist/presentations/index.d.ts +11 -0
- package/dist/presentations/index.js +1 -0
- package/dist/presentations/run-list.d.ts +18 -0
- package/dist/presentations/run-list.js +1 -0
- package/dist/presentations/tool-registry.d.ts +14 -0
- package/dist/presentations/tool-registry.js +1 -0
- package/package.json +86 -0
- package/src/contracts/agent.ts +501 -0
- package/src/contracts/index.ts +29 -0
- package/src/contracts/run.ts +561 -0
- package/src/contracts/tool.ts +392 -0
- package/src/entities/agent.ts +151 -0
- package/src/entities/index.ts +20 -0
- package/src/entities/log.ts +76 -0
- package/src/entities/run.ts +240 -0
- package/src/entities/tool.ts +105 -0
- package/src/events.ts +419 -0
- package/src/feature.ts +144 -0
- package/src/handlers/agent.handlers.ts +203 -0
- package/src/handlers/index.ts +55 -0
- package/src/handlers/mock-data.ts +413 -0
- package/src/handlers/run.handlers.ts +331 -0
- package/src/handlers/tool.handlers.ts +188 -0
- package/src/index.ts +34 -0
- package/src/presentations/agent-list.ts +55 -0
- package/src/presentations/dashboard.ts +29 -0
- package/src/presentations/index.ts +48 -0
- package/src/presentations/run-list.ts +76 -0
- package/src/presentations/tool-registry.ts +52 -0
- package/tsconfig.json +10 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsdown.config.js +7 -0
package/src/events.ts
ADDED
|
@@ -0,0 +1,419 @@
|
|
|
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
|
+
});
|
package/src/feature.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Console Feature Module Specification
|
|
3
|
+
*
|
|
4
|
+
* Defines the feature module for agent orchestration capabilities.
|
|
5
|
+
*/
|
|
6
|
+
import type { FeatureModuleSpec } from '@lssm/lib.contracts';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Agent Console feature module that bundles all agent, tool, and run
|
|
10
|
+
* operations, events, and presentations into an installable feature.
|
|
11
|
+
*/
|
|
12
|
+
export const AgentConsoleFeature: FeatureModuleSpec = {
|
|
13
|
+
meta: {
|
|
14
|
+
key: 'agent-console',
|
|
15
|
+
title: 'AI Agent Console',
|
|
16
|
+
description: 'AI agent orchestration with tools, runs, and logs management',
|
|
17
|
+
domain: 'ai-ops',
|
|
18
|
+
owners: ['agent-console-team'],
|
|
19
|
+
tags: ['ai', 'agents', 'orchestration'],
|
|
20
|
+
stability: 'experimental',
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// All contract operations included in this feature
|
|
24
|
+
operations: [
|
|
25
|
+
// Agent operations
|
|
26
|
+
{ name: 'agent.agent.create', version: 1 },
|
|
27
|
+
{ name: 'agent.agent.update', version: 1 },
|
|
28
|
+
{ name: 'agent.agent.get', version: 1 },
|
|
29
|
+
{ name: 'agent.agent.list', version: 1 },
|
|
30
|
+
{ name: 'agent.agent.assignTool', version: 1 },
|
|
31
|
+
{ name: 'agent.agent.removeTool', version: 1 },
|
|
32
|
+
|
|
33
|
+
// Tool operations
|
|
34
|
+
{ name: 'agent.tool.create', version: 1 },
|
|
35
|
+
{ name: 'agent.tool.update', version: 1 },
|
|
36
|
+
{ name: 'agent.tool.get', version: 1 },
|
|
37
|
+
{ name: 'agent.tool.list', version: 1 },
|
|
38
|
+
{ name: 'agent.tool.test', version: 1 },
|
|
39
|
+
|
|
40
|
+
// Run operations
|
|
41
|
+
{ name: 'agent.run.execute', version: 1 },
|
|
42
|
+
{ name: 'agent.run.cancel', version: 1 },
|
|
43
|
+
{ name: 'agent.run.get', version: 1 },
|
|
44
|
+
{ name: 'agent.run.list', version: 1 },
|
|
45
|
+
{ name: 'agent.run.getSteps', version: 1 },
|
|
46
|
+
{ name: 'agent.run.getLogs', version: 1 },
|
|
47
|
+
{ name: 'agent.run.getMetrics', version: 1 },
|
|
48
|
+
],
|
|
49
|
+
|
|
50
|
+
// Events emitted by this feature
|
|
51
|
+
events: [
|
|
52
|
+
// Agent events
|
|
53
|
+
{ name: 'agent.created', version: 1 },
|
|
54
|
+
{ name: 'agent.updated', version: 1 },
|
|
55
|
+
{ name: 'agent.deleted', version: 1 },
|
|
56
|
+
|
|
57
|
+
// Tool events
|
|
58
|
+
{ name: 'tool.created', version: 1 },
|
|
59
|
+
{ name: 'tool.updated', version: 1 },
|
|
60
|
+
|
|
61
|
+
// Run events
|
|
62
|
+
{ name: 'run.started', version: 1 },
|
|
63
|
+
{ name: 'run.completed', version: 1 },
|
|
64
|
+
{ name: 'run.failed', version: 1 },
|
|
65
|
+
{ name: 'run.cancelled', version: 1 },
|
|
66
|
+
],
|
|
67
|
+
|
|
68
|
+
// Presentations associated with this feature
|
|
69
|
+
presentations: [
|
|
70
|
+
{ name: 'agent-console.dashboard', version: 1 },
|
|
71
|
+
{ name: 'agent-console.agent.list', version: 1 },
|
|
72
|
+
{ name: 'agent-console.agent.detail', version: 1 },
|
|
73
|
+
{ name: 'agent-console.run.list', version: 1 },
|
|
74
|
+
{ name: 'agent-console.run.detail', version: 1 },
|
|
75
|
+
{ name: 'agent-console.run.metrics', version: 1 },
|
|
76
|
+
{ name: 'agent-console.tool.registry', version: 1 },
|
|
77
|
+
{ name: 'agent-console.tool.detail', version: 1 },
|
|
78
|
+
],
|
|
79
|
+
|
|
80
|
+
// Link operations to their primary presentations
|
|
81
|
+
opToPresentation: [
|
|
82
|
+
{
|
|
83
|
+
op: { name: 'agent.agent.list', version: 1 },
|
|
84
|
+
pres: { name: 'agent-console.agent.list', version: 1 },
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
op: { name: 'agent.agent.get', version: 1 },
|
|
88
|
+
pres: { name: 'agent-console.agent.detail', version: 1 },
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
op: { name: 'agent.run.list', version: 1 },
|
|
92
|
+
pres: { name: 'agent-console.run.list', version: 1 },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
op: { name: 'agent.run.get', version: 1 },
|
|
96
|
+
pres: { name: 'agent-console.run.detail', version: 1 },
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
op: { name: 'agent.run.getMetrics', version: 1 },
|
|
100
|
+
pres: { name: 'agent-console.run.metrics', version: 1 },
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
op: { name: 'agent.tool.list', version: 1 },
|
|
104
|
+
pres: { name: 'agent-console.tool.registry', version: 1 },
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
op: { name: 'agent.tool.get', version: 1 },
|
|
108
|
+
pres: { name: 'agent-console.tool.detail', version: 1 },
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
|
|
112
|
+
// Target requirements for multi-surface rendering
|
|
113
|
+
presentationsTargets: [
|
|
114
|
+
{
|
|
115
|
+
name: 'agent-console.dashboard',
|
|
116
|
+
version: 1,
|
|
117
|
+
targets: ['react', 'markdown'],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'agent-console.agent.list',
|
|
121
|
+
version: 1,
|
|
122
|
+
targets: ['react', 'markdown', 'application/json'],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'agent-console.run.list',
|
|
126
|
+
version: 1,
|
|
127
|
+
targets: ['react', 'markdown', 'application/json'],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'agent-console.tool.registry',
|
|
131
|
+
version: 1,
|
|
132
|
+
targets: ['react', 'markdown', 'application/json'],
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
|
|
136
|
+
// Capability requirements
|
|
137
|
+
capabilities: {
|
|
138
|
+
requires: [
|
|
139
|
+
{ key: 'identity', version: 1 },
|
|
140
|
+
{ key: 'audit-trail', version: 1 },
|
|
141
|
+
{ key: 'jobs', version: 1 },
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
};
|