@memberjunction/ng-ai-test-harness 4.0.0 → 4.2.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 +109 -71
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
# @memberjunction/ng-ai-test-harness
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A comprehensive Angular component for testing AI agents, prompts, and actions in MemberJunction applications. Supports embedded, dialog, and floating window presentation modes with real-time streaming, execution monitoring, and window management.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
The AI Test Harness provides a
|
|
8
|
-
- **Agent Mode**: Test AI agents with conversational inputs
|
|
9
|
-
- **Prompt Mode**: Test AI prompts with user messages
|
|
10
|
-
- **Action Mode**: Test actions with parameter inputs
|
|
7
|
+
The AI Test Harness provides a multi-mode testing interface for MemberJunction's AI capabilities. It supports three testing modes (Agent, Prompt, Action), multiple presentation contexts (embedded component, dialog, floating window), and includes specialized components for monitoring agent execution trees and viewing JSON results.
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
```mermaid
|
|
10
|
+
graph TD
|
|
11
|
+
A[AITestHarnessModule] --> B[Core Components]
|
|
12
|
+
A --> C[Window Components]
|
|
13
|
+
A --> D[Services]
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
B --> B1[AITestHarnessComponent]
|
|
16
|
+
B --> B2[AITestHarnessDialogComponent]
|
|
17
|
+
B --> B3[AgentExecutionMonitorComponent]
|
|
18
|
+
B --> B4[AgentExecutionNodeComponent]
|
|
19
|
+
B --> B5[JsonViewerWindowComponent]
|
|
20
|
+
|
|
21
|
+
C --> C1[AITestHarnessWindowComponent]
|
|
22
|
+
C --> C2[TestHarnessCustomWindowComponent]
|
|
23
|
+
|
|
24
|
+
D --> D1[AITestHarnessDialogService]
|
|
25
|
+
D --> D2[TestHarnessWindowService]
|
|
26
|
+
D --> D3[TestHarnessWindowManagerService]
|
|
27
|
+
D --> D4[WindowDockService]
|
|
28
|
+
|
|
29
|
+
B1 --> E["Testing Modes:
|
|
30
|
+
Agent | Prompt | Action"]
|
|
31
|
+
|
|
32
|
+
style A fill:#2d6a9f,stroke:#1a4971,color:#fff
|
|
33
|
+
style B fill:#7c5295,stroke:#563a6b,color:#fff
|
|
34
|
+
style C fill:#2d8659,stroke:#1a5c3a,color:#fff
|
|
35
|
+
style D fill:#b8762f,stroke:#8a5722,color:#fff
|
|
36
|
+
```
|
|
22
37
|
|
|
23
38
|
## Installation
|
|
24
39
|
|
|
@@ -34,20 +49,15 @@ npm install @memberjunction/ng-ai-test-harness
|
|
|
34
49
|
import { AITestHarnessModule } from '@memberjunction/ng-ai-test-harness';
|
|
35
50
|
|
|
36
51
|
@NgModule({
|
|
37
|
-
imports: [
|
|
38
|
-
AITestHarnessModule,
|
|
39
|
-
// ... other imports
|
|
40
|
-
]
|
|
52
|
+
imports: [AITestHarnessModule]
|
|
41
53
|
})
|
|
42
54
|
export class YourModule { }
|
|
43
55
|
```
|
|
44
56
|
|
|
45
|
-
###
|
|
46
|
-
|
|
47
|
-
#### Embedded Mode
|
|
57
|
+
### Embedded Mode
|
|
48
58
|
|
|
49
59
|
```html
|
|
50
|
-
<mj-ai-test-harness
|
|
60
|
+
<mj-ai-test-harness
|
|
51
61
|
[config]="testConfig"
|
|
52
62
|
[embedded]="true"
|
|
53
63
|
(executionComplete)="onTestComplete($event)"
|
|
@@ -64,13 +74,9 @@ testConfig: TestHarnessConfig = {
|
|
|
64
74
|
theme: 'light',
|
|
65
75
|
maxHistoryItems: 10
|
|
66
76
|
};
|
|
67
|
-
|
|
68
|
-
onTestComplete(result: TestExecutionResult) {
|
|
69
|
-
console.log('Test completed:', result);
|
|
70
|
-
}
|
|
71
77
|
```
|
|
72
78
|
|
|
73
|
-
|
|
79
|
+
### Dialog Mode
|
|
74
80
|
|
|
75
81
|
```typescript
|
|
76
82
|
import { AITestHarnessDialogService } from '@memberjunction/ng-ai-test-harness';
|
|
@@ -101,47 +107,61 @@ testAction() {
|
|
|
101
107
|
}
|
|
102
108
|
```
|
|
103
109
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
### TestHarnessConfig
|
|
110
|
+
### Floating Window Mode
|
|
107
111
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
| mode | `'agent' \| 'prompt' \| 'action'` | `'agent'` | Testing mode |
|
|
111
|
-
| entityId | `string` | - | Pre-selected entity ID |
|
|
112
|
-
| showHistory | `boolean` | `true` | Show execution history |
|
|
113
|
-
| showAdvancedOptions | `boolean` | `false` | Show advanced settings |
|
|
114
|
-
| theme | `'light' \| 'dark'` | `'light'` | Visual theme |
|
|
115
|
-
| maxHistoryItems | `number` | `10` | Max history items to display |
|
|
112
|
+
```typescript
|
|
113
|
+
import { TestHarnessWindowService } from '@memberjunction/ng-ai-test-harness';
|
|
116
114
|
|
|
117
|
-
|
|
115
|
+
constructor(private windowService: TestHarnessWindowService) {}
|
|
118
116
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
executionTime?: number;
|
|
125
|
-
tokensUsed?: number;
|
|
126
|
-
cost?: number;
|
|
117
|
+
openInWindow() {
|
|
118
|
+
this.windowService.open({
|
|
119
|
+
mode: 'agent',
|
|
120
|
+
entityId: 'agent-id'
|
|
121
|
+
});
|
|
127
122
|
}
|
|
128
123
|
```
|
|
129
124
|
|
|
130
|
-
|
|
125
|
+
### Agent Execution Monitor
|
|
131
126
|
|
|
132
|
-
|
|
127
|
+
Visualize agent execution as a tree of steps:
|
|
133
128
|
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
});
|
|
129
|
+
```html
|
|
130
|
+
<mj-agent-execution-monitor
|
|
131
|
+
[agentRunId]="runId"
|
|
132
|
+
[autoRefresh]="true">
|
|
133
|
+
</mj-agent-execution-monitor>
|
|
140
134
|
```
|
|
141
135
|
|
|
136
|
+
### JSON Viewer Window
|
|
137
|
+
|
|
138
|
+
Display JSON data in a formatted, scrollable window:
|
|
139
|
+
|
|
140
|
+
```html
|
|
141
|
+
<mj-json-viewer-window
|
|
142
|
+
[data]="jsonData"
|
|
143
|
+
[title]="'Execution Result'">
|
|
144
|
+
</mj-json-viewer-window>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Configuration
|
|
148
|
+
|
|
149
|
+
### TestHarnessConfig
|
|
150
|
+
|
|
151
|
+
| Property | Type | Default | Description |
|
|
152
|
+
|----------|------|---------|-------------|
|
|
153
|
+
| `mode` | `'agent' \| 'prompt' \| 'action'` | `'agent'` | Testing mode |
|
|
154
|
+
| `entityId` | `string` | - | Pre-selected entity ID |
|
|
155
|
+
| `showHistory` | `boolean` | `true` | Show execution history |
|
|
156
|
+
| `showAdvancedOptions` | `boolean` | `false` | Show advanced settings |
|
|
157
|
+
| `theme` | `'light' \| 'dark'` | `'light'` | Visual theme |
|
|
158
|
+
| `maxHistoryItems` | `number` | `10` | Max history items to display |
|
|
159
|
+
|
|
160
|
+
## Advanced Features
|
|
161
|
+
|
|
142
162
|
### Streaming Responses
|
|
143
163
|
|
|
144
|
-
The test harness supports real-time streaming for compatible AI models
|
|
164
|
+
The test harness supports real-time streaming for compatible AI models:
|
|
145
165
|
|
|
146
166
|
```typescript
|
|
147
167
|
this.testHarness.open({
|
|
@@ -152,9 +172,11 @@ this.testHarness.open({
|
|
|
152
172
|
});
|
|
153
173
|
```
|
|
154
174
|
|
|
155
|
-
|
|
175
|
+
### Window Management
|
|
156
176
|
|
|
157
|
-
The
|
|
177
|
+
The `TestHarnessWindowManagerService` coordinates multiple floating test windows with docking support via `WindowDockService`.
|
|
178
|
+
|
|
179
|
+
## CSS Customization
|
|
158
180
|
|
|
159
181
|
```scss
|
|
160
182
|
:root {
|
|
@@ -168,20 +190,36 @@ The component uses CSS custom properties for theming:
|
|
|
168
190
|
|
|
169
191
|
## Dependencies
|
|
170
192
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
-
|
|
193
|
+
| Package | Description |
|
|
194
|
+
|---------|-------------|
|
|
195
|
+
| `@memberjunction/ai` | AI abstraction layer |
|
|
196
|
+
| `@memberjunction/ai-core-plus` | AI core plus functionality |
|
|
197
|
+
| `@memberjunction/ai-engine-base` | AI engine base classes |
|
|
198
|
+
| `@memberjunction/core` | Core framework |
|
|
199
|
+
| `@memberjunction/core-entities` | Entity type definitions |
|
|
200
|
+
| `@memberjunction/global` | Global utilities |
|
|
201
|
+
| `@memberjunction/graphql-dataprovider` | GraphQL data access |
|
|
202
|
+
| `@memberjunction/ng-code-editor` | Code editor component |
|
|
203
|
+
| `@memberjunction/ng-container-directives` | Layout directives |
|
|
204
|
+
| `@memberjunction/ng-notifications` | Notification system |
|
|
205
|
+
| `@memberjunction/ng-shared` | Shared Angular utilities |
|
|
206
|
+
| `@memberjunction/ng-shared-generic` | Shared generic components |
|
|
207
|
+
| `@progress/kendo-angular-*` | Kendo UI components |
|
|
208
|
+
|
|
209
|
+
### Peer Dependencies
|
|
210
|
+
|
|
211
|
+
- `@angular/common` ^21.x
|
|
212
|
+
- `@angular/core` ^21.x
|
|
213
|
+
- `@angular/forms` ^21.x
|
|
214
|
+
- `@angular/animations` ^21.x
|
|
215
|
+
|
|
216
|
+
## Build
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
cd packages/Angular/Generic/ai-test-harness
|
|
220
|
+
npm run build
|
|
221
|
+
```
|
|
176
222
|
|
|
177
223
|
## License
|
|
178
224
|
|
|
179
225
|
ISC
|
|
180
|
-
|
|
181
|
-
## Contributing
|
|
182
|
-
|
|
183
|
-
Contributions are welcome! Please submit pull requests to the MemberJunction repository.
|
|
184
|
-
|
|
185
|
-
## Support
|
|
186
|
-
|
|
187
|
-
For issues and questions, please use the MemberJunction GitHub repository.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-ai-test-harness",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "MemberJunction AI Test Harness - A reusable component for testing AI agents and prompts with beautiful UX",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@angular/platform-browser": "21.1.3",
|
|
35
35
|
"@angular/router": "21.1.3",
|
|
36
|
-
"@memberjunction/ai": "4.
|
|
37
|
-
"@memberjunction/ai-core-plus": "4.
|
|
38
|
-
"@memberjunction/ai-engine-base": "4.
|
|
39
|
-
"@memberjunction/core": "4.
|
|
40
|
-
"@memberjunction/core-entities": "4.
|
|
41
|
-
"@memberjunction/global": "4.
|
|
42
|
-
"@memberjunction/graphql-dataprovider": "4.
|
|
43
|
-
"@memberjunction/ng-code-editor": "4.
|
|
44
|
-
"@memberjunction/ng-container-directives": "4.
|
|
45
|
-
"@memberjunction/ng-notifications": "4.
|
|
46
|
-
"@memberjunction/ng-shared": "4.
|
|
47
|
-
"@memberjunction/ng-shared-generic": "4.
|
|
36
|
+
"@memberjunction/ai": "4.2.0",
|
|
37
|
+
"@memberjunction/ai-core-plus": "4.2.0",
|
|
38
|
+
"@memberjunction/ai-engine-base": "4.2.0",
|
|
39
|
+
"@memberjunction/core": "4.2.0",
|
|
40
|
+
"@memberjunction/core-entities": "4.2.0",
|
|
41
|
+
"@memberjunction/global": "4.2.0",
|
|
42
|
+
"@memberjunction/graphql-dataprovider": "4.2.0",
|
|
43
|
+
"@memberjunction/ng-code-editor": "4.2.0",
|
|
44
|
+
"@memberjunction/ng-container-directives": "4.2.0",
|
|
45
|
+
"@memberjunction/ng-notifications": "4.2.0",
|
|
46
|
+
"@memberjunction/ng-shared": "4.2.0",
|
|
47
|
+
"@memberjunction/ng-shared-generic": "4.2.0",
|
|
48
48
|
"@progress/kendo-angular-buttons": "22.0.1",
|
|
49
49
|
"@progress/kendo-angular-dialog": "22.0.1",
|
|
50
50
|
"@progress/kendo-angular-dropdowns": "22.0.1",
|