@memberjunction/ng-ai-test-harness 6.1.4 → 6.2.0-edge.1
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/dist/lib/agent-execution-monitor.component.d.ts +78 -11
- package/dist/lib/agent-execution-monitor.component.d.ts.map +1 -1
- package/dist/lib/agent-execution-monitor.component.js +221 -87
- package/dist/lib/agent-execution-monitor.component.js.map +1 -1
- package/dist/lib/agent-execution-node.component.d.ts +103 -7
- package/dist/lib/agent-execution-node.component.d.ts.map +1 -1
- package/dist/lib/agent-execution-node.component.js +262 -76
- package/dist/lib/agent-execution-node.component.js.map +1 -1
- package/dist/lib/ai-test-harness-dialog.component.d.ts +34 -6
- package/dist/lib/ai-test-harness-dialog.component.d.ts.map +1 -1
- package/dist/lib/ai-test-harness-dialog.component.js +132 -80
- package/dist/lib/ai-test-harness-dialog.component.js.map +1 -1
- package/dist/lib/ai-test-harness-dialog.service.d.ts +4 -0
- package/dist/lib/ai-test-harness-dialog.service.d.ts.map +1 -1
- package/dist/lib/ai-test-harness-dialog.service.js +10 -2
- package/dist/lib/ai-test-harness-dialog.service.js.map +1 -1
- package/dist/lib/ai-test-harness-window.component.d.ts +35 -5
- package/dist/lib/ai-test-harness-window.component.d.ts.map +1 -1
- package/dist/lib/ai-test-harness-window.component.js +88 -32
- package/dist/lib/ai-test-harness-window.component.js.map +1 -1
- package/dist/lib/ai-test-harness.component.d.ts +353 -37
- package/dist/lib/ai-test-harness.component.d.ts.map +1 -1
- package/dist/lib/ai-test-harness.component.js +1008 -452
- package/dist/lib/ai-test-harness.component.js.map +1 -1
- package/dist/lib/json-viewer-window.component.d.ts +8 -2
- package/dist/lib/json-viewer-window.component.d.ts.map +1 -1
- package/dist/lib/json-viewer-window.component.js +20 -6
- package/dist/lib/json-viewer-window.component.js.map +1 -1
- package/dist/lib/test-harness-window-manager.service.d.ts +24 -0
- package/dist/lib/test-harness-window-manager.service.d.ts.map +1 -1
- package/dist/lib/test-harness-window-manager.service.js +15 -3
- package/dist/lib/test-harness-window-manager.service.js.map +1 -1
- package/dist/lib/window-dock.service.d.ts +24 -6
- package/dist/lib/window-dock.service.d.ts.map +1 -1
- package/dist/lib/window-dock.service.js +59 -23
- package/dist/lib/window-dock.service.js.map +1 -1
- package/package.json +16 -16
|
@@ -97,23 +97,111 @@ function AgentExecutionMonitorComponent_Conditional_38_Template(rf, ctx) { if (r
|
|
|
97
97
|
* - Input/output preview
|
|
98
98
|
*/
|
|
99
99
|
export class AgentExecutionMonitorComponent {
|
|
100
|
+
/** @deprecated Use {@link Mode}. */
|
|
101
|
+
set mode(value) {
|
|
102
|
+
this.Mode = value;
|
|
103
|
+
}
|
|
104
|
+
/** @deprecated Use {@link Mode}. */
|
|
105
|
+
get mode() {
|
|
106
|
+
return this.Mode;
|
|
107
|
+
}
|
|
108
|
+
/** @deprecated Use {@link AgentRun}. */
|
|
109
|
+
set agentRun(value) {
|
|
110
|
+
this.AgentRun = value;
|
|
111
|
+
}
|
|
112
|
+
/** @deprecated Use {@link AgentRun}. */
|
|
113
|
+
get agentRun() {
|
|
114
|
+
return this.AgentRun;
|
|
115
|
+
} // For historical mode
|
|
116
|
+
/** @deprecated Use {@link LiveSteps}. */
|
|
117
|
+
set liveSteps(value) {
|
|
118
|
+
this.LiveSteps = value;
|
|
119
|
+
}
|
|
120
|
+
/** @deprecated Use {@link LiveSteps}. */
|
|
121
|
+
get liveSteps() {
|
|
122
|
+
return this.LiveSteps;
|
|
123
|
+
} // For live mode streaming
|
|
124
|
+
/** @deprecated Use {@link AutoExpand}. */
|
|
125
|
+
set autoExpand(value) {
|
|
126
|
+
this.AutoExpand = value;
|
|
127
|
+
}
|
|
128
|
+
/** @deprecated Use {@link AutoExpand}. */
|
|
129
|
+
get autoExpand() {
|
|
130
|
+
return this.AutoExpand;
|
|
131
|
+
} // Auto-expand nodes in live mode
|
|
132
|
+
/** @deprecated Use {@link RunId}. */
|
|
133
|
+
set runId(value) {
|
|
134
|
+
this.RunId = value;
|
|
135
|
+
}
|
|
136
|
+
/** @deprecated Use {@link RunId}. */
|
|
137
|
+
get runId() {
|
|
138
|
+
return this.RunId;
|
|
139
|
+
} // ID of the run (agent or prompt)
|
|
140
|
+
/** @deprecated Use {@link RunType}. */
|
|
141
|
+
set runType(value) {
|
|
142
|
+
this.RunType = value;
|
|
143
|
+
}
|
|
144
|
+
/** @deprecated Use {@link RunType}. */
|
|
145
|
+
get runType() {
|
|
146
|
+
return this.RunType;
|
|
147
|
+
} // Type of run
|
|
148
|
+
/** @deprecated Use {@link ExecutionTreeContainer}. */
|
|
149
|
+
get executionTreeContainer() {
|
|
150
|
+
return this.ExecutionTreeContainer;
|
|
151
|
+
}
|
|
152
|
+
/** @deprecated Use {@link ExecutionTreeContainer}. */
|
|
153
|
+
set executionTreeContainer(value) {
|
|
154
|
+
this.ExecutionTreeContainer = value;
|
|
155
|
+
}
|
|
156
|
+
/** @deprecated Use {@link ExecutionNodesContainer}. */
|
|
157
|
+
get executionNodesContainer() {
|
|
158
|
+
return this.ExecutionNodesContainer;
|
|
159
|
+
}
|
|
160
|
+
/** @deprecated Use {@link ExecutionNodesContainer}. */
|
|
161
|
+
set executionNodesContainer(value) {
|
|
162
|
+
this.ExecutionNodesContainer = value;
|
|
163
|
+
}
|
|
164
|
+
/** @deprecated Use {@link CurrentStep}. */
|
|
165
|
+
get currentStep() {
|
|
166
|
+
return this.CurrentStep;
|
|
167
|
+
}
|
|
168
|
+
/** @deprecated Use {@link CurrentStep}. */
|
|
169
|
+
set currentStep(value) {
|
|
170
|
+
this.CurrentStep = value;
|
|
171
|
+
}
|
|
172
|
+
/** @deprecated Use {@link Stats}. */
|
|
173
|
+
get stats() {
|
|
174
|
+
return this.Stats;
|
|
175
|
+
}
|
|
176
|
+
/** @deprecated Use {@link Stats}. */
|
|
177
|
+
set stats(value) {
|
|
178
|
+
this.Stats = value;
|
|
179
|
+
}
|
|
100
180
|
constructor(cdr) {
|
|
101
181
|
this.cdr = cdr;
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
104
|
-
this.
|
|
105
|
-
this.
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
108
|
-
this.
|
|
182
|
+
this.Mode = 'historical';
|
|
183
|
+
this.AgentRun = null;
|
|
184
|
+
this.LiveSteps = [];
|
|
185
|
+
this.AutoExpand = true;
|
|
186
|
+
this.RunId = null;
|
|
187
|
+
this.RunType = 'agent';
|
|
188
|
+
this.ViewRunClick = new EventEmitter();
|
|
189
|
+
/**
|
|
190
|
+
* @deprecated Use {@link ViewRunClick}.
|
|
191
|
+
*
|
|
192
|
+
* The same emitter under the old binding name, so a template still binding
|
|
193
|
+
* (viewRunClick) keeps working. Must stay AFTER ViewRunClick: class fields
|
|
194
|
+
* initialise in order, and the other way round this captures undefined.
|
|
195
|
+
*/
|
|
196
|
+
this.viewRunClick = this.ViewRunClick;
|
|
109
197
|
// Store the currently rendered steps for UI state management
|
|
110
|
-
this.
|
|
198
|
+
this.CurrentStep = null;
|
|
111
199
|
// Track component references for dynamic components
|
|
112
200
|
this.nodeComponentMap = new Map();
|
|
113
201
|
// UI state management - track expanded states separately from entities
|
|
114
202
|
this.expandedStates = new Map();
|
|
115
203
|
this.detailsExpandedStates = new Map();
|
|
116
|
-
this.
|
|
204
|
+
this.Stats = {
|
|
117
205
|
totalSteps: 0,
|
|
118
206
|
completedSteps: 0,
|
|
119
207
|
failedSteps: 0,
|
|
@@ -144,11 +232,11 @@ export class AgentExecutionMonitorComponent {
|
|
|
144
232
|
agentRunChanged: !!changes['agentRun'],
|
|
145
233
|
liveStepsChanged: !!changes['liveSteps'],
|
|
146
234
|
modeChanged: !!changes['mode'],
|
|
147
|
-
hasAgentRun: !!this.
|
|
148
|
-
liveStepsCount: this.
|
|
235
|
+
hasAgentRun: !!this.AgentRun,
|
|
236
|
+
liveStepsCount: this.LiveSteps?.length || 0
|
|
149
237
|
});
|
|
150
238
|
// Handle agent run changes (historical mode)
|
|
151
|
-
if (changes['agentRun'] && this.
|
|
239
|
+
if (changes['agentRun'] && this.Mode === 'historical') {
|
|
152
240
|
const oldRun = changes['agentRun'].previousValue;
|
|
153
241
|
const newRun = changes['agentRun'].currentValue;
|
|
154
242
|
console.log('📊 Agent run changed:', {
|
|
@@ -169,7 +257,7 @@ export class AgentExecutionMonitorComponent {
|
|
|
169
257
|
this.expandedStates.clear();
|
|
170
258
|
this.detailsExpandedStates.clear();
|
|
171
259
|
this.clearNodeComponents();
|
|
172
|
-
this.
|
|
260
|
+
this.CurrentStep = null;
|
|
173
261
|
}
|
|
174
262
|
// Always process the agent run data (will handle updates to existing run)
|
|
175
263
|
if (newRun) {
|
|
@@ -177,7 +265,7 @@ export class AgentExecutionMonitorComponent {
|
|
|
177
265
|
}
|
|
178
266
|
}
|
|
179
267
|
// Handle live steps changes (live mode)
|
|
180
|
-
if (changes['liveSteps'] && this.
|
|
268
|
+
if (changes['liveSteps'] && this.Mode === 'live') {
|
|
181
269
|
const oldSteps = changes['liveSteps'].previousValue;
|
|
182
270
|
const newSteps = changes['liveSteps'].currentValue;
|
|
183
271
|
console.log('📊 Live steps changed:', {
|
|
@@ -198,14 +286,14 @@ export class AgentExecutionMonitorComponent {
|
|
|
198
286
|
this.expandedStates.clear();
|
|
199
287
|
this.detailsExpandedStates.clear();
|
|
200
288
|
this.clearNodeComponents();
|
|
201
|
-
this.
|
|
289
|
+
this.CurrentStep = null;
|
|
202
290
|
// Stop live updates when switching away from live mode
|
|
203
291
|
if (previousMode === 'live' && this.updateSubscription) {
|
|
204
292
|
this.updateSubscription.unsubscribe();
|
|
205
293
|
this.updateSubscription = undefined;
|
|
206
294
|
}
|
|
207
295
|
// Process data for the new mode
|
|
208
|
-
if (currentMode === 'historical' && this.
|
|
296
|
+
if (currentMode === 'historical' && this.AgentRun) {
|
|
209
297
|
this.processAgentRun();
|
|
210
298
|
}
|
|
211
299
|
else if (currentMode === 'live') {
|
|
@@ -216,20 +304,20 @@ export class AgentExecutionMonitorComponent {
|
|
|
216
304
|
ngAfterViewInit() {
|
|
217
305
|
this.viewInitialized = true;
|
|
218
306
|
console.log('🎯 View initialized, checking for pending data:', {
|
|
219
|
-
hasAgentRun: !!this.
|
|
220
|
-
hasLiveSteps: this.
|
|
221
|
-
hasContainer: !!this.
|
|
307
|
+
hasAgentRun: !!this.AgentRun,
|
|
308
|
+
hasLiveSteps: this.LiveSteps?.length > 0,
|
|
309
|
+
hasContainer: !!this.ExecutionNodesContainer
|
|
222
310
|
});
|
|
223
311
|
// Initial setup for scroll behavior
|
|
224
|
-
if (this.
|
|
312
|
+
if (this.Mode === 'live') {
|
|
225
313
|
this.checkIfUserAtBottom();
|
|
226
314
|
}
|
|
227
315
|
// If we have data waiting to be rendered, render it now
|
|
228
|
-
if (this.
|
|
316
|
+
if (this.Mode === 'historical' && this.AgentRun && this.nodeComponentMap.size === 0) {
|
|
229
317
|
console.log('⚡ Processing agent run after view init');
|
|
230
318
|
this.processAgentRun();
|
|
231
319
|
}
|
|
232
|
-
else if (this.
|
|
320
|
+
else if (this.Mode === 'live' && this.LiveSteps?.length > 0) {
|
|
233
321
|
console.log('⚡ Processing live steps after view init');
|
|
234
322
|
this.processLiveSteps();
|
|
235
323
|
}
|
|
@@ -249,8 +337,8 @@ export class AgentExecutionMonitorComponent {
|
|
|
249
337
|
clearNodeComponents() {
|
|
250
338
|
this.nodeComponentMap.forEach(ref => ref.destroy());
|
|
251
339
|
this.nodeComponentMap.clear();
|
|
252
|
-
if (this.
|
|
253
|
-
this.
|
|
340
|
+
if (this.ExecutionNodesContainer) {
|
|
341
|
+
this.ExecutionNodesContainer.clear();
|
|
254
342
|
}
|
|
255
343
|
}
|
|
256
344
|
/**
|
|
@@ -258,26 +346,26 @@ export class AgentExecutionMonitorComponent {
|
|
|
258
346
|
*/
|
|
259
347
|
processAgentRun() {
|
|
260
348
|
console.log('⚙️ Processing agent run:', {
|
|
261
|
-
hasAgentRun: !!this.
|
|
262
|
-
stepsCount: this.
|
|
349
|
+
hasAgentRun: !!this.AgentRun,
|
|
350
|
+
stepsCount: this.AgentRun?.Steps?.length || 0,
|
|
263
351
|
viewInitialized: this.viewInitialized,
|
|
264
|
-
hasContainer: !!this.
|
|
352
|
+
hasContainer: !!this.ExecutionNodesContainer
|
|
265
353
|
});
|
|
266
|
-
if (!this.
|
|
354
|
+
if (!this.AgentRun || !this.viewInitialized || !this.ExecutionNodesContainer) {
|
|
267
355
|
console.warn('⚠️ Cannot process agent run:', {
|
|
268
|
-
agentRun: !this.
|
|
356
|
+
agentRun: !this.AgentRun ? 'missing' : 'present',
|
|
269
357
|
viewInitialized: this.viewInitialized ? 'yes' : 'no',
|
|
270
|
-
container: !this.
|
|
358
|
+
container: !this.ExecutionNodesContainer ? 'missing' : 'present'
|
|
271
359
|
});
|
|
272
360
|
return;
|
|
273
361
|
}
|
|
274
362
|
// Clear existing components
|
|
275
363
|
this.clearNodeComponents();
|
|
276
364
|
// Render the agent run steps
|
|
277
|
-
if (this.
|
|
278
|
-
console.log('🎨 Rendering', this.
|
|
279
|
-
this.renderSteps(this.
|
|
280
|
-
console.log('✅ Finished rendering, container now has', this.
|
|
365
|
+
if (this.AgentRun.Steps && this.AgentRun.Steps.length > 0) {
|
|
366
|
+
console.log('🎨 Rendering', this.AgentRun.Steps.length, 'steps');
|
|
367
|
+
this.renderSteps(this.AgentRun.Steps, 0, []);
|
|
368
|
+
console.log('✅ Finished rendering, container now has', this.ExecutionNodesContainer.length, 'components');
|
|
281
369
|
}
|
|
282
370
|
else {
|
|
283
371
|
console.warn('⚠️ No steps to render');
|
|
@@ -292,15 +380,15 @@ export class AgentExecutionMonitorComponent {
|
|
|
292
380
|
*/
|
|
293
381
|
processLiveSteps() {
|
|
294
382
|
console.log('⚙️ Processing live steps:', {
|
|
295
|
-
stepsCount: this.
|
|
383
|
+
stepsCount: this.LiveSteps?.length || 0,
|
|
296
384
|
viewInitialized: this.viewInitialized,
|
|
297
|
-
hasContainer: !!this.
|
|
385
|
+
hasContainer: !!this.ExecutionNodesContainer
|
|
298
386
|
});
|
|
299
|
-
if (!this.
|
|
387
|
+
if (!this.LiveSteps || !this.viewInitialized || !this.ExecutionNodesContainer) {
|
|
300
388
|
return;
|
|
301
389
|
}
|
|
302
390
|
// Append new steps without clearing existing ones
|
|
303
|
-
this.appendNewLiveSteps(this.
|
|
391
|
+
this.appendNewLiveSteps(this.LiveSteps);
|
|
304
392
|
// Trigger change detection after appending live steps
|
|
305
393
|
this.cdr.detectChanges();
|
|
306
394
|
// Set up live update monitoring if not already set up
|
|
@@ -340,17 +428,17 @@ export class AgentExecutionMonitorComponent {
|
|
|
340
428
|
*/
|
|
341
429
|
createStepComponent(step, depth, agentPath) {
|
|
342
430
|
// Ensure container exists
|
|
343
|
-
if (!this.
|
|
431
|
+
if (!this.ExecutionNodesContainer) {
|
|
344
432
|
console.error('❌ executionNodesContainer not available');
|
|
345
433
|
throw new Error('executionNodesContainer ViewContainerRef not initialized');
|
|
346
434
|
}
|
|
347
|
-
const componentRef = this.
|
|
435
|
+
const componentRef = this.ExecutionNodesContainer.createComponent(ExecutionNodeComponent);
|
|
348
436
|
const instance = componentRef.instance;
|
|
349
437
|
console.log('🔨 Creating component for step:', {
|
|
350
438
|
stepId: step.ID,
|
|
351
439
|
stepName: step.StepName,
|
|
352
440
|
depth,
|
|
353
|
-
containerLength: this.
|
|
441
|
+
containerLength: this.ExecutionNodesContainer.length,
|
|
354
442
|
hostElement: componentRef.location.nativeElement
|
|
355
443
|
});
|
|
356
444
|
// Pass the step data with UI state information
|
|
@@ -362,7 +450,7 @@ export class AgentExecutionMonitorComponent {
|
|
|
362
450
|
// Subscribe to outputs
|
|
363
451
|
instance.toggleNode.subscribe(() => this.toggleStepExpansion(step));
|
|
364
452
|
instance.toggleDetails.subscribe(() => this.toggleStepDetails(step));
|
|
365
|
-
instance.userInteracted.subscribe(() => this.
|
|
453
|
+
instance.userInteracted.subscribe(() => this.OnUserInteraction());
|
|
366
454
|
// Store reference
|
|
367
455
|
this.nodeComponentMap.set(step.ID, componentRef);
|
|
368
456
|
// Log the component state after setup
|
|
@@ -561,11 +649,11 @@ export class AgentExecutionMonitorComponent {
|
|
|
561
649
|
setupLiveUpdates() {
|
|
562
650
|
console.log('⚡ Setting up live updates');
|
|
563
651
|
// Process initial live steps if any
|
|
564
|
-
if (this.
|
|
565
|
-
this.appendNewLiveSteps(this.
|
|
652
|
+
if (this.LiveSteps && this.LiveSteps.length > 0) {
|
|
653
|
+
this.appendNewLiveSteps(this.LiveSteps);
|
|
566
654
|
}
|
|
567
655
|
// Set up interval to check for updates (if not already set up)
|
|
568
|
-
if (this.
|
|
656
|
+
if (this.Mode === 'live' && !this.updateSubscription) {
|
|
569
657
|
this.updateSubscription = interval(500)
|
|
570
658
|
.pipe(takeUntil(this.destroy$))
|
|
571
659
|
.subscribe(() => {
|
|
@@ -588,7 +676,7 @@ export class AgentExecutionMonitorComponent {
|
|
|
588
676
|
runningStep = step;
|
|
589
677
|
}
|
|
590
678
|
});
|
|
591
|
-
this.
|
|
679
|
+
this.CurrentStep = runningStep;
|
|
592
680
|
this.cdr.markForCheck();
|
|
593
681
|
}
|
|
594
682
|
/**
|
|
@@ -641,7 +729,7 @@ export class AgentExecutionMonitorComponent {
|
|
|
641
729
|
* Calculate execution statistics
|
|
642
730
|
*/
|
|
643
731
|
calculateStats() {
|
|
644
|
-
this.
|
|
732
|
+
this.Stats = {
|
|
645
733
|
totalSteps: 0,
|
|
646
734
|
completedSteps: 0,
|
|
647
735
|
failedSteps: 0,
|
|
@@ -652,23 +740,23 @@ export class AgentExecutionMonitorComponent {
|
|
|
652
740
|
totalPrompts: 0
|
|
653
741
|
};
|
|
654
742
|
// Use token data from agent run if available
|
|
655
|
-
if (this.
|
|
656
|
-
this.
|
|
657
|
-
this.
|
|
743
|
+
if (this.AgentRun) {
|
|
744
|
+
this.Stats.totalTokens = this.AgentRun.TotalTokensUsed || 0;
|
|
745
|
+
this.Stats.totalCost = this.AgentRun.TotalCost || 0;
|
|
658
746
|
// Calculate duration
|
|
659
|
-
if (this.
|
|
660
|
-
this.
|
|
661
|
-
new Date(this.
|
|
747
|
+
if (this.AgentRun.StartedAt && this.AgentRun.CompletedAt) {
|
|
748
|
+
this.Stats.totalDuration = new Date(this.AgentRun.CompletedAt).getTime() -
|
|
749
|
+
new Date(this.AgentRun.StartedAt).getTime();
|
|
662
750
|
}
|
|
663
751
|
// Count steps recursively
|
|
664
|
-
if (this.
|
|
665
|
-
this.countSteps(this.
|
|
752
|
+
if (this.AgentRun.Steps) {
|
|
753
|
+
this.countSteps(this.AgentRun.Steps);
|
|
666
754
|
}
|
|
667
755
|
}
|
|
668
756
|
console.log('📈 Stats calculated:', {
|
|
669
|
-
totalSteps: this.
|
|
670
|
-
totalTokens: this.
|
|
671
|
-
totalCost: this.
|
|
757
|
+
totalSteps: this.Stats.totalSteps,
|
|
758
|
+
totalTokens: this.Stats.totalTokens,
|
|
759
|
+
totalCost: this.Stats.totalCost
|
|
672
760
|
});
|
|
673
761
|
}
|
|
674
762
|
/**
|
|
@@ -676,17 +764,17 @@ export class AgentExecutionMonitorComponent {
|
|
|
676
764
|
*/
|
|
677
765
|
countSteps(steps) {
|
|
678
766
|
for (const step of steps) {
|
|
679
|
-
this.
|
|
767
|
+
this.Stats.totalSteps++;
|
|
680
768
|
// Map to display types for consistency
|
|
681
769
|
const displayType = this.getStepTypeClass(step.StepType);
|
|
682
|
-
this.
|
|
770
|
+
this.Stats.stepsByType[displayType] = (this.Stats.stepsByType[displayType] || 0) + 1;
|
|
683
771
|
if (step.Status === 'Completed')
|
|
684
|
-
this.
|
|
772
|
+
this.Stats.completedSteps++;
|
|
685
773
|
if (step.Status === 'Failed' || step.Status === 'Cancelled')
|
|
686
|
-
this.
|
|
774
|
+
this.Stats.failedSteps++;
|
|
687
775
|
// Count prompts
|
|
688
776
|
if (step.StepType === 'Prompt') {
|
|
689
|
-
this.
|
|
777
|
+
this.Stats.totalPrompts++;
|
|
690
778
|
}
|
|
691
779
|
// Recurse for sub-agents
|
|
692
780
|
if (step.StepType === 'Sub-Agent' && step.SubAgentRun?.Steps) {
|
|
@@ -697,7 +785,7 @@ export class AgentExecutionMonitorComponent {
|
|
|
697
785
|
/**
|
|
698
786
|
* Handle scroll events
|
|
699
787
|
*/
|
|
700
|
-
|
|
788
|
+
OnScroll(event) {
|
|
701
789
|
if (this.isAutoScrolling) {
|
|
702
790
|
// Ignore scroll events triggered by auto-scrolling
|
|
703
791
|
return;
|
|
@@ -716,13 +804,21 @@ export class AgentExecutionMonitorComponent {
|
|
|
716
804
|
}
|
|
717
805
|
this.lastScrollPosition = element.scrollTop;
|
|
718
806
|
}
|
|
807
|
+
/** @deprecated Use {@link OnScroll}. */
|
|
808
|
+
onScroll(event) {
|
|
809
|
+
return this.OnScroll(event);
|
|
810
|
+
}
|
|
719
811
|
/**
|
|
720
812
|
* Handle user clicks (interaction detection)
|
|
721
813
|
*/
|
|
722
|
-
|
|
814
|
+
OnUserInteraction() {
|
|
723
815
|
// This is called when user clicks anywhere in the execution tree
|
|
724
816
|
// The toggleNode method will set userHasInteracted for specific interactions
|
|
725
817
|
}
|
|
818
|
+
/** @deprecated Use {@link OnUserInteraction}. */
|
|
819
|
+
onUserInteraction() {
|
|
820
|
+
return this.OnUserInteraction();
|
|
821
|
+
}
|
|
726
822
|
/**
|
|
727
823
|
* Check if scroll is at bottom
|
|
728
824
|
*/
|
|
@@ -734,9 +830,9 @@ export class AgentExecutionMonitorComponent {
|
|
|
734
830
|
* Check if user is at bottom (for initial setup)
|
|
735
831
|
*/
|
|
736
832
|
checkIfUserAtBottom() {
|
|
737
|
-
if (!this.
|
|
833
|
+
if (!this.ExecutionTreeContainer)
|
|
738
834
|
return;
|
|
739
|
-
const element = this.
|
|
835
|
+
const element = this.ExecutionTreeContainer.nativeElement;
|
|
740
836
|
if (this.isScrolledToBottom(element)) {
|
|
741
837
|
this.userHasScrolled = false;
|
|
742
838
|
}
|
|
@@ -745,10 +841,10 @@ export class AgentExecutionMonitorComponent {
|
|
|
745
841
|
* Auto-scroll to bottom if user hasn't interacted
|
|
746
842
|
*/
|
|
747
843
|
autoScrollToBottom() {
|
|
748
|
-
if (!this.
|
|
844
|
+
if (!this.ExecutionTreeContainer || this.userHasInteracted || this.userHasScrolled) {
|
|
749
845
|
return;
|
|
750
846
|
}
|
|
751
|
-
const element = this.
|
|
847
|
+
const element = this.ExecutionTreeContainer.nativeElement;
|
|
752
848
|
this.isAutoScrolling = true;
|
|
753
849
|
// Use smooth scrolling for better UX
|
|
754
850
|
element.scrollTo({
|
|
@@ -763,9 +859,13 @@ export class AgentExecutionMonitorComponent {
|
|
|
763
859
|
/**
|
|
764
860
|
* Format agent path for display
|
|
765
861
|
*/
|
|
766
|
-
|
|
862
|
+
FormatAgentPath(path) {
|
|
767
863
|
return path.join(' → ');
|
|
768
864
|
}
|
|
865
|
+
/** @deprecated Use {@link FormatAgentPath}. */
|
|
866
|
+
formatAgentPath(path) {
|
|
867
|
+
return this.FormatAgentPath(path);
|
|
868
|
+
}
|
|
769
869
|
/**
|
|
770
870
|
* Format duration for display
|
|
771
871
|
*/
|
|
@@ -781,13 +881,17 @@ export class AgentExecutionMonitorComponent {
|
|
|
781
881
|
/**
|
|
782
882
|
* Get step types for display
|
|
783
883
|
*/
|
|
884
|
+
GetStepTypes() {
|
|
885
|
+
return Object.keys(this.Stats.stepsByType).sort();
|
|
886
|
+
}
|
|
887
|
+
/** @deprecated Use {@link GetStepTypes}. */
|
|
784
888
|
getStepTypes() {
|
|
785
|
-
return
|
|
889
|
+
return this.GetStepTypes();
|
|
786
890
|
}
|
|
787
891
|
/**
|
|
788
892
|
* Pluralize step type based on count
|
|
789
893
|
*/
|
|
790
|
-
|
|
894
|
+
PluralizeStepType(type, count) {
|
|
791
895
|
if (count === 1) {
|
|
792
896
|
return type;
|
|
793
897
|
}
|
|
@@ -802,10 +906,14 @@ export class AgentExecutionMonitorComponent {
|
|
|
802
906
|
return type + 's';
|
|
803
907
|
}
|
|
804
908
|
}
|
|
909
|
+
/** @deprecated Use {@link PluralizeStepType}. */
|
|
910
|
+
pluralizeStepType(type, count) {
|
|
911
|
+
return this.PluralizeStepType(type, count);
|
|
912
|
+
}
|
|
805
913
|
/**
|
|
806
914
|
* Format markdown content for display
|
|
807
915
|
*/
|
|
808
|
-
|
|
916
|
+
FormatMarkdown(markdown) {
|
|
809
917
|
// Basic markdown formatting
|
|
810
918
|
// This is a simple implementation - you might want to use a proper markdown library
|
|
811
919
|
let html = markdown;
|
|
@@ -838,11 +946,15 @@ export class AgentExecutionMonitorComponent {
|
|
|
838
946
|
html = html.replace(/`([^`]+)`/g, '<code>$1</code>');
|
|
839
947
|
return html;
|
|
840
948
|
}
|
|
949
|
+
/** @deprecated Use {@link FormatMarkdown}. */
|
|
950
|
+
formatMarkdown(markdown) {
|
|
951
|
+
return this.FormatMarkdown(markdown);
|
|
952
|
+
}
|
|
841
953
|
/**
|
|
842
954
|
* Append new live steps without re-rendering entire tree
|
|
843
955
|
*/
|
|
844
956
|
appendNewLiveSteps(newSteps) {
|
|
845
|
-
if (!newSteps || newSteps.length === 0 || !this.viewInitialized || !this.
|
|
957
|
+
if (!newSteps || newSteps.length === 0 || !this.viewInitialized || !this.ExecutionNodesContainer) {
|
|
846
958
|
return;
|
|
847
959
|
}
|
|
848
960
|
console.log('📝 Appending', newSteps.length, 'live steps');
|
|
@@ -912,18 +1024,26 @@ export class AgentExecutionMonitorComponent {
|
|
|
912
1024
|
/**
|
|
913
1025
|
* Check if execution is complete
|
|
914
1026
|
*/
|
|
1027
|
+
IsExecutionComplete() {
|
|
1028
|
+
return this.Stats.completedSteps > 0 &&
|
|
1029
|
+
this.Stats.completedSteps === this.Stats.totalSteps - this.Stats.failedSteps;
|
|
1030
|
+
}
|
|
1031
|
+
/** @deprecated Use {@link IsExecutionComplete}. */
|
|
915
1032
|
isExecutionComplete() {
|
|
916
|
-
return this.
|
|
917
|
-
this.stats.completedSteps === this.stats.totalSteps - this.stats.failedSteps;
|
|
1033
|
+
return this.IsExecutionComplete();
|
|
918
1034
|
}
|
|
919
1035
|
/**
|
|
920
1036
|
* Handle view run button click
|
|
921
1037
|
*/
|
|
922
|
-
|
|
923
|
-
if (this.
|
|
924
|
-
this.
|
|
1038
|
+
OnViewRunClick() {
|
|
1039
|
+
if (this.AgentRun) {
|
|
1040
|
+
this.ViewRunClick.emit({ runId: this.AgentRun.ID, runType: 'agent' });
|
|
925
1041
|
}
|
|
926
1042
|
}
|
|
1043
|
+
/** @deprecated Use {@link OnViewRunClick}. */
|
|
1044
|
+
onViewRunClick() {
|
|
1045
|
+
return this.OnViewRunClick();
|
|
1046
|
+
}
|
|
927
1047
|
/**
|
|
928
1048
|
* Expands all nodes that have sub-agent children
|
|
929
1049
|
*/
|
|
@@ -951,8 +1071,8 @@ export class AgentExecutionMonitorComponent {
|
|
|
951
1071
|
* Scroll the execution tree to the top
|
|
952
1072
|
*/
|
|
953
1073
|
scrollToTop() {
|
|
954
|
-
if (this.
|
|
955
|
-
const element = this.
|
|
1074
|
+
if (this.ExecutionTreeContainer) {
|
|
1075
|
+
const element = this.ExecutionTreeContainer.nativeElement;
|
|
956
1076
|
element.scrollTo({
|
|
957
1077
|
top: 0,
|
|
958
1078
|
behavior: 'smooth'
|
|
@@ -970,9 +1090,9 @@ export class AgentExecutionMonitorComponent {
|
|
|
970
1090
|
i0.ɵɵviewQuery(_c0, 5)(_c1, 5, ViewContainerRef);
|
|
971
1091
|
} if (rf & 2) {
|
|
972
1092
|
let _t;
|
|
973
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
974
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
975
|
-
} }, inputs: { mode: "mode", agentRun: "agentRun", liveSteps: "liveSteps", autoExpand: "autoExpand", runId: "runId", runType: "runType" }, outputs: { viewRunClick: "viewRunClick" }, standalone: false, features: [i0.ɵɵNgOnChangesFeature], decls: 39, vars: 16, consts: [["executionTreeContainer", ""], ["executionNodesContainer", ""], [1, "execution-monitor"], [1, "monitor-header"], [1, "header-title"], [1, "fa-solid", "fa-diagram-project"], [1, "live-indicator"], [1, "current-status"], [1, "view-run-btn"], [1, "execution-tree", 3, "scroll", "click"], [1, "nodes-container"], ["Icon", "fa-solid fa-hourglass-start", "Title", "Waiting for execution to begin...", "Size", "compact"], [1, "monitor-footer"], [1, "stats-grid"], [1, "stat-item"], [1, "stat-label"], [1, "stat-value"], [1, "failed-count"], [1, "step-types"], [1, "pulse"], [1, "status-label"], [1, "step-name"], [1, "view-run-btn", 3, "click"], [1, "fa-solid", "fa-external-link-alt"], [1, "type-badge"]], template: function AgentExecutionMonitorComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1093
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.ExecutionTreeContainer = _t.first);
|
|
1094
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.ExecutionNodesContainer = _t.first);
|
|
1095
|
+
} }, inputs: { Mode: "Mode", mode: "mode", AgentRun: "AgentRun", agentRun: "agentRun", LiveSteps: "LiveSteps", liveSteps: "liveSteps", AutoExpand: "AutoExpand", autoExpand: "autoExpand", RunId: "RunId", runId: "runId", RunType: "RunType", runType: "runType" }, outputs: { ViewRunClick: "ViewRunClick", viewRunClick: "viewRunClick" }, standalone: false, features: [i0.ɵɵNgOnChangesFeature], decls: 39, vars: 16, consts: [["executionTreeContainer", ""], ["executionNodesContainer", ""], [1, "execution-monitor"], [1, "monitor-header"], [1, "header-title"], [1, "fa-solid", "fa-diagram-project"], [1, "live-indicator"], [1, "current-status"], [1, "view-run-btn"], [1, "execution-tree", 3, "scroll", "click"], [1, "nodes-container"], ["Icon", "fa-solid fa-hourglass-start", "Title", "Waiting for execution to begin...", "Size", "compact"], [1, "monitor-footer"], [1, "stats-grid"], [1, "stat-item"], [1, "stat-label"], [1, "stat-value"], [1, "failed-count"], [1, "step-types"], [1, "pulse"], [1, "status-label"], [1, "step-name"], [1, "view-run-btn", 3, "click"], [1, "fa-solid", "fa-external-link-alt"], [1, "type-badge"]], template: function AgentExecutionMonitorComponent_Template(rf, ctx) { if (rf & 1) {
|
|
976
1096
|
i0.ɵɵelementStart(0, "div", 2)(1, "div", 3)(2, "div", 4);
|
|
977
1097
|
i0.ɵɵelement(3, "i", 5);
|
|
978
1098
|
i0.ɵɵelementStart(4, "span");
|
|
@@ -1135,24 +1255,38 @@ export class AgentExecutionMonitorComponent {
|
|
|
1135
1255
|
</div>
|
|
1136
1256
|
</div>
|
|
1137
1257
|
`, styles: ["\n :host {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n }\n \n .execution-monitor {\n display: flex;\n flex-direction: column;\n flex: 1;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n overflow: hidden;\n }\n\n /* Header */\n .monitor-header {\n padding: 16px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n }\n\n .header-title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 16px;\n font-weight: 600;\n color: var(--mj-text-primary);\n margin-bottom: 8px;\n }\n\n .header-title i {\n color: var(--mj-brand-primary);\n }\n\n .live-indicator {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 8px;\n background: var(--mj-status-error);\n color: var(--mj-text-inverse);\n border-radius: 4px;\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.5px;\n }\n\n .pulse {\n display: inline-block;\n width: 8px;\n height: 8px;\n background: white;\n border-radius: 50%;\n animation: pulse 2s infinite;\n }\n\n @keyframes pulse {\n 0% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.5; transform: scale(0.8); }\n 100% { opacity: 1; transform: scale(1); }\n }\n\n .current-status {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 13px;\n color: var(--mj-text-secondary);\n }\n\n .status-label {\n font-weight: 500;\n }\n\n .agent-path {\n color: var(--mj-text-muted);\n }\n\n .step-name {\n color: var(--mj-text-primary);\n font-weight: 500;\n }\n\n /* Execution Tree */\n .execution-tree {\n flex: 1;\n overflow-y: auto;\n overflow-x: auto;\n padding: 16px;\n min-height: 0;\n }\n \n .nodes-container {\n /* No extra padding needed, indentation handled by node margins */\n }\n\n .execution-tree mj-empty-state {\n height: 100%;\n }\n\n /* Tree Nodes - These styles are for reference only, actual rendering is done by ExecutionNodeComponent */\n .tree-node {\n margin-bottom: 4px;\n }\n\n /* Footer */\n .monitor-footer {\n padding: 16px;\n background: var(--mj-bg-surface-card);\n border-top: 1px solid var(--mj-border-default);\n }\n\n .stats-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));\n gap: 16px;\n margin-bottom: 12px;\n }\n\n .stat-item {\n text-align: center;\n }\n\n .stat-label {\n display: block;\n font-size: 11px;\n color: var(--mj-text-secondary);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin-bottom: 4px;\n }\n\n .stat-value {\n display: block;\n font-size: 16px;\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n\n .failed-count {\n color: var(--mj-status-error);\n font-size: 12px;\n font-weight: normal;\n }\n\n .step-types {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n justify-content: center;\n }\n\n .type-badge {\n display: inline-block;\n padding: 4px 8px;\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n }\n\n /* View Run Button */\n .view-run-btn {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n border: none;\n padding: 6px 12px;\n border-radius: 4px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s ease;\n margin-left: auto;\n }\n\n .view-run-btn:hover {\n background: var(--mj-brand-primary-hover);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n }\n \n .view-run-btn i {\n font-size: 12px;\n }\n\n /* Responsive */\n @media (max-width: 768px) {\n .monitor-header {\n padding: 12px;\n }\n\n .execution-tree {\n padding: 12px;\n }\n }\n "] }]
|
|
1138
|
-
}], () => [{ type: i0.ChangeDetectorRef }], {
|
|
1258
|
+
}], () => [{ type: i0.ChangeDetectorRef }], { Mode: [{
|
|
1259
|
+
type: Input
|
|
1260
|
+
}], mode: [{
|
|
1261
|
+
type: Input
|
|
1262
|
+
}], AgentRun: [{
|
|
1139
1263
|
type: Input
|
|
1140
1264
|
}], agentRun: [{
|
|
1141
1265
|
type: Input
|
|
1266
|
+
}], LiveSteps: [{
|
|
1267
|
+
type: Input
|
|
1142
1268
|
}], liveSteps: [{
|
|
1143
1269
|
type: Input
|
|
1270
|
+
}], AutoExpand: [{
|
|
1271
|
+
type: Input
|
|
1144
1272
|
}], autoExpand: [{
|
|
1145
1273
|
type: Input
|
|
1274
|
+
}], RunId: [{
|
|
1275
|
+
type: Input
|
|
1146
1276
|
}], runId: [{
|
|
1147
1277
|
type: Input
|
|
1278
|
+
}], RunType: [{
|
|
1279
|
+
type: Input
|
|
1148
1280
|
}], runType: [{
|
|
1149
1281
|
type: Input
|
|
1282
|
+
}], ViewRunClick: [{
|
|
1283
|
+
type: Output
|
|
1150
1284
|
}], viewRunClick: [{
|
|
1151
1285
|
type: Output
|
|
1152
|
-
}],
|
|
1286
|
+
}], ExecutionTreeContainer: [{
|
|
1153
1287
|
type: ViewChild,
|
|
1154
1288
|
args: ['executionTreeContainer']
|
|
1155
|
-
}],
|
|
1289
|
+
}], ExecutionNodesContainer: [{
|
|
1156
1290
|
type: ViewChild,
|
|
1157
1291
|
args: ['executionNodesContainer', { read: ViewContainerRef }]
|
|
1158
1292
|
}] }); })();
|