@memberjunction/ng-core-entity-forms 2.50.0 → 2.52.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.
- package/README.md +215 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts +171 -11
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js +1411 -145
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts +40 -0
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts.map +1 -0
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js +965 -0
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js.map +1 -0
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts +80 -5
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js +938 -448
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-execution-log-form.component.d.ts +40 -0
- package/dist/lib/custom/Actions/action-execution-log-form.component.d.ts.map +1 -0
- package/dist/lib/custom/Actions/action-execution-log-form.component.js +530 -0
- package/dist/lib/custom/Actions/action-execution-log-form.component.js.map +1 -0
- package/dist/lib/custom/Actions/action-form.component.d.ts +90 -0
- package/dist/lib/custom/Actions/action-form.component.d.ts.map +1 -0
- package/dist/lib/custom/Actions/action-form.component.js +1579 -0
- package/dist/lib/custom/Actions/action-form.component.js.map +1 -0
- package/dist/lib/custom/Actions/action-param-dialog.component.d.ts +32 -0
- package/dist/lib/custom/Actions/action-param-dialog.component.d.ts.map +1 -0
- package/dist/lib/custom/Actions/action-param-dialog.component.js +320 -0
- package/dist/lib/custom/Actions/action-param-dialog.component.js.map +1 -0
- package/dist/lib/custom/Actions/action-test-harness-dialog.component.d.ts +15 -0
- package/dist/lib/custom/Actions/action-test-harness-dialog.component.d.ts.map +1 -0
- package/dist/lib/custom/Actions/action-test-harness-dialog.component.js +96 -0
- package/dist/lib/custom/Actions/action-test-harness-dialog.component.js.map +1 -0
- package/dist/lib/custom/Actions/action-test-harness.component.d.ts +50 -0
- package/dist/lib/custom/Actions/action-test-harness.component.d.ts.map +1 -0
- package/dist/lib/custom/Actions/action-test-harness.component.js +708 -0
- package/dist/lib/custom/Actions/action-test-harness.component.js.map +1 -0
- package/dist/lib/custom/ai-test-harness/agent-execution-monitor.component.d.ts +244 -0
- package/dist/lib/custom/ai-test-harness/agent-execution-monitor.component.d.ts.map +1 -0
- package/dist/lib/custom/ai-test-harness/agent-execution-monitor.component.js +1327 -0
- package/dist/lib/custom/ai-test-harness/agent-execution-monitor.component.js.map +1 -0
- package/dist/lib/custom/ai-test-harness/agent-execution-node.component.d.ts +19 -0
- package/dist/lib/custom/ai-test-harness/agent-execution-node.component.d.ts.map +1 -0
- package/dist/lib/custom/ai-test-harness/agent-execution-node.component.js +458 -0
- package/dist/lib/custom/ai-test-harness/agent-execution-node.component.js.map +1 -0
- package/dist/lib/custom/ai-test-harness/ai-test-harness-dialog.component.d.ts +78 -0
- package/dist/lib/custom/ai-test-harness/ai-test-harness-dialog.component.d.ts.map +1 -0
- package/dist/lib/custom/ai-test-harness/ai-test-harness-dialog.component.js +157 -0
- package/dist/lib/custom/ai-test-harness/ai-test-harness-dialog.component.js.map +1 -0
- package/dist/lib/custom/ai-test-harness/ai-test-harness.component.d.ts +589 -0
- package/dist/lib/custom/ai-test-harness/ai-test-harness.component.d.ts.map +1 -0
- package/dist/lib/custom/ai-test-harness/ai-test-harness.component.js +3140 -0
- package/dist/lib/custom/ai-test-harness/ai-test-harness.component.js.map +1 -0
- package/dist/lib/custom/ai-test-harness/json-viewer-window.component.d.ts +8 -0
- package/dist/lib/custom/ai-test-harness/json-viewer-window.component.d.ts.map +1 -0
- package/dist/lib/custom/ai-test-harness/json-viewer-window.component.js +57 -0
- package/dist/lib/custom/ai-test-harness/json-viewer-window.component.js.map +1 -0
- package/dist/lib/custom/custom-forms.module.d.ts +33 -21
- package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
- package/dist/lib/custom/custom-forms.module.js +97 -18
- package/dist/lib/custom/custom-forms.module.js.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts +35 -0
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts.map +1 -0
- package/dist/lib/custom/shared/entity-selector-dialog.component.js +290 -0
- package/dist/lib/custom/shared/entity-selector-dialog.component.js.map +1 -0
- package/dist/lib/custom/test-harness-dialog.service.d.ts +111 -0
- package/dist/lib/custom/test-harness-dialog.service.d.ts.map +1 -0
- package/dist/lib/custom/test-harness-dialog.service.js +211 -0
- package/dist/lib/custom/test-harness-dialog.service.js.map +1 -0
- package/dist/lib/generated/Entities/AIAgent/aiagent.form.component.js +12 -11
- package/dist/lib/generated/Entities/AIAgent/aiagent.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIAgent/sections/aiagent-form-overview.component.d.ts +54 -0
- package/dist/lib/generated/Entities/AIAgent/sections/aiagent-form-overview.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/AIAgent/sections/aiagent-form-overview.component.js +492 -0
- package/dist/lib/generated/Entities/AIAgent/sections/aiagent-form-overview.component.js.map +1 -0
- package/dist/lib/generated/Entities/AIAgentRun/aiagentrun.form.component.js +8 -7
- package/dist/lib/generated/Entities/AIAgentRun/aiagentrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIConfiguration/aiconfiguration.form.component.js +8 -7
- package/dist/lib/generated/Entities/AIConfiguration/aiconfiguration.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIModel/aimodel.form.component.js +8 -7
- package/dist/lib/generated/Entities/AIModel/aimodel.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIModelType/aimodeltype.form.component.js +12 -11
- package/dist/lib/generated/Entities/AIModelType/aimodeltype.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIPrompt/aiprompt.form.component.js +12 -11
- package/dist/lib/generated/Entities/AIPrompt/aiprompt.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIPrompt/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/AIPrompt/sections/details.component.js +94 -4
- package/dist/lib/generated/Entities/AIPrompt/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIPromptRun/aipromptrun.form.component.js +12 -11
- package/dist/lib/generated/Entities/AIPromptRun/aipromptrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIPromptRun/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/AIPromptRun/sections/details.component.js +103 -4
- package/dist/lib/generated/Entities/AIPromptRun/sections/details.component.js.map +1 -1
- package/dist/lib/generated/Entities/AIVendor/aivendor.form.component.js +12 -11
- package/dist/lib/generated/Entities/AIVendor/aivendor.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/ActionExecutionLog/sections/details.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/ActionExecutionLog/sections/details.component.js +13 -4
- package/dist/lib/generated/Entities/ActionExecutionLog/sections/details.component.js.map +1 -1
- package/dist/public-api.d.ts +3 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +16 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +12 -11
- package/dist/lib/custom/AIAgents/ai-agent-execution-dialog.component.d.ts +0 -52
- package/dist/lib/custom/AIAgents/ai-agent-execution-dialog.component.d.ts.map +0 -1
- package/dist/lib/custom/AIAgents/ai-agent-execution-dialog.component.js +0 -590
- package/dist/lib/custom/AIAgents/ai-agent-execution-dialog.component.js.map +0 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-execution-dialog.component.d.ts +0 -94
- package/dist/lib/custom/AIPrompts/ai-prompt-execution-dialog.component.d.ts.map +0 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-execution-dialog.component.js +0 -792
- package/dist/lib/custom/AIPrompts/ai-prompt-execution-dialog.component.js.map +0 -1
package/README.md
CHANGED
|
@@ -218,6 +218,192 @@ Each entity form typically follows this structure:
|
|
|
218
218
|
| AI-related forms | Forms for AI models, prompts, and agents |
|
|
219
219
|
| Content forms | Forms for content management |
|
|
220
220
|
| Communication forms | Forms for messaging and notifications |
|
|
221
|
+
| **Test Harness Components** | **Interactive testing interfaces for AI agents and prompts** |
|
|
222
|
+
|
|
223
|
+
## AI Test Harness System
|
|
224
|
+
|
|
225
|
+
This package includes a comprehensive test harness system for AI Agents and AI Prompts, providing developers with powerful tools for testing, debugging, and validating AI components.
|
|
226
|
+
|
|
227
|
+
### Test Harness Components
|
|
228
|
+
|
|
229
|
+
#### 1. AI Agent Test Harness (`AIAgentTestHarnessComponent`)
|
|
230
|
+
|
|
231
|
+
A full-featured testing interface for AI agents with the following capabilities:
|
|
232
|
+
|
|
233
|
+
**Core Features:**
|
|
234
|
+
- **Interactive Chat Interface**: Real-time conversation with AI agents
|
|
235
|
+
- **Streaming Support**: Live streaming of agent responses with elapsed time tracking
|
|
236
|
+
- **Data Context Management**: Configure variables passed to agents during execution
|
|
237
|
+
- **Template Data Management**: Manage template variables for agent prompts
|
|
238
|
+
- **Conversation Persistence**: Save/load conversations with full state restoration
|
|
239
|
+
- **Import/Export**: JSON-based conversation backup and sharing
|
|
240
|
+
- **Content Formatting**: Automatic detection and rendering of Markdown, JSON, and plain text
|
|
241
|
+
- **Raw Content Toggle**: View both processed and raw AI responses
|
|
242
|
+
- **Error Handling**: Comprehensive error display and user feedback
|
|
243
|
+
|
|
244
|
+
**Usage Example:**
|
|
245
|
+
```html
|
|
246
|
+
<mj-ai-agent-test-harness
|
|
247
|
+
[aiAgent]="myAgent"
|
|
248
|
+
[isVisible]="true"
|
|
249
|
+
(visibilityChange)="onVisibilityChanged($event)">
|
|
250
|
+
</mj-ai-agent-test-harness>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Data Context Configuration:**
|
|
254
|
+
```typescript
|
|
255
|
+
// Configure variables passed to the agent
|
|
256
|
+
this.testHarness.dataContextVariables = [
|
|
257
|
+
{ name: 'userId', value: 'user-123', type: 'string' },
|
|
258
|
+
{ name: 'department', value: 'Engineering', type: 'string' },
|
|
259
|
+
{ name: 'priority', value: '1', type: 'number' }
|
|
260
|
+
];
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### 2. AI Prompt Test Harness (`AIPromptTestHarnessComponent`)
|
|
264
|
+
|
|
265
|
+
A specialized testing interface for AI prompts with template variable management:
|
|
266
|
+
|
|
267
|
+
**Core Features:**
|
|
268
|
+
- **Prompt Testing**: Execute prompts with different AI models
|
|
269
|
+
- **Template Variable Management**: Configure and test prompt variables
|
|
270
|
+
- **Model Selection**: Choose from available AI models for testing
|
|
271
|
+
- **Rendered Prompt Preview**: View how templates render with current variables
|
|
272
|
+
- **Conversation Management**: Similar conversation features as agent harness
|
|
273
|
+
- **Variable Auto-Detection**: Automatically detect variables in prompt templates
|
|
274
|
+
|
|
275
|
+
**Usage Example:**
|
|
276
|
+
```html
|
|
277
|
+
<mj-ai-prompt-test-harness
|
|
278
|
+
[aiPrompt]="myPrompt"
|
|
279
|
+
[template]="promptTemplate"
|
|
280
|
+
[templateContent]="templateContent"
|
|
281
|
+
[isVisible]="true">
|
|
282
|
+
</mj-ai-prompt-test-harness>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### 3. Test Harness Dialog Service (`TestHarnessDialogService`)
|
|
286
|
+
|
|
287
|
+
A centralized service for opening test harnesses in modal dialogs:
|
|
288
|
+
|
|
289
|
+
**Features:**
|
|
290
|
+
- **Configurable Dialogs**: Custom sizing, titles, and initial data
|
|
291
|
+
- **Agent Loading**: Load agents by ID or use existing entities
|
|
292
|
+
- **Dimension Support**: Viewport units (vw, vh) and pixel dimensions
|
|
293
|
+
- **Initial Data Setup**: Pre-populate context and template variables
|
|
294
|
+
|
|
295
|
+
**Usage Examples:**
|
|
296
|
+
```typescript
|
|
297
|
+
// Open AI Agent test harness
|
|
298
|
+
const dialogRef = this.testHarnessService.openAgentTestHarness({
|
|
299
|
+
agentId: 'agent-123',
|
|
300
|
+
title: 'Test My Agent',
|
|
301
|
+
width: '90vw',
|
|
302
|
+
height: '80vh',
|
|
303
|
+
initialDataContext: {
|
|
304
|
+
userId: 'user-456',
|
|
305
|
+
department: 'Engineering'
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// Open AI Prompt test harness
|
|
310
|
+
const dialogRef = this.testHarnessService.openPromptTestHarness({
|
|
311
|
+
promptId: 'prompt-789',
|
|
312
|
+
selectedModelId: 'gpt-4',
|
|
313
|
+
initialTemplateVariables: {
|
|
314
|
+
name: 'Alice',
|
|
315
|
+
context: 'Customer support inquiry'
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// Convenience methods
|
|
320
|
+
await this.testHarnessService.openAgentById('agent-123');
|
|
321
|
+
await this.testHarnessService.openPromptById('prompt-456');
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Enhanced AI Agent Form
|
|
325
|
+
|
|
326
|
+
The AI Agent form (`AIAgentFormComponentExtended`) includes integrated test harness access:
|
|
327
|
+
|
|
328
|
+
**Features:**
|
|
329
|
+
- **Built-in Test Button**: Direct access to test harness from agent form
|
|
330
|
+
- **Related Entity Management**: View sub-agents, prompts, actions, and execution history
|
|
331
|
+
- **Status Indicators**: Visual status badges and execution mode icons
|
|
332
|
+
- **Navigation Support**: Links to related entities
|
|
333
|
+
- **Execution History**: Recent runs with timing and status information
|
|
334
|
+
|
|
335
|
+
**Enhanced Capabilities:**
|
|
336
|
+
```typescript
|
|
337
|
+
// Open test harness from form
|
|
338
|
+
this.openTestHarness(); // Validates agent is saved first
|
|
339
|
+
|
|
340
|
+
// View execution status
|
|
341
|
+
this.getExecutionStatusIcon(status); // Returns appropriate FontAwesome icon
|
|
342
|
+
this.getExecutionStatusColor(status); // Returns status color
|
|
343
|
+
|
|
344
|
+
// Format timing information
|
|
345
|
+
this.formatExecutionTime(milliseconds); // Human-readable time format
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Conversation Management
|
|
349
|
+
|
|
350
|
+
Both test harnesses include comprehensive conversation management:
|
|
351
|
+
|
|
352
|
+
**Features:**
|
|
353
|
+
- **Auto-Save**: Conversations automatically save during active sessions
|
|
354
|
+
- **Manual Save**: Save conversations with custom names
|
|
355
|
+
- **Load/Restore**: Restore complete conversation state including variables
|
|
356
|
+
- **Export/Import**: JSON-based conversation portability
|
|
357
|
+
- **Storage Limits**: Automatic cleanup (50 conversation limit)
|
|
358
|
+
|
|
359
|
+
**Export Format:**
|
|
360
|
+
```json
|
|
361
|
+
{
|
|
362
|
+
"agent": {
|
|
363
|
+
"id": "agent-123",
|
|
364
|
+
"name": "Customer Service Agent",
|
|
365
|
+
"description": "Handles customer inquiries"
|
|
366
|
+
},
|
|
367
|
+
"messages": [...],
|
|
368
|
+
"dataContext": {
|
|
369
|
+
"userId": "user-456",
|
|
370
|
+
"department": "Support"
|
|
371
|
+
},
|
|
372
|
+
"templateData": {
|
|
373
|
+
"customerName": "John Doe"
|
|
374
|
+
},
|
|
375
|
+
"exportedAt": "2024-01-15T10:30:00.000Z"
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Content Rendering System
|
|
380
|
+
|
|
381
|
+
Advanced content formatting with automatic type detection:
|
|
382
|
+
|
|
383
|
+
**Supported Formats:**
|
|
384
|
+
- **Markdown**: Headers, lists, code blocks, links, emphasis
|
|
385
|
+
- **JSON**: Syntax highlighting and pretty formatting
|
|
386
|
+
- **Plain Text**: Clean text rendering with line breaks
|
|
387
|
+
|
|
388
|
+
**Content Type Detection:**
|
|
389
|
+
```typescript
|
|
390
|
+
// Automatically detects content type
|
|
391
|
+
const contentType = this.detectContentType(content);
|
|
392
|
+
// Returns: 'markdown' | 'json' | 'text'
|
|
393
|
+
|
|
394
|
+
// Renders content appropriately
|
|
395
|
+
const safeHtml = this.getFormattedContent(message);
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Integration Points
|
|
399
|
+
|
|
400
|
+
The test harness system integrates seamlessly with:
|
|
401
|
+
|
|
402
|
+
- **MemberJunction Entity System**: Uses proper entity loading patterns
|
|
403
|
+
- **GraphQL Data Provider**: Executes agents and prompts via GraphQL mutations
|
|
404
|
+
- **Notification Service**: User feedback for actions and errors
|
|
405
|
+
- **LocalStorage**: Conversation persistence across sessions
|
|
406
|
+
- **Kendo UI Dialogs**: Professional modal interfaces
|
|
221
407
|
|
|
222
408
|
## Notes
|
|
223
409
|
|
|
@@ -228,6 +414,7 @@ Each entity form typically follows this structure:
|
|
|
228
414
|
|
|
229
415
|
## Dependencies
|
|
230
416
|
|
|
417
|
+
### Core Dependencies
|
|
231
418
|
- @angular/common
|
|
232
419
|
- @angular/core
|
|
233
420
|
- @angular/forms
|
|
@@ -235,6 +422,8 @@ Each entity form typically follows this structure:
|
|
|
235
422
|
- @memberjunction/core-entities
|
|
236
423
|
- @memberjunction/ng-explorer-core
|
|
237
424
|
- @memberjunction/ng-base-forms
|
|
425
|
+
|
|
426
|
+
### UI Component Dependencies
|
|
238
427
|
- @memberjunction/ng-form-toolbar
|
|
239
428
|
- @memberjunction/ng-tabstrip
|
|
240
429
|
- @memberjunction/ng-container-directives
|
|
@@ -242,4 +431,29 @@ Each entity form typically follows this structure:
|
|
|
242
431
|
- @memberjunction/ng-timeline
|
|
243
432
|
- @memberjunction/ng-join-grid
|
|
244
433
|
- @progress/kendo-angular-grid
|
|
245
|
-
- @progress/kendo-angular-dropdowns
|
|
434
|
+
- @progress/kendo-angular-dropdowns
|
|
435
|
+
- @progress/kendo-angular-dialog
|
|
436
|
+
|
|
437
|
+
### AI & Notification Dependencies
|
|
438
|
+
- @memberjunction/ai
|
|
439
|
+
- @memberjunction/ng-notifications
|
|
440
|
+
- @memberjunction/graphql-dataprovider
|
|
441
|
+
|
|
442
|
+
### Test Harness Components
|
|
443
|
+
|
|
444
|
+
The test harness system introduces several new components and services:
|
|
445
|
+
|
|
446
|
+
| Component/Service | Purpose |
|
|
447
|
+
|------------------|---------|
|
|
448
|
+
| `AIAgentTestHarnessComponent` | Interactive chat interface for testing AI agents |
|
|
449
|
+
| `AIPromptTestHarnessComponent` | Template variable testing for AI prompts |
|
|
450
|
+
| `AIAgentTestHarnessDialogComponent` | Modal dialog wrapper for agent testing |
|
|
451
|
+
| `AIPromptTestHarnessDialogComponent` | Modal dialog wrapper for prompt testing |
|
|
452
|
+
| `TestHarnessDialogService` | Centralized service for opening test harness dialogs |
|
|
453
|
+
| `AIAgentFormComponentExtended` | Enhanced AI agent form with integrated test harness |
|
|
454
|
+
|
|
455
|
+
### New Dependencies Added for Test Harness:
|
|
456
|
+
- **Angular DomSanitizer**: Safe HTML rendering for formatted content
|
|
457
|
+
- **RxJS Subjects**: Component lifecycle and event management
|
|
458
|
+
- **LocalStorage**: Conversation persistence across sessions
|
|
459
|
+
- **File API**: Import/export functionality for conversations
|
|
@@ -1,28 +1,188 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import {
|
|
1
|
+
import { OnInit, ViewContainerRef, ElementRef, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
3
|
+
import { ActionEntity, AIAgentEntity, AIAgentLearningCycleEntity, AIAgentNoteEntity, AIAgentRunEntity, AIPromptEntityExtended } from '@memberjunction/core-entities';
|
|
3
4
|
import { AIAgentFormComponent } from '../../generated/Entities/AIAgent/aiagent.form.component';
|
|
5
|
+
import { DialogService } from '@progress/kendo-angular-dialog';
|
|
6
|
+
import { SharedService } from '@memberjunction/ng-shared';
|
|
4
7
|
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* Enhanced AI Agent form component that extends the auto-generated base form
|
|
10
|
+
* with comprehensive agent management capabilities including test harness integration,
|
|
11
|
+
* related entity management, and execution history tracking.
|
|
12
|
+
*
|
|
13
|
+
* ## Key Features:
|
|
14
|
+
* - **Integrated Test Harness**: Built-in access to agent testing capabilities
|
|
15
|
+
* - **Related Entity Management**: Display and manage sub-agents, prompts, and actions
|
|
16
|
+
* - **Execution History**: View recent agent runs with status and timing information
|
|
17
|
+
* - **Rich UI Components**: Enhanced cards, badges, and status indicators
|
|
18
|
+
* - **Navigation Support**: Links to related entities and management functions
|
|
19
|
+
*
|
|
20
|
+
* ## Form Sections:
|
|
21
|
+
* - **Agent Details**: Basic agent configuration and settings
|
|
22
|
+
* - **Sub-Agents**: Hierarchical agent relationships
|
|
23
|
+
* - **Prompts**: Associated prompts with priority ordering
|
|
24
|
+
* - **Actions**: Available actions and configurations
|
|
25
|
+
* - **Execution History**: Recent runs with detailed status information
|
|
26
|
+
*
|
|
27
|
+
* ## Usage:
|
|
28
|
+
* This component is automatically loaded when editing AI Agent entities through
|
|
29
|
+
* the MemberJunction form system. It extends the base generated form with
|
|
30
|
+
* additional functionality while maintaining full compatibility.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```html
|
|
34
|
+
* <!-- Automatically used by form system -->
|
|
35
|
+
* <mj-ai-agent-form [recordId]="agentId"></mj-ai-agent-form>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
5
38
|
export declare class AIAgentFormComponentExtended extends AIAgentFormComponent implements OnInit {
|
|
39
|
+
protected sharedService: SharedService;
|
|
40
|
+
private dialogService;
|
|
41
|
+
private viewContainerRef;
|
|
42
|
+
/** The AI Agent entity being edited */
|
|
6
43
|
record: AIAgentEntity;
|
|
7
|
-
|
|
8
|
-
|
|
44
|
+
/** Whether the test harness is currently visible */
|
|
45
|
+
showTestHarness: boolean;
|
|
46
|
+
/** Number of sub-agents under this agent */
|
|
47
|
+
subAgentCount: number;
|
|
48
|
+
/** Number of prompts associated with this agent */
|
|
49
|
+
promptCount: number;
|
|
50
|
+
/** Number of actions configured for this agent */
|
|
51
|
+
actionCount: number;
|
|
52
|
+
/** Number of learning cycles for this agent */
|
|
53
|
+
learningCycleCount: number;
|
|
54
|
+
/** Number of notes associated with this agent */
|
|
55
|
+
noteCount: number;
|
|
56
|
+
/** Number of execution history records */
|
|
57
|
+
executionHistoryCount: number;
|
|
58
|
+
/** Array of sub-agent entities for card display */
|
|
59
|
+
subAgents: AIAgentEntity[];
|
|
60
|
+
/** Array of agent prompt entities for card display */
|
|
61
|
+
agentPrompts: AIPromptEntityExtended[];
|
|
62
|
+
/** Array of agent action entities for card display */
|
|
63
|
+
agentActions: ActionEntity[];
|
|
64
|
+
/** Array of learning cycle entities for display */
|
|
65
|
+
learningCycles: AIAgentLearningCycleEntity[];
|
|
66
|
+
/** Array of agent note entities for display */
|
|
67
|
+
agentNotes: AIAgentNoteEntity[];
|
|
68
|
+
/** Array of recent execution records for history display */
|
|
69
|
+
recentExecutions: AIAgentRunEntity[];
|
|
70
|
+
constructor(elementRef: ElementRef, sharedService: SharedService, router: Router, route: ActivatedRoute, cdr: ChangeDetectorRef, dialogService: DialogService, viewContainerRef: ViewContainerRef);
|
|
71
|
+
/**
|
|
72
|
+
* Component initialization. Calls parent initialization and loads related entity data
|
|
73
|
+
* if an agent record is already available.
|
|
74
|
+
*/
|
|
9
75
|
ngOnInit(): Promise<void>;
|
|
10
76
|
/**
|
|
11
|
-
*
|
|
77
|
+
* Loads counts and preview data for all related entities including sub-agents,
|
|
78
|
+
* prompts, actions, learning cycles, notes, and execution history.
|
|
79
|
+
* This data populates the various expander panels in the enhanced form interface.
|
|
80
|
+
* @private
|
|
12
81
|
*/
|
|
13
|
-
|
|
82
|
+
private loadRelatedCounts;
|
|
14
83
|
/**
|
|
15
|
-
*
|
|
84
|
+
* Opens the integrated test harness for the current agent.
|
|
85
|
+
* Validates that the agent has been saved before allowing testing.
|
|
86
|
+
* Shows a notification if the agent needs to be saved first.
|
|
16
87
|
*/
|
|
17
|
-
|
|
88
|
+
openTestHarness(): void;
|
|
18
89
|
/**
|
|
19
|
-
*
|
|
90
|
+
* Returns the appropriate color for the agent status badge.
|
|
91
|
+
* Uses standard color coding: green for active, yellow for pending, gray for disabled.
|
|
92
|
+
* @returns CSS color value for the status badge
|
|
20
93
|
*/
|
|
21
94
|
getStatusBadgeColor(): string;
|
|
22
95
|
/**
|
|
23
|
-
*
|
|
96
|
+
* Event handler for test harness visibility changes.
|
|
97
|
+
* Updates the component state when the test harness is opened or closed.
|
|
98
|
+
* @param isVisible - Whether the test harness is currently visible
|
|
99
|
+
*/
|
|
100
|
+
onTestHarnessVisibilityChanged(isVisible: boolean): void;
|
|
101
|
+
/**
|
|
102
|
+
* Gets the count of sub-agents
|
|
103
|
+
*/
|
|
104
|
+
getSubAgentCount(): number;
|
|
105
|
+
/**
|
|
106
|
+
* Gets the count of prompts
|
|
107
|
+
*/
|
|
108
|
+
getPromptCount(): number;
|
|
109
|
+
/**
|
|
110
|
+
* Gets the count of actions
|
|
111
|
+
*/
|
|
112
|
+
getActionCount(): number;
|
|
113
|
+
/**
|
|
114
|
+
* Gets the icon for the execution mode
|
|
115
|
+
*/
|
|
116
|
+
getExecutionModeIcon(mode: string): string;
|
|
117
|
+
/**
|
|
118
|
+
* Creates a new sub-agent
|
|
119
|
+
*/
|
|
120
|
+
createSubAgent(): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Adds a new prompt to the agent
|
|
123
|
+
*/
|
|
124
|
+
addPrompt(): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Opens the action configuration dialog
|
|
127
|
+
*/
|
|
128
|
+
configureActions(): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Gets the status icon for execution runs
|
|
131
|
+
*/
|
|
132
|
+
getExecutionStatusIcon(status: string): string;
|
|
133
|
+
/**
|
|
134
|
+
* Gets the status color for execution runs
|
|
135
|
+
*/
|
|
136
|
+
getExecutionStatusColor(status: string): string;
|
|
137
|
+
formatExecutionTimeFromDates(startDate: Date, endDate: Date): string;
|
|
138
|
+
/**
|
|
139
|
+
* Formats execution time
|
|
140
|
+
*/
|
|
141
|
+
formatExecutionTime(milliseconds: number): string;
|
|
142
|
+
/**
|
|
143
|
+
* Gets the priority badge color
|
|
144
|
+
*/
|
|
145
|
+
getPriorityBadgeColor(priority: number): string;
|
|
146
|
+
/**
|
|
147
|
+
* Gets the priority label
|
|
148
|
+
*/
|
|
149
|
+
getPriorityLabel(priority: number): string;
|
|
150
|
+
/**
|
|
151
|
+
* Navigates to a related entity
|
|
152
|
+
*/
|
|
153
|
+
navigateToEntity(entityName: string, recordId: string): void;
|
|
154
|
+
/**
|
|
155
|
+
* Refreshes the related data
|
|
156
|
+
*/
|
|
157
|
+
refreshRelatedData(): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Adds a new note to the agent
|
|
160
|
+
*/
|
|
161
|
+
addNote(): void;
|
|
162
|
+
/**
|
|
163
|
+
* Links an existing prompt to the agent
|
|
164
|
+
*/
|
|
165
|
+
private linkPromptToAgent;
|
|
166
|
+
/**
|
|
167
|
+
* Creates a new prompt and links it to the agent
|
|
168
|
+
*/
|
|
169
|
+
private createNewPrompt;
|
|
170
|
+
/**
|
|
171
|
+
* Links an existing action to the agent
|
|
172
|
+
*/
|
|
173
|
+
private linkActionToAgent;
|
|
174
|
+
/**
|
|
175
|
+
* Creates a new action and links it to the agent
|
|
176
|
+
*/
|
|
177
|
+
private createNewAction;
|
|
178
|
+
/**
|
|
179
|
+
* Removes a prompt from the agent
|
|
180
|
+
*/
|
|
181
|
+
removePrompt(prompt: AIPromptEntityExtended, event: Event): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Removes an action from the agent
|
|
24
184
|
*/
|
|
25
|
-
|
|
185
|
+
removeAction(action: ActionEntity, event: Event): Promise<void>;
|
|
26
186
|
static ɵfac: i0.ɵɵFactoryDeclaration<AIAgentFormComponentExtended, never>;
|
|
27
187
|
static ɵcmp: i0.ɵɵComponentDeclaration<AIAgentFormComponentExtended, "mj-ai-agent-form", never, {}, {}, never, ["*"], false, never>;
|
|
28
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-agent-form.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/AIAgents/ai-agent-form.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ai-agent-form.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/AIAgents/ai-agent-form.component.ts"],"names":[],"mappings":"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"}
|