@memberjunction/ng-dashboards 2.48.0 → 2.50.0

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 (92) hide show
  1. package/README.md +105 -2
  2. package/dist/AI/ai-dashboard.component.d.ts +2 -0
  3. package/dist/AI/ai-dashboard.component.d.ts.map +1 -1
  4. package/dist/AI/ai-dashboard.component.js +66 -43
  5. package/dist/AI/ai-dashboard.component.js.map +1 -1
  6. package/dist/AI/components/agents/agent-configuration.component.js +45 -58
  7. package/dist/AI/components/agents/agent-configuration.component.js.map +1 -1
  8. package/dist/AI/components/agents/agent-editor.component.d.ts +6 -1
  9. package/dist/AI/components/agents/agent-editor.component.d.ts.map +1 -1
  10. package/dist/AI/components/agents/agent-editor.component.js +368 -366
  11. package/dist/AI/components/agents/agent-editor.component.js.map +1 -1
  12. package/dist/AI/components/agents/agent-filter-panel.component.js +83 -85
  13. package/dist/AI/components/agents/agent-filter-panel.component.js.map +1 -1
  14. package/dist/AI/components/charts/performance-heatmap.component.d.ts +66 -0
  15. package/dist/AI/components/charts/performance-heatmap.component.d.ts.map +1 -0
  16. package/dist/AI/components/charts/performance-heatmap.component.js +428 -0
  17. package/dist/AI/components/charts/performance-heatmap.component.js.map +1 -0
  18. package/dist/AI/components/charts/time-series-chart.component.d.ts +66 -0
  19. package/dist/AI/components/charts/time-series-chart.component.d.ts.map +1 -0
  20. package/dist/AI/components/charts/time-series-chart.component.js +547 -0
  21. package/dist/AI/components/charts/time-series-chart.component.js.map +1 -0
  22. package/dist/AI/components/execution-monitoring.component.d.ts +157 -5
  23. package/dist/AI/components/execution-monitoring.component.d.ts.map +1 -1
  24. package/dist/AI/components/execution-monitoring.component.js +2032 -20
  25. package/dist/AI/components/execution-monitoring.component.js.map +1 -1
  26. package/dist/AI/components/models/model-management.component.js +211 -237
  27. package/dist/AI/components/models/model-management.component.js.map +1 -1
  28. package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js +208 -226
  29. package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js.map +1 -1
  30. package/dist/AI/components/prompts/prompt-filter-panel.component.js +97 -99
  31. package/dist/AI/components/prompts/prompt-filter-panel.component.js.map +1 -1
  32. package/dist/AI/components/prompts/prompt-management.component.js +381 -424
  33. package/dist/AI/components/prompts/prompt-management.component.js.map +1 -1
  34. package/dist/AI/components/prompts/prompt-version-control.component.js +173 -191
  35. package/dist/AI/components/prompts/prompt-version-control.component.js.map +1 -1
  36. package/dist/AI/components/system/system-config-filter-panel.component.js +85 -87
  37. package/dist/AI/components/system/system-config-filter-panel.component.js.map +1 -1
  38. package/dist/AI/components/system/system-configuration.component.js +86 -99
  39. package/dist/AI/components/system/system-configuration.component.js.map +1 -1
  40. package/dist/AI/components/widgets/kpi-card.component.d.ts +25 -0
  41. package/dist/AI/components/widgets/kpi-card.component.d.ts.map +1 -0
  42. package/dist/AI/components/widgets/kpi-card.component.js +163 -0
  43. package/dist/AI/components/widgets/kpi-card.component.js.map +1 -0
  44. package/dist/AI/components/widgets/live-execution-widget.component.d.ts +25 -0
  45. package/dist/AI/components/widgets/live-execution-widget.component.d.ts.map +1 -0
  46. package/dist/AI/components/widgets/live-execution-widget.component.js +298 -0
  47. package/dist/AI/components/widgets/live-execution-widget.component.js.map +1 -0
  48. package/dist/AI/index.d.ts +7 -0
  49. package/dist/AI/index.d.ts.map +1 -0
  50. package/dist/AI/index.js +9 -0
  51. package/dist/AI/index.js.map +1 -0
  52. package/dist/AI/services/ai-instrumentation.service.d.ts +109 -0
  53. package/dist/AI/services/ai-instrumentation.service.d.ts.map +1 -0
  54. package/dist/AI/services/ai-instrumentation.service.js +490 -0
  55. package/dist/AI/services/ai-instrumentation.service.js.map +1 -0
  56. package/dist/Actions/actions-management-dashboard.component.js +40 -41
  57. package/dist/Actions/actions-management-dashboard.component.js.map +1 -1
  58. package/dist/Actions/components/actions-list-view.component.js +117 -134
  59. package/dist/Actions/components/actions-list-view.component.js.map +1 -1
  60. package/dist/Actions/components/actions-overview.component.js +274 -296
  61. package/dist/Actions/components/actions-overview.component.js.map +1 -1
  62. package/dist/Actions/components/categories-list-view.component.js +12 -14
  63. package/dist/Actions/components/categories-list-view.component.js.map +1 -1
  64. package/dist/Actions/components/code-management.component.js +12 -14
  65. package/dist/Actions/components/code-management.component.js.map +1 -1
  66. package/dist/Actions/components/entity-integration.component.js +12 -14
  67. package/dist/Actions/components/entity-integration.component.js.map +1 -1
  68. package/dist/Actions/components/execution-monitoring.component.js +238 -256
  69. package/dist/Actions/components/execution-monitoring.component.js.map +1 -1
  70. package/dist/Actions/components/executions-list-view.component.js +12 -14
  71. package/dist/Actions/components/executions-list-view.component.js.map +1 -1
  72. package/dist/Actions/components/scheduled-actions.component.js +12 -14
  73. package/dist/Actions/components/scheduled-actions.component.js.map +1 -1
  74. package/dist/Actions/components/security-permissions.component.js +12 -14
  75. package/dist/Actions/components/security-permissions.component.js.map +1 -1
  76. package/dist/EntityAdmin/components/entity-details.component.js +105 -107
  77. package/dist/EntityAdmin/components/entity-details.component.js.map +1 -1
  78. package/dist/EntityAdmin/components/entity-filter-panel.component.js +100 -102
  79. package/dist/EntityAdmin/components/entity-filter-panel.component.js.map +1 -1
  80. package/dist/EntityAdmin/components/erd-composite.component.js +84 -100
  81. package/dist/EntityAdmin/components/erd-composite.component.js.map +1 -1
  82. package/dist/EntityAdmin/components/erd-diagram.component.js +50 -50
  83. package/dist/EntityAdmin/components/erd-diagram.component.js.map +1 -1
  84. package/dist/EntityAdmin/entity-admin-dashboard.component.js +45 -49
  85. package/dist/EntityAdmin/entity-admin-dashboard.component.js.map +1 -1
  86. package/dist/generic/base-dashboard.js +28 -40
  87. package/dist/generic/base-dashboard.js.map +1 -1
  88. package/dist/module.d.ts +16 -12
  89. package/dist/module.d.ts.map +1 -1
  90. package/dist/module.js +36 -15
  91. package/dist/module.js.map +1 -1
  92. package/package.json +6 -6
@@ -0,0 +1,490 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { BehaviorSubject, combineLatest, interval as rxInterval } from 'rxjs';
3
+ import { switchMap, startWith, shareReplay } from 'rxjs/operators';
4
+ import { RunView } from '@memberjunction/core';
5
+ import * as i0 from "@angular/core";
6
+ export class AIInstrumentationService {
7
+ _refreshInterval$ = new BehaviorSubject(30000); // 30 seconds default
8
+ _dateRange$ = new BehaviorSubject({
9
+ start: new Date(Date.now() - 24 * 60 * 60 * 1000), // Last 24 hours
10
+ end: new Date()
11
+ });
12
+ constructor() { }
13
+ // Main data streams
14
+ kpis$ = this.createRefreshableStream(() => this.loadKPIs());
15
+ trends$ = this.createRefreshableStream(() => this.loadTrends());
16
+ liveExecutions$ = this.createRefreshableStream(() => this.loadLiveExecutions());
17
+ chartData$ = this.createRefreshableStream(() => this.loadChartData());
18
+ setRefreshInterval(intervalMs) {
19
+ this._refreshInterval$.next(intervalMs);
20
+ }
21
+ setDateRange(start, end) {
22
+ this._dateRange$.next({ start, end });
23
+ }
24
+ createRefreshableStream(loadFn) {
25
+ return combineLatest([
26
+ this._refreshInterval$,
27
+ this._dateRange$
28
+ ]).pipe(switchMap(([interval]) => interval > 0
29
+ ? rxInterval(interval).pipe(startWith(0))
30
+ : [0]), switchMap(() => loadFn()), shareReplay(1));
31
+ }
32
+ async loadKPIs() {
33
+ const { start, end } = this._dateRange$.value;
34
+ const dateFilter = `RunAt >= '${start.toISOString()}' AND RunAt <= '${end.toISOString()}'`;
35
+ // Load prompt executions
36
+ const promptRv = new RunView();
37
+ const promptResults = await promptRv.RunView({
38
+ EntityName: 'MJ: AI Prompt Runs',
39
+ ExtraFilter: dateFilter,
40
+ ResultType: 'entity_object'
41
+ });
42
+ // Load agent executions
43
+ const agentRv = new RunView();
44
+ const agentResults = await agentRv.RunView({
45
+ EntityName: 'MJ: AI Agent Runs',
46
+ ExtraFilter: `StartedAt >= '${start.toISOString()}' AND StartedAt <= '${end.toISOString()}'`,
47
+ ResultType: 'entity_object'
48
+ });
49
+ const promptRuns = promptResults.Results;
50
+ const agentRuns = agentResults.Results;
51
+ // Calculate KPIs
52
+ const totalExecutions = promptRuns.length + agentRuns.length;
53
+ const activeExecutions = this.countActiveExecutions(promptRuns, agentRuns);
54
+ const totalCost = this.sumCosts(promptRuns, agentRuns);
55
+ const totalTokens = this.sumTokens(promptRuns, agentRuns);
56
+ const avgExecutionTime = this.calculateAverageExecutionTime(promptRuns, agentRuns);
57
+ const successRate = this.calculateSuccessRate(promptRuns, agentRuns);
58
+ const errorRate = 1 - successRate;
59
+ const costPerToken = totalTokens > 0 ? totalCost / totalTokens : 0;
60
+ const dailyCostBurn = this.calculateDailyCostBurn(promptRuns, agentRuns);
61
+ const topModel = await this.getTopModel(promptRuns);
62
+ const topAgent = await this.getTopAgent(agentRuns);
63
+ return {
64
+ totalExecutions,
65
+ activeExecutions,
66
+ totalCost,
67
+ costCurrency: 'USD',
68
+ avgExecutionTime,
69
+ successRate,
70
+ totalTokens,
71
+ costPerToken,
72
+ topModel,
73
+ topAgent,
74
+ errorRate,
75
+ dailyCostBurn
76
+ };
77
+ }
78
+ async loadTrends() {
79
+ const { start, end } = this._dateRange$.value;
80
+ const hourlyBuckets = this.createHourlyBuckets(start, end);
81
+ const trends = [];
82
+ for (const bucket of hourlyBuckets) {
83
+ const bucketStart = bucket;
84
+ const bucketEnd = new Date(bucket.getTime() + 60 * 60 * 1000);
85
+ const promptFilter = `RunAt >= '${bucketStart.toISOString()}' AND RunAt < '${bucketEnd.toISOString()}'`;
86
+ const agentFilter = `StartedAt >= '${bucketStart.toISOString()}' AND StartedAt < '${bucketEnd.toISOString()}'`;
87
+ const [promptResults, agentResults] = await Promise.all([
88
+ new RunView().RunView({
89
+ EntityName: 'MJ: AI Prompt Runs',
90
+ ExtraFilter: promptFilter,
91
+ ResultType: 'entity_object'
92
+ }),
93
+ new RunView().RunView({
94
+ EntityName: 'MJ: AI Agent Runs',
95
+ ExtraFilter: agentFilter,
96
+ ResultType: 'entity_object'
97
+ })
98
+ ]);
99
+ const promptRuns = promptResults.Results;
100
+ const agentRuns = agentResults.Results;
101
+ trends.push({
102
+ timestamp: bucket,
103
+ executions: promptRuns.length + agentRuns.length,
104
+ cost: this.sumCosts(promptRuns, agentRuns),
105
+ tokens: this.sumTokens(promptRuns, agentRuns),
106
+ avgTime: this.calculateAverageExecutionTime(promptRuns, agentRuns),
107
+ errors: this.countErrors(promptRuns, agentRuns)
108
+ });
109
+ }
110
+ return trends;
111
+ }
112
+ async loadLiveExecutions() {
113
+ const now = new Date();
114
+ const recentTime = new Date(now.getTime() - 5 * 60 * 1000);
115
+ const [promptResults, agentResults] = await Promise.all([
116
+ new RunView().RunView({
117
+ EntityName: 'MJ: AI Prompt Runs',
118
+ ExtraFilter: `RunAt >= '${recentTime.toISOString()}'`,
119
+ OrderBy: 'RunAt DESC',
120
+ ResultType: 'entity_object'
121
+ }),
122
+ new RunView().RunView({
123
+ EntityName: 'MJ: AI Agent Runs',
124
+ ExtraFilter: `StartedAt >= '${recentTime.toISOString()}'`,
125
+ OrderBy: 'StartedAt DESC',
126
+ ResultType: 'entity_object'
127
+ })
128
+ ]);
129
+ const liveExecutions = [];
130
+ for (const run of promptResults.Results) {
131
+ const isRunning = !run.CompletedAt && run.Success !== false;
132
+ const duration = run.CompletedAt ?
133
+ new Date(run.CompletedAt).getTime() - new Date(run.RunAt).getTime() :
134
+ now.getTime() - new Date(run.RunAt).getTime();
135
+ liveExecutions.push({
136
+ id: run.ID,
137
+ type: 'prompt',
138
+ name: await this.getPromptName(run.PromptID),
139
+ status: isRunning ? 'running' : (run.Success ? 'completed' : 'failed'),
140
+ startTime: new Date(run.RunAt),
141
+ duration: duration,
142
+ cost: run.Cost || 0,
143
+ tokens: run.TokensUsed || 0,
144
+ progress: isRunning ? Math.min(90, (duration / 30000) * 100) : 100
145
+ });
146
+ }
147
+ for (const run of agentResults.Results) {
148
+ const isRunning = run.Status === 'Running';
149
+ const duration = run.CompletedAt ?
150
+ new Date(run.CompletedAt).getTime() - new Date(run.StartedAt).getTime() :
151
+ now.getTime() - new Date(run.StartedAt).getTime();
152
+ liveExecutions.push({
153
+ id: run.ID,
154
+ type: 'agent',
155
+ name: await this.getAgentName(run.AgentID),
156
+ status: run.Status.toLowerCase(),
157
+ startTime: new Date(run.StartedAt),
158
+ duration: duration,
159
+ cost: run.TotalCost || 0,
160
+ tokens: run.TotalTokensUsed || 0,
161
+ progress: isRunning ? Math.min(90, (duration / 60000) * 100) : 100
162
+ });
163
+ }
164
+ return liveExecutions.sort((a, b) => b.startTime.getTime() - a.startTime.getTime());
165
+ }
166
+ async loadChartData() {
167
+ const { start, end } = this._dateRange$.value;
168
+ const dateFilter = `RunAt >= '${start.toISOString()}' AND RunAt <= '${end.toISOString()}'`;
169
+ const promptRv = new RunView();
170
+ const promptResults = await promptRv.RunView({
171
+ EntityName: 'MJ: AI Prompt Runs',
172
+ ExtraFilter: dateFilter,
173
+ ResultType: 'entity_object'
174
+ });
175
+ const promptRuns = promptResults.Results;
176
+ const executionTrends = await this.loadTrends();
177
+ const costByModel = await this.analyzeCostByModel(promptRuns);
178
+ const performanceMatrix = await this.analyzePerformanceMatrix(promptRuns);
179
+ const tokenEfficiency = await this.analyzeTokenEfficiency(promptRuns);
180
+ return {
181
+ executionTrends,
182
+ costByModel,
183
+ performanceMatrix,
184
+ tokenEfficiency
185
+ };
186
+ }
187
+ // Helper methods
188
+ countActiveExecutions(promptRuns, agentRuns) {
189
+ const activePrompts = promptRuns.filter(r => !r.CompletedAt && r.Success !== false).length;
190
+ const activeAgents = agentRuns.filter(r => r.Status === 'Running').length;
191
+ return activePrompts + activeAgents;
192
+ }
193
+ sumCosts(promptRuns, agentRuns) {
194
+ const promptCost = promptRuns.reduce((sum, r) => sum + (r.Cost || 0), 0);
195
+ const agentCost = agentRuns.reduce((sum, r) => sum + (r.TotalCost || 0), 0);
196
+ return promptCost + agentCost;
197
+ }
198
+ sumTokens(promptRuns, agentRuns) {
199
+ const promptTokens = promptRuns.reduce((sum, r) => sum + (r.TokensUsed || 0), 0);
200
+ const agentTokens = agentRuns.reduce((sum, r) => sum + (r.TotalTokensUsed || 0), 0);
201
+ return promptTokens + agentTokens;
202
+ }
203
+ calculateAverageExecutionTime(promptRuns, agentRuns) {
204
+ const promptTimes = promptRuns
205
+ .filter(r => r.ExecutionTimeMS)
206
+ .map(r => r.ExecutionTimeMS);
207
+ const agentTimes = agentRuns
208
+ .filter(r => r.StartedAt && r.CompletedAt)
209
+ .map(r => new Date(r.CompletedAt).getTime() - new Date(r.StartedAt).getTime());
210
+ const allTimes = [...promptTimes, ...agentTimes];
211
+ return allTimes.length > 0 ? allTimes.reduce((sum, time) => sum + time, 0) / allTimes.length : 0;
212
+ }
213
+ calculateSuccessRate(promptRuns, agentRuns) {
214
+ const totalExecutions = promptRuns.length + agentRuns.length;
215
+ if (totalExecutions === 0)
216
+ return 1;
217
+ const successfulPrompts = promptRuns.filter(r => r.Success).length;
218
+ const successfulAgents = agentRuns.filter(r => r.Success).length;
219
+ return (successfulPrompts + successfulAgents) / totalExecutions;
220
+ }
221
+ countErrors(promptRuns, agentRuns) {
222
+ const promptErrors = promptRuns.filter(r => !r.Success).length;
223
+ const agentErrors = agentRuns.filter(r => !r.Success).length;
224
+ return promptErrors + agentErrors;
225
+ }
226
+ calculateDailyCostBurn(promptRuns, agentRuns) {
227
+ const now = new Date();
228
+ const dayStart = new Date(now.getFullYear(), now.getMonth(), now.getDate());
229
+ const todayPrompts = promptRuns.filter(r => new Date(r.RunAt) >= dayStart);
230
+ const todayAgents = agentRuns.filter(r => new Date(r.StartedAt) >= dayStart);
231
+ return this.sumCosts(todayPrompts, todayAgents);
232
+ }
233
+ createHourlyBuckets(start, end) {
234
+ const buckets = [];
235
+ const current = new Date(start);
236
+ current.setMinutes(0, 0, 0);
237
+ while (current < end) {
238
+ buckets.push(new Date(current));
239
+ current.setHours(current.getHours() + 1);
240
+ }
241
+ return buckets;
242
+ }
243
+ async getPromptName(promptId) {
244
+ try {
245
+ const rv = new RunView();
246
+ const result = await rv.RunView({
247
+ EntityName: 'AI Prompts',
248
+ ExtraFilter: `ID = '${promptId}'`,
249
+ ResultType: 'entity_object'
250
+ });
251
+ return result.Results[0]?.Name || 'Unknown Prompt';
252
+ }
253
+ catch {
254
+ return 'Unknown Prompt';
255
+ }
256
+ }
257
+ async getAgentName(agentId) {
258
+ try {
259
+ const rv = new RunView();
260
+ const result = await rv.RunView({
261
+ EntityName: 'AI Agents',
262
+ ExtraFilter: `ID = '${agentId}'`,
263
+ ResultType: 'entity_object'
264
+ });
265
+ return result.Results[0]?.Name || 'Unknown Agent';
266
+ }
267
+ catch {
268
+ return 'Unknown Agent';
269
+ }
270
+ }
271
+ async getTopModel(promptRuns) {
272
+ const modelCounts = new Map();
273
+ for (const run of promptRuns) {
274
+ if (run.ModelID) {
275
+ const count = modelCounts.get(run.ModelID) || 0;
276
+ modelCounts.set(run.ModelID, count + 1);
277
+ }
278
+ }
279
+ if (modelCounts.size === 0)
280
+ return 'N/A';
281
+ const topModelId = Array.from(modelCounts.entries())
282
+ .sort(([, a], [, b]) => b - a)[0][0];
283
+ try {
284
+ const rv = new RunView();
285
+ const result = await rv.RunView({
286
+ EntityName: 'AI Models',
287
+ ExtraFilter: `ID = '${topModelId}'`,
288
+ ResultType: 'entity_object'
289
+ });
290
+ return result.Results[0]?.Name || 'Unknown Model';
291
+ }
292
+ catch {
293
+ return 'Unknown Model';
294
+ }
295
+ }
296
+ async getTopAgent(agentRuns) {
297
+ const agentCounts = new Map();
298
+ for (const run of agentRuns) {
299
+ const count = agentCounts.get(run.AgentID) || 0;
300
+ agentCounts.set(run.AgentID, count + 1);
301
+ }
302
+ if (agentCounts.size === 0)
303
+ return 'N/A';
304
+ const topAgentId = Array.from(agentCounts.entries())
305
+ .sort(([, a], [, b]) => b - a)[0][0];
306
+ try {
307
+ const rv = new RunView();
308
+ const result = await rv.RunView({
309
+ EntityName: 'AI Agents',
310
+ ExtraFilter: `ID = '${topAgentId}'`,
311
+ ResultType: 'entity_object'
312
+ });
313
+ return result.Results[0]?.Name || 'Unknown Agent';
314
+ }
315
+ catch {
316
+ return 'Unknown Agent';
317
+ }
318
+ }
319
+ async analyzeCostByModel(promptRuns) {
320
+ const modelStats = new Map();
321
+ for (const run of promptRuns) {
322
+ if (run.ModelID) {
323
+ const existing = modelStats.get(run.ModelID) || { cost: 0, tokens: 0 };
324
+ existing.cost += run.Cost || 0;
325
+ existing.tokens += run.TokensUsed || 0;
326
+ modelStats.set(run.ModelID, existing);
327
+ }
328
+ }
329
+ const results = [];
330
+ for (const [modelId, stats] of modelStats.entries()) {
331
+ const modelName = await this.getModelName(modelId);
332
+ results.push({
333
+ model: modelName,
334
+ cost: stats.cost,
335
+ tokens: stats.tokens
336
+ });
337
+ }
338
+ return results.sort((a, b) => b.cost - a.cost);
339
+ }
340
+ async analyzePerformanceMatrix(promptRuns) {
341
+ const combinations = new Map();
342
+ for (const run of promptRuns) {
343
+ if (run.AgentID && run.ModelID && run.ExecutionTimeMS) {
344
+ const key = `${run.AgentID}:${run.ModelID}`;
345
+ const existing = combinations.get(key) || { times: [], successes: 0, total: 0 };
346
+ existing.times.push(run.ExecutionTimeMS);
347
+ existing.total += 1;
348
+ if (run.Success)
349
+ existing.successes += 1;
350
+ combinations.set(key, existing);
351
+ }
352
+ }
353
+ const results = [];
354
+ for (const [key, data] of combinations.entries()) {
355
+ const [agentId, modelId] = key.split(':');
356
+ const agentName = await this.getAgentName(agentId);
357
+ const modelName = await this.getModelName(modelId);
358
+ results.push({
359
+ agent: agentName,
360
+ model: modelName,
361
+ avgTime: data.times.reduce((sum, time) => sum + time, 0) / data.times.length,
362
+ successRate: data.successes / data.total
363
+ });
364
+ }
365
+ return results;
366
+ }
367
+ async analyzeTokenEfficiency(promptRuns) {
368
+ const modelEfficiency = new Map();
369
+ for (const run of promptRuns) {
370
+ if (run.ModelID && run.TokensPrompt && run.TokensCompletion) {
371
+ const existing = modelEfficiency.get(run.ModelID) || { input: 0, output: 0, cost: 0 };
372
+ existing.input += run.TokensPrompt;
373
+ existing.output += run.TokensCompletion;
374
+ existing.cost += run.Cost || 0;
375
+ modelEfficiency.set(run.ModelID, existing);
376
+ }
377
+ }
378
+ const results = [];
379
+ for (const [modelId, data] of modelEfficiency.entries()) {
380
+ const modelName = await this.getModelName(modelId);
381
+ results.push({
382
+ inputTokens: data.input,
383
+ outputTokens: data.output,
384
+ cost: data.cost,
385
+ model: modelName
386
+ });
387
+ }
388
+ return results;
389
+ }
390
+ async getModelName(modelId) {
391
+ try {
392
+ const rv = new RunView();
393
+ const result = await rv.RunView({
394
+ EntityName: 'AI Models',
395
+ ExtraFilter: `ID = '${modelId}'`,
396
+ ResultType: 'entity_object'
397
+ });
398
+ return result.Results[0]?.Name || 'Unknown Model';
399
+ }
400
+ catch {
401
+ return 'Unknown Model';
402
+ }
403
+ }
404
+ async getExecutionDetails(executionId, type) {
405
+ try {
406
+ if (type === 'prompt') {
407
+ return await this.getPromptExecutionDetails(executionId);
408
+ }
409
+ else {
410
+ return await this.getAgentExecutionDetails(executionId);
411
+ }
412
+ }
413
+ catch (error) {
414
+ console.error('Error loading execution details:', error);
415
+ return null;
416
+ }
417
+ }
418
+ async getPromptExecutionDetails(promptRunId) {
419
+ const rv = new RunView();
420
+ const result = await rv.RunView({
421
+ EntityName: 'MJ: AI Prompt Runs',
422
+ ExtraFilter: `ID = '${promptRunId}'`,
423
+ ResultType: 'entity_object'
424
+ });
425
+ const run = result.Results[0];
426
+ if (!run)
427
+ throw new Error('Prompt run not found');
428
+ const childrenResult = await rv.RunView({
429
+ EntityName: 'MJ: AI Prompt Runs',
430
+ ExtraFilter: `ParentID = '${promptRunId}'`,
431
+ ResultType: 'entity_object'
432
+ });
433
+ const children = await Promise.all(childrenResult.Results.map(child => this.getPromptExecutionDetails(child.ID)));
434
+ return {
435
+ id: run.ID,
436
+ type: 'prompt',
437
+ name: await this.getPromptName(run.PromptID),
438
+ status: run.Success ? 'completed' : 'failed',
439
+ startTime: new Date(run.RunAt),
440
+ endTime: run.CompletedAt ? new Date(run.CompletedAt) : undefined,
441
+ cost: run.Cost || 0,
442
+ tokens: run.TokensUsed || 0,
443
+ success: run.Success || false,
444
+ errorMessage: run.ErrorMessage || undefined,
445
+ parentId: run.ParentID || undefined,
446
+ children,
447
+ model: run.ModelID ? await this.getModelName(run.ModelID) : undefined
448
+ };
449
+ }
450
+ async getAgentExecutionDetails(agentRunId) {
451
+ const rv = new RunView();
452
+ const result = await rv.RunView({
453
+ EntityName: 'MJ: AI Agent Runs',
454
+ ExtraFilter: `ID = '${agentRunId}'`,
455
+ ResultType: 'entity_object'
456
+ });
457
+ const run = result.Results[0];
458
+ if (!run)
459
+ throw new Error('Agent run not found');
460
+ const childrenResult = await rv.RunView({
461
+ EntityName: 'MJ: AI Agent Runs',
462
+ ExtraFilter: `ParentRunID = '${agentRunId}'`,
463
+ ResultType: 'entity_object'
464
+ });
465
+ const children = await Promise.all(childrenResult.Results.map(child => this.getAgentExecutionDetails(child.ID)));
466
+ return {
467
+ id: run.ID,
468
+ type: 'agent',
469
+ name: await this.getAgentName(run.AgentID),
470
+ status: run.Status.toLowerCase(),
471
+ startTime: new Date(run.StartedAt),
472
+ endTime: run.CompletedAt ? new Date(run.CompletedAt) : undefined,
473
+ cost: run.TotalCost || 0,
474
+ tokens: run.TotalTokensUsed || 0,
475
+ success: run.Success || false,
476
+ errorMessage: run.ErrorMessage || undefined,
477
+ parentId: run.ParentRunID || undefined,
478
+ children
479
+ };
480
+ }
481
+ static ɵfac = function AIInstrumentationService_Factory(t) { return new (t || AIInstrumentationService)(); };
482
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AIInstrumentationService, factory: AIInstrumentationService.ɵfac, providedIn: 'root' });
483
+ }
484
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AIInstrumentationService, [{
485
+ type: Injectable,
486
+ args: [{
487
+ providedIn: 'root'
488
+ }]
489
+ }], () => [], null); })();
490
+ //# sourceMappingURL=ai-instrumentation.service.js.map
@@ -0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;IACJ,CAAC;kFAhjBU,wBAAwB;gEAAxB,wBAAwB,WAAxB,wBAAwB,mBAFvB,MAAM;;iFAEP,wBAAwB;cAHpC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB"}
@@ -124,22 +124,22 @@ function ActionsManagementDashboardComponent_Conditional_12_Template(rf, ctx) {
124
124
  i0.ɵɵproperty("themeColor", "primary");
125
125
  } }
126
126
  let ActionsManagementDashboardComponent = class ActionsManagementDashboardComponent extends BaseDashboard {
127
+ isLoading = false;
128
+ activeTab = 'overview'; // Default tab
129
+ subView = null; // Current sub-view
130
+ // Navigation items for bottom navigation
131
+ navigationItems = ['overview', 'execution', 'scheduled', 'code', 'entities', 'security'];
132
+ navigationConfig = [
133
+ { text: 'Overview', icon: 'k-icon k-i-dashboard' },
134
+ { text: 'Execution', icon: 'k-icon k-i-track-changes' },
135
+ { text: 'Scheduled', icon: 'k-icon k-i-clock' },
136
+ { text: 'Code', icon: 'k-icon k-i-code' },
137
+ { text: 'Entities', icon: 'k-icon k-i-sitemap' },
138
+ { text: 'Security', icon: 'k-icon k-i-lock' }
139
+ ];
140
+ stateChangeSubject = new Subject();
127
141
  constructor() {
128
142
  super();
129
- this.isLoading = false;
130
- this.activeTab = 'overview'; // Default tab
131
- this.subView = null; // Current sub-view
132
- // Navigation items for bottom navigation
133
- this.navigationItems = ['overview', 'execution', 'scheduled', 'code', 'entities', 'security'];
134
- this.navigationConfig = [
135
- { text: 'Overview', icon: 'k-icon k-i-dashboard' },
136
- { text: 'Execution', icon: 'k-icon k-i-track-changes' },
137
- { text: 'Scheduled', icon: 'k-icon k-i-clock' },
138
- { text: 'Code', icon: 'k-icon k-i-code' },
139
- { text: 'Entities', icon: 'k-icon k-i-sitemap' },
140
- { text: 'Security', icon: 'k-icon k-i-lock' }
141
- ];
142
- this.stateChangeSubject = new Subject();
143
143
  this.setupStateManagement();
144
144
  }
145
145
  ngAfterViewInit() {
@@ -153,9 +153,8 @@ let ActionsManagementDashboardComponent = class ActionsManagementDashboardCompon
153
153
  this.emitStateChange();
154
154
  }
155
155
  onNavigationChange(event) {
156
- var _a;
157
156
  const target = event.target;
158
- const index = Array.from(((_a = target.parentElement) === null || _a === void 0 ? void 0 : _a.children) || []).indexOf(target);
157
+ const index = Array.from(target.parentElement?.children || []).indexOf(target);
159
158
  if (index >= 0 && index < this.navigationItems.length) {
160
159
  this.activeTab = this.navigationItems[index];
161
160
  this.emitStateChange();
@@ -241,32 +240,32 @@ let ActionsManagementDashboardComponent = class ActionsManagementDashboardCompon
241
240
  onShowCategoriesListView() {
242
241
  this.showSubView('categories-list');
243
242
  }
243
+ static ɵfac = function ActionsManagementDashboardComponent_Factory(t) { return new (t || ActionsManagementDashboardComponent)(); };
244
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ActionsManagementDashboardComponent, selectors: [["mj-actions-management-dashboard"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 13, vars: 3, consts: [["mjFillContainer", "", 1, "actions-management-dashboard"], [1, "dashboard-header"], [1, "dashboard-title"], [1, "fa-solid", "fa-cogs"], [1, "dashboard-subtitle"], [1, "dashboard-content"], [1, "actions-navigation", 3, "itemClick", "items"], [1, "tab-content"], [1, "sub-view-container"], [1, "loading-overlay"], [3, "openEntityRecord", "showActionsListView", "showExecutionsListView", "showCategoriesListView"], [3, "openEntityRecord", "showExecutionsListView"], [3, "openEntityRecord"], [1, "sub-view-header"], ["kendoButton", "", 1, "back-button", 3, "click", "icon", "fillMode"], ["type", "converging-spinner", 3, "themeColor"]], template: function ActionsManagementDashboardComponent_Template(rf, ctx) { if (rf & 1) {
245
+ i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h2", 2);
246
+ i0.ɵɵelement(3, "i", 3);
247
+ i0.ɵɵtext(4, " Actions Management ");
248
+ i0.ɵɵelementEnd();
249
+ i0.ɵɵelementStart(5, "div", 4);
250
+ i0.ɵɵtext(6, " Manage actions, execution monitoring, and integrations ");
251
+ i0.ɵɵelementEnd()();
252
+ i0.ɵɵelementStart(7, "div", 5)(8, "kendo-bottomnavigation", 6);
253
+ i0.ɵɵlistener("itemClick", function ActionsManagementDashboardComponent_Template_kendo_bottomnavigation_itemClick_8_listener($event) { return ctx.onNavigationChange($event); });
254
+ i0.ɵɵelementEnd();
255
+ i0.ɵɵelementStart(9, "div", 7);
256
+ i0.ɵɵtemplate(10, ActionsManagementDashboardComponent_Conditional_10_Template, 6, 6)(11, ActionsManagementDashboardComponent_Conditional_11_Template, 7, 6, "div", 8);
257
+ i0.ɵɵelementEnd()();
258
+ i0.ɵɵtemplate(12, ActionsManagementDashboardComponent_Conditional_12_Template, 2, 1, "div", 9);
259
+ i0.ɵɵelementEnd();
260
+ } if (rf & 2) {
261
+ i0.ɵɵadvance(8);
262
+ i0.ɵɵproperty("items", ctx.navigationConfig);
263
+ i0.ɵɵadvance(2);
264
+ i0.ɵɵconditional(ctx.subView === null ? 10 : 11);
265
+ i0.ɵɵadvance(2);
266
+ i0.ɵɵconditional(ctx.isLoading ? 12 : -1);
267
+ } }, dependencies: [i1.LoaderComponent, i2.FillContainer, i3.BottomNavigationComponent, i4.ButtonComponent, i5.ActionsOverviewComponent, i6.ExecutionMonitoringComponent, i7.ScheduledActionsComponent, i8.CodeManagementComponent, i9.EntityIntegrationComponent, i10.SecurityPermissionsComponent, i11.ActionsListViewComponent, i12.ExecutionsListViewComponent, i13.CategoriesListViewComponent], styles: [".actions-management-dashboard[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n padding: 1rem;\n background-color: var(--kendo-color-surface);\n\n .dashboard-header {\n margin-bottom: 1.5rem;\n \n .dashboard-title {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n margin: 0 0 0.5rem 0;\n font-size: 1.75rem;\n font-weight: 600;\n color: var(--kendo-color-on-app-surface);\n \n i {\n color: var(--kendo-color-primary);\n }\n }\n \n .dashboard-subtitle {\n color: var(--kendo-color-subtle);\n font-size: 1rem;\n margin-left: 2.25rem;\n }\n }\n\n .dashboard-content {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n\n .actions-navigation {\n margin-bottom: 1rem;\n border-radius: 0.5rem;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n }\n\n .tab-content {\n flex: 1;\n min-height: 0;\n background: var(--kendo-color-app-surface);\n border-radius: 0.5rem;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n\n .sub-view-container {\n height: 100%;\n display: flex;\n flex-direction: column;\n\n .sub-view-header {\n padding: 1rem 1.5rem;\n border-bottom: 1px solid var(--kendo-color-border);\n background: var(--kendo-color-surface);\n\n .back-button {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n color: var(--kendo-color-primary);\n font-weight: 600;\n\n &:hover {\n color: var(--kendo-color-primary-darker);\n }\n }\n }\n\n mj-actions-list-view,\n mj-executions-list-view,\n mj-categories-list-view {\n flex: 1;\n min-height: 0;\n }\n }\n }\n }\n\n .loading-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(255, 255, 255, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n }\n}\n\n// Navigation styling\n[_nghost-%COMP%] {\n .k-bottom-nav {\n .k-bottom-nav-item {\n transition: all 0.2s ease;\n \n &:hover {\n background-color: var(--kendo-color-base-hover);\n }\n \n &.k-state-selected {\n background-color: var(--kendo-color-primary);\n color: var(--kendo-color-on-primary);\n }\n }\n }\n}\n\n//[_ngcontent-%COMP%] Responsive[_ngcontent-%COMP%] design\n@media[_ngcontent-%COMP%] (max-width[_ngcontent-%COMP%]: 768px)[_ngcontent-%COMP%] {\n .actions-management-dashboard {\n padding: 0.5rem;\n \n .dashboard-header {\n margin-bottom: 1rem;\n \n .dashboard-title {\n font-size: 1.5rem;\n }\n \n .dashboard-subtitle {\n font-size: 0.9rem;\n }\n }\n }\n}"] });
244
268
  };
245
- ActionsManagementDashboardComponent.ɵfac = function ActionsManagementDashboardComponent_Factory(t) { return new (t || ActionsManagementDashboardComponent)(); };
246
- ActionsManagementDashboardComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ActionsManagementDashboardComponent, selectors: [["mj-actions-management-dashboard"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 13, vars: 3, consts: [["mjFillContainer", "", 1, "actions-management-dashboard"], [1, "dashboard-header"], [1, "dashboard-title"], [1, "fa-solid", "fa-cogs"], [1, "dashboard-subtitle"], [1, "dashboard-content"], [1, "actions-navigation", 3, "itemClick", "items"], [1, "tab-content"], [1, "sub-view-container"], [1, "loading-overlay"], [3, "openEntityRecord", "showActionsListView", "showExecutionsListView", "showCategoriesListView"], [3, "openEntityRecord", "showExecutionsListView"], [3, "openEntityRecord"], [1, "sub-view-header"], ["kendoButton", "", 1, "back-button", 3, "click", "icon", "fillMode"], ["type", "converging-spinner", 3, "themeColor"]], template: function ActionsManagementDashboardComponent_Template(rf, ctx) { if (rf & 1) {
247
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h2", 2);
248
- i0.ɵɵelement(3, "i", 3);
249
- i0.ɵɵtext(4, " Actions Management ");
250
- i0.ɵɵelementEnd();
251
- i0.ɵɵelementStart(5, "div", 4);
252
- i0.ɵɵtext(6, " Manage actions, execution monitoring, and integrations ");
253
- i0.ɵɵelementEnd()();
254
- i0.ɵɵelementStart(7, "div", 5)(8, "kendo-bottomnavigation", 6);
255
- i0.ɵɵlistener("itemClick", function ActionsManagementDashboardComponent_Template_kendo_bottomnavigation_itemClick_8_listener($event) { return ctx.onNavigationChange($event); });
256
- i0.ɵɵelementEnd();
257
- i0.ɵɵelementStart(9, "div", 7);
258
- i0.ɵɵtemplate(10, ActionsManagementDashboardComponent_Conditional_10_Template, 6, 6)(11, ActionsManagementDashboardComponent_Conditional_11_Template, 7, 6, "div", 8);
259
- i0.ɵɵelementEnd()();
260
- i0.ɵɵtemplate(12, ActionsManagementDashboardComponent_Conditional_12_Template, 2, 1, "div", 9);
261
- i0.ɵɵelementEnd();
262
- } if (rf & 2) {
263
- i0.ɵɵadvance(8);
264
- i0.ɵɵproperty("items", ctx.navigationConfig);
265
- i0.ɵɵadvance(2);
266
- i0.ɵɵconditional(ctx.subView === null ? 10 : 11);
267
- i0.ɵɵadvance(2);
268
- i0.ɵɵconditional(ctx.isLoading ? 12 : -1);
269
- } }, dependencies: [i1.LoaderComponent, i2.FillContainer, i3.BottomNavigationComponent, i4.ButtonComponent, i5.ActionsOverviewComponent, i6.ExecutionMonitoringComponent, i7.ScheduledActionsComponent, i8.CodeManagementComponent, i9.EntityIntegrationComponent, i10.SecurityPermissionsComponent, i11.ActionsListViewComponent, i12.ExecutionsListViewComponent, i13.CategoriesListViewComponent], styles: [".actions-management-dashboard[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n padding: 1rem;\n background-color: var(--kendo-color-surface);\n\n .dashboard-header {\n margin-bottom: 1.5rem;\n \n .dashboard-title {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n margin: 0 0 0.5rem 0;\n font-size: 1.75rem;\n font-weight: 600;\n color: var(--kendo-color-on-app-surface);\n \n i {\n color: var(--kendo-color-primary);\n }\n }\n \n .dashboard-subtitle {\n color: var(--kendo-color-subtle);\n font-size: 1rem;\n margin-left: 2.25rem;\n }\n }\n\n .dashboard-content {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n\n .actions-navigation {\n margin-bottom: 1rem;\n border-radius: 0.5rem;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n }\n\n .tab-content {\n flex: 1;\n min-height: 0;\n background: var(--kendo-color-app-surface);\n border-radius: 0.5rem;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n\n .sub-view-container {\n height: 100%;\n display: flex;\n flex-direction: column;\n\n .sub-view-header {\n padding: 1rem 1.5rem;\n border-bottom: 1px solid var(--kendo-color-border);\n background: var(--kendo-color-surface);\n\n .back-button {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n color: var(--kendo-color-primary);\n font-weight: 600;\n\n &:hover {\n color: var(--kendo-color-primary-darker);\n }\n }\n }\n\n mj-actions-list-view,\n mj-executions-list-view,\n mj-categories-list-view {\n flex: 1;\n min-height: 0;\n }\n }\n }\n }\n\n .loading-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(255, 255, 255, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n }\n}\n\n// Navigation styling\n[_nghost-%COMP%] {\n .k-bottom-nav {\n .k-bottom-nav-item {\n transition: all 0.2s ease;\n \n &:hover {\n background-color: var(--kendo-color-base-hover);\n }\n \n &.k-state-selected {\n background-color: var(--kendo-color-primary);\n color: var(--kendo-color-on-primary);\n }\n }\n }\n}\n\n//[_ngcontent-%COMP%] Responsive[_ngcontent-%COMP%] design\n@media[_ngcontent-%COMP%] (max-width[_ngcontent-%COMP%]: 768px)[_ngcontent-%COMP%] {\n .actions-management-dashboard {\n padding: 0.5rem;\n \n .dashboard-header {\n margin-bottom: 1rem;\n \n .dashboard-title {\n font-size: 1.5rem;\n }\n \n .dashboard-subtitle {\n font-size: 0.9rem;\n }\n }\n }\n}"] });
270
269
  ActionsManagementDashboardComponent = __decorate([
271
270
  RegisterClass(BaseDashboard, 'ActionsManagement')
272
271
  ], ActionsManagementDashboardComponent);