@memberjunction/ng-core-entity-forms 2.49.0 → 2.51.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 (97) hide show
  1. package/README.md +215 -1
  2. package/dist/lib/custom/AIAgents/agent-execution-monitor.component.d.ts +244 -0
  3. package/dist/lib/custom/AIAgents/agent-execution-monitor.component.d.ts.map +1 -0
  4. package/dist/lib/custom/AIAgents/agent-execution-monitor.component.js +1314 -0
  5. package/dist/lib/custom/AIAgents/agent-execution-monitor.component.js.map +1 -0
  6. package/dist/lib/custom/AIAgents/agent-execution-node.component.d.ts +19 -0
  7. package/dist/lib/custom/AIAgents/agent-execution-node.component.d.ts.map +1 -0
  8. package/dist/lib/custom/AIAgents/agent-execution-node.component.js +458 -0
  9. package/dist/lib/custom/AIAgents/agent-execution-node.component.js.map +1 -0
  10. package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts +171 -11
  11. package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
  12. package/dist/lib/custom/AIAgents/ai-agent-form.component.js +1411 -145
  13. package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
  14. package/dist/lib/custom/AIAgents/ai-test-harness-dialog.component.d.ts +78 -0
  15. package/dist/lib/custom/AIAgents/ai-test-harness-dialog.component.d.ts.map +1 -0
  16. package/dist/lib/custom/AIAgents/ai-test-harness-dialog.component.js +157 -0
  17. package/dist/lib/custom/AIAgents/ai-test-harness-dialog.component.js.map +1 -0
  18. package/dist/lib/custom/AIAgents/ai-test-harness.component.d.ts +508 -0
  19. package/dist/lib/custom/AIAgents/ai-test-harness.component.d.ts.map +1 -0
  20. package/dist/lib/custom/AIAgents/ai-test-harness.component.js +2658 -0
  21. package/dist/lib/custom/AIAgents/ai-test-harness.component.js.map +1 -0
  22. package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts +40 -0
  23. package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts.map +1 -0
  24. package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js +965 -0
  25. package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js.map +1 -0
  26. package/dist/lib/custom/AIPrompts/ai-prompt-execution-dialog.component.d.ts +5 -0
  27. package/dist/lib/custom/AIPrompts/ai-prompt-execution-dialog.component.d.ts.map +1 -1
  28. package/dist/lib/custom/AIPrompts/ai-prompt-execution-dialog.component.js +137 -99
  29. package/dist/lib/custom/AIPrompts/ai-prompt-execution-dialog.component.js.map +1 -1
  30. package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts +80 -4
  31. package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts.map +1 -1
  32. package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js +956 -470
  33. package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js.map +1 -1
  34. package/dist/lib/custom/Actions/action-execution-log-form.component.d.ts +40 -0
  35. package/dist/lib/custom/Actions/action-execution-log-form.component.d.ts.map +1 -0
  36. package/dist/lib/custom/Actions/action-execution-log-form.component.js +530 -0
  37. package/dist/lib/custom/Actions/action-execution-log-form.component.js.map +1 -0
  38. package/dist/lib/custom/Actions/action-form.component.d.ts +90 -0
  39. package/dist/lib/custom/Actions/action-form.component.d.ts.map +1 -0
  40. package/dist/lib/custom/Actions/action-form.component.js +1579 -0
  41. package/dist/lib/custom/Actions/action-form.component.js.map +1 -0
  42. package/dist/lib/custom/Actions/action-param-dialog.component.d.ts +32 -0
  43. package/dist/lib/custom/Actions/action-param-dialog.component.d.ts.map +1 -0
  44. package/dist/lib/custom/Actions/action-param-dialog.component.js +320 -0
  45. package/dist/lib/custom/Actions/action-param-dialog.component.js.map +1 -0
  46. package/dist/lib/custom/Actions/action-test-harness-dialog.component.d.ts +15 -0
  47. package/dist/lib/custom/Actions/action-test-harness-dialog.component.d.ts.map +1 -0
  48. package/dist/lib/custom/Actions/action-test-harness-dialog.component.js +96 -0
  49. package/dist/lib/custom/Actions/action-test-harness-dialog.component.js.map +1 -0
  50. package/dist/lib/custom/Actions/action-test-harness.component.d.ts +50 -0
  51. package/dist/lib/custom/Actions/action-test-harness.component.d.ts.map +1 -0
  52. package/dist/lib/custom/Actions/action-test-harness.component.js +708 -0
  53. package/dist/lib/custom/Actions/action-test-harness.component.js.map +1 -0
  54. package/dist/lib/custom/custom-forms.module.d.ts +31 -19
  55. package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
  56. package/dist/lib/custom/custom-forms.module.js +94 -15
  57. package/dist/lib/custom/custom-forms.module.js.map +1 -1
  58. package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts +35 -0
  59. package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts.map +1 -0
  60. package/dist/lib/custom/shared/entity-selector-dialog.component.js +290 -0
  61. package/dist/lib/custom/shared/entity-selector-dialog.component.js.map +1 -0
  62. package/dist/lib/custom/test-harness-dialog.service.d.ts +111 -0
  63. package/dist/lib/custom/test-harness-dialog.service.d.ts.map +1 -0
  64. package/dist/lib/custom/test-harness-dialog.service.js +211 -0
  65. package/dist/lib/custom/test-harness-dialog.service.js.map +1 -0
  66. package/dist/lib/generated/Entities/AIAgent/aiagent.form.component.js +12 -11
  67. package/dist/lib/generated/Entities/AIAgent/aiagent.form.component.js.map +1 -1
  68. package/dist/lib/generated/Entities/AIAgent/sections/aiagent-form-overview.component.d.ts +54 -0
  69. package/dist/lib/generated/Entities/AIAgent/sections/aiagent-form-overview.component.d.ts.map +1 -0
  70. package/dist/lib/generated/Entities/AIAgent/sections/aiagent-form-overview.component.js +492 -0
  71. package/dist/lib/generated/Entities/AIAgent/sections/aiagent-form-overview.component.js.map +1 -0
  72. package/dist/lib/generated/Entities/AIAgentRun/aiagentrun.form.component.js +8 -7
  73. package/dist/lib/generated/Entities/AIAgentRun/aiagentrun.form.component.js.map +1 -1
  74. package/dist/lib/generated/Entities/AIConfiguration/aiconfiguration.form.component.js +8 -7
  75. package/dist/lib/generated/Entities/AIConfiguration/aiconfiguration.form.component.js.map +1 -1
  76. package/dist/lib/generated/Entities/AIModel/aimodel.form.component.js +8 -7
  77. package/dist/lib/generated/Entities/AIModel/aimodel.form.component.js.map +1 -1
  78. package/dist/lib/generated/Entities/AIModelType/aimodeltype.form.component.js +12 -11
  79. package/dist/lib/generated/Entities/AIModelType/aimodeltype.form.component.js.map +1 -1
  80. package/dist/lib/generated/Entities/AIPrompt/aiprompt.form.component.js +12 -11
  81. package/dist/lib/generated/Entities/AIPrompt/aiprompt.form.component.js.map +1 -1
  82. package/dist/lib/generated/Entities/AIPromptRun/aipromptrun.form.component.js +12 -11
  83. package/dist/lib/generated/Entities/AIPromptRun/aipromptrun.form.component.js.map +1 -1
  84. package/dist/lib/generated/Entities/AIVendor/aivendor.form.component.js +12 -11
  85. package/dist/lib/generated/Entities/AIVendor/aivendor.form.component.js.map +1 -1
  86. package/dist/lib/generated/Entities/ActionExecutionLog/sections/details.component.d.ts.map +1 -1
  87. package/dist/lib/generated/Entities/ActionExecutionLog/sections/details.component.js +13 -4
  88. package/dist/lib/generated/Entities/ActionExecutionLog/sections/details.component.js.map +1 -1
  89. package/dist/public-api.d.ts +3 -0
  90. package/dist/public-api.d.ts.map +1 -1
  91. package/dist/public-api.js +16 -0
  92. package/dist/public-api.js.map +1 -1
  93. package/package.json +12 -11
  94. package/dist/lib/custom/AIAgents/ai-agent-execution-dialog.component.d.ts +0 -52
  95. package/dist/lib/custom/AIAgents/ai-agent-execution-dialog.component.d.ts.map +0 -1
  96. package/dist/lib/custom/AIAgents/ai-agent-execution-dialog.component.js +0 -590
  97. package/dist/lib/custom/AIAgents/ai-agent-execution-dialog.component.js.map +0 -1
@@ -0,0 +1,290 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import { RunView } from '@memberjunction/core';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@memberjunction/ng-shared";
5
+ import * as i2 from "@progress/kendo-angular-dialog";
6
+ import * as i3 from "@angular/common";
7
+ import * as i4 from "@angular/forms";
8
+ import * as i5 from "@progress/kendo-angular-inputs";
9
+ import * as i6 from "@progress/kendo-angular-buttons";
10
+ const _forTrack0 = ($index, $item) => $item.ID;
11
+ function EntitySelectorDialogComponent_i_3_Template(rf, ctx) { if (rf & 1) {
12
+ i0.ɵɵelement(0, "i");
13
+ } if (rf & 2) {
14
+ const ctx_r0 = i0.ɵɵnextContext();
15
+ i0.ɵɵclassMap(ctx_r0.config.icon);
16
+ } }
17
+ function EntitySelectorDialogComponent_ng_template_8_Template(rf, ctx) { if (rf & 1) {
18
+ i0.ɵɵelement(0, "i", 14);
19
+ } }
20
+ function EntitySelectorDialogComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
21
+ i0.ɵɵelementStart(0, "div", 7);
22
+ i0.ɵɵelement(1, "i", 15);
23
+ i0.ɵɵelementStart(2, "p");
24
+ i0.ɵɵtext(3);
25
+ i0.ɵɵelementEnd()();
26
+ } if (rf & 2) {
27
+ const ctx_r0 = i0.ɵɵnextContext();
28
+ i0.ɵɵadvance(3);
29
+ i0.ɵɵtextInterpolate1("Loading ", ctx_r0.config.entityName, "...");
30
+ } }
31
+ function EntitySelectorDialogComponent_Conditional_10_Conditional_1_Template(rf, ctx) { if (rf & 1) {
32
+ i0.ɵɵelementStart(0, "div", 16);
33
+ i0.ɵɵelement(1, "i", 18);
34
+ i0.ɵɵelementStart(2, "p");
35
+ i0.ɵɵtext(3);
36
+ i0.ɵɵelementEnd()();
37
+ } if (rf & 2) {
38
+ const ctx_r0 = i0.ɵɵnextContext(2);
39
+ i0.ɵɵadvance(3);
40
+ i0.ɵɵtextInterpolate1("No ", ctx_r0.config.entityName, " found");
41
+ } }
42
+ function EntitySelectorDialogComponent_Conditional_10_Conditional_2_For_2_Conditional_6_Template(rf, ctx) { if (rf & 1) {
43
+ i0.ɵɵelementStart(0, "div", 24);
44
+ i0.ɵɵtext(1);
45
+ i0.ɵɵelementEnd();
46
+ } if (rf & 2) {
47
+ const entity_r3 = i0.ɵɵnextContext().$implicit;
48
+ const ctx_r0 = i0.ɵɵnextContext(3);
49
+ i0.ɵɵadvance();
50
+ i0.ɵɵtextInterpolate(entity_r3[ctx_r0.config.descriptionField]);
51
+ } }
52
+ function EntitySelectorDialogComponent_Conditional_10_Conditional_2_For_2_Conditional_7_Template(rf, ctx) { if (rf & 1) {
53
+ i0.ɵɵelementStart(0, "div", 25)(1, "span", 26);
54
+ i0.ɵɵtext(2);
55
+ i0.ɵɵelementEnd()();
56
+ } if (rf & 2) {
57
+ const entity_r3 = i0.ɵɵnextContext().$implicit;
58
+ const ctx_r0 = i0.ɵɵnextContext(3);
59
+ i0.ɵɵadvance();
60
+ i0.ɵɵclassProp("active", entity_r3[ctx_r0.config.statusField] === "Active");
61
+ i0.ɵɵadvance();
62
+ i0.ɵɵtextInterpolate1(" ", entity_r3[ctx_r0.config.statusField], " ");
63
+ } }
64
+ function EntitySelectorDialogComponent_Conditional_10_Conditional_2_For_2_Template(rf, ctx) { if (rf & 1) {
65
+ const _r2 = i0.ɵɵgetCurrentView();
66
+ i0.ɵɵelementStart(0, "div", 20);
67
+ i0.ɵɵlistener("click", function EntitySelectorDialogComponent_Conditional_10_Conditional_2_For_2_Template_div_click_0_listener() { const entity_r3 = i0.ɵɵrestoreView(_r2).$implicit; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.selectEntity(entity_r3)); });
68
+ i0.ɵɵelementStart(1, "div", 21);
69
+ i0.ɵɵelement(2, "i");
70
+ i0.ɵɵelementEnd();
71
+ i0.ɵɵelementStart(3, "div", 22)(4, "div", 23);
72
+ i0.ɵɵtext(5);
73
+ i0.ɵɵelementEnd();
74
+ i0.ɵɵtemplate(6, EntitySelectorDialogComponent_Conditional_10_Conditional_2_For_2_Conditional_6_Template, 2, 1, "div", 24)(7, EntitySelectorDialogComponent_Conditional_10_Conditional_2_For_2_Conditional_7_Template, 3, 3, "div", 25);
75
+ i0.ɵɵelementEnd()();
76
+ } if (rf & 2) {
77
+ const entity_r3 = ctx.$implicit;
78
+ const ctx_r0 = i0.ɵɵnextContext(3);
79
+ i0.ɵɵclassProp("selected", (ctx_r0.selectedEntity == null ? null : ctx_r0.selectedEntity.ID) === entity_r3.ID);
80
+ i0.ɵɵadvance(2);
81
+ i0.ɵɵclassMap(ctx_r0.config.icon || "fa-solid fa-file");
82
+ i0.ɵɵadvance(3);
83
+ i0.ɵɵtextInterpolate(entity_r3[ctx_r0.config.displayField] || "Untitled");
84
+ i0.ɵɵadvance();
85
+ i0.ɵɵconditional(ctx_r0.config.descriptionField && entity_r3[ctx_r0.config.descriptionField] ? 6 : -1);
86
+ i0.ɵɵadvance();
87
+ i0.ɵɵconditional(ctx_r0.config.statusField && entity_r3[ctx_r0.config.statusField] ? 7 : -1);
88
+ } }
89
+ function EntitySelectorDialogComponent_Conditional_10_Conditional_2_Template(rf, ctx) { if (rf & 1) {
90
+ i0.ɵɵelementStart(0, "div", 17);
91
+ i0.ɵɵrepeaterCreate(1, EntitySelectorDialogComponent_Conditional_10_Conditional_2_For_2_Template, 8, 7, "div", 19, _forTrack0);
92
+ i0.ɵɵelementEnd();
93
+ } if (rf & 2) {
94
+ const ctx_r0 = i0.ɵɵnextContext(2);
95
+ i0.ɵɵadvance();
96
+ i0.ɵɵrepeater(ctx_r0.filteredEntities);
97
+ } }
98
+ function EntitySelectorDialogComponent_Conditional_10_Template(rf, ctx) { if (rf & 1) {
99
+ i0.ɵɵelementStart(0, "div", 8);
100
+ i0.ɵɵtemplate(1, EntitySelectorDialogComponent_Conditional_10_Conditional_1_Template, 4, 1, "div", 16)(2, EntitySelectorDialogComponent_Conditional_10_Conditional_2_Template, 3, 0, "div", 17);
101
+ i0.ɵɵelementEnd();
102
+ } if (rf & 2) {
103
+ const ctx_r0 = i0.ɵɵnextContext();
104
+ i0.ɵɵadvance();
105
+ i0.ɵɵconditional(ctx_r0.filteredEntities.length === 0 ? 1 : 2);
106
+ } }
107
+ export class EntitySelectorDialogComponent {
108
+ constructor(sharedService, dialogRef) {
109
+ this.sharedService = sharedService;
110
+ this.dialogRef = dialogRef;
111
+ this.entities = [];
112
+ this.filteredEntities = [];
113
+ this.selectedEntity = null;
114
+ this.searchText = '';
115
+ this.isLoading = true;
116
+ }
117
+ async ngOnInit() {
118
+ await this.loadEntities();
119
+ }
120
+ async loadEntities() {
121
+ this.isLoading = true;
122
+ try {
123
+ const rv = new RunView();
124
+ const result = await rv.RunView({
125
+ EntityName: this.config.entityName,
126
+ ExtraFilter: this.config.filters,
127
+ OrderBy: this.config.orderBy,
128
+ ResultType: 'simple'
129
+ });
130
+ this.entities = result.Results;
131
+ this.filteredEntities = [...this.entities];
132
+ }
133
+ catch (error) {
134
+ console.error('Error loading entities:', error);
135
+ this.entities = [];
136
+ this.filteredEntities = [];
137
+ }
138
+ finally {
139
+ this.isLoading = false;
140
+ }
141
+ }
142
+ onSearchChange() {
143
+ if (!this.searchText) {
144
+ this.filteredEntities = [...this.entities];
145
+ }
146
+ else {
147
+ const searchLower = this.searchText.toLowerCase();
148
+ this.filteredEntities = this.entities.filter(entity => {
149
+ const displayValue = entity[this.config.displayField] || '';
150
+ const descriptionValue = this.config.descriptionField ? (entity[this.config.descriptionField] || '') : '';
151
+ return displayValue.toLowerCase().includes(searchLower) ||
152
+ descriptionValue.toLowerCase().includes(searchLower);
153
+ });
154
+ }
155
+ }
156
+ selectEntity(entity) {
157
+ this.selectedEntity = entity;
158
+ }
159
+ onSelect() {
160
+ if (this.selectedEntity) {
161
+ this.dialogRef.close({ entity: this.selectedEntity });
162
+ }
163
+ }
164
+ createNew() {
165
+ this.dialogRef.close({ createNew: true });
166
+ }
167
+ onCancel() {
168
+ this.dialogRef.close(null);
169
+ }
170
+ static { this.ɵfac = function EntitySelectorDialogComponent_Factory(t) { return new (t || EntitySelectorDialogComponent)(i0.ɵɵdirectiveInject(i1.SharedService), i0.ɵɵdirectiveInject(i2.DialogRef)); }; }
171
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EntitySelectorDialogComponent, selectors: [["mj-entity-selector-dialog"]], inputs: { config: "config" }, decls: 19, vars: 6, consts: [[1, "dialog-wrapper"], [1, "dialog-header"], [3, "class", 4, "ngIf"], [1, "dialog-content"], [1, "search-bar"], ["placeholder", "Search...", 1, "search-input", 3, "ngModelChange", "valueChange", "ngModel"], ["kendoTextBoxPrefixTemplate", ""], [1, "loading-state"], [1, "entity-list-container"], [1, "dialog-actions"], ["themeColor", "primary", 3, "click"], [1, "fa-solid", "fa-plus"], [3, "click"], ["themeColor", "primary", 3, "click", "disabled"], [1, "fa-solid", "fa-search"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "empty-state"], [1, "entity-list"], [1, "fa-solid", "fa-inbox"], [1, "entity-item", 3, "selected"], [1, "entity-item", 3, "click"], [1, "item-icon"], [1, "item-content"], [1, "item-title"], [1, "item-description"], [1, "item-status"], [1, "status-badge"]], template: function EntitySelectorDialogComponent_Template(rf, ctx) { if (rf & 1) {
172
+ i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h3");
173
+ i0.ɵɵtemplate(3, EntitySelectorDialogComponent_i_3_Template, 1, 2, "i", 2);
174
+ i0.ɵɵtext(4);
175
+ i0.ɵɵelementEnd()();
176
+ i0.ɵɵelementStart(5, "div", 3)(6, "div", 4)(7, "kendo-textbox", 5);
177
+ i0.ɵɵtwoWayListener("ngModelChange", function EntitySelectorDialogComponent_Template_kendo_textbox_ngModelChange_7_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.searchText, $event) || (ctx.searchText = $event); return $event; });
178
+ i0.ɵɵlistener("valueChange", function EntitySelectorDialogComponent_Template_kendo_textbox_valueChange_7_listener() { return ctx.onSearchChange(); });
179
+ i0.ɵɵtemplate(8, EntitySelectorDialogComponent_ng_template_8_Template, 1, 0, "ng-template", 6);
180
+ i0.ɵɵelementEnd()();
181
+ i0.ɵɵtemplate(9, EntitySelectorDialogComponent_Conditional_9_Template, 4, 1, "div", 7)(10, EntitySelectorDialogComponent_Conditional_10_Template, 3, 1, "div", 8);
182
+ i0.ɵɵelementEnd();
183
+ i0.ɵɵelementStart(11, "div", 9)(12, "kendo-button", 10);
184
+ i0.ɵɵlistener("click", function EntitySelectorDialogComponent_Template_kendo_button_click_12_listener() { return ctx.createNew(); });
185
+ i0.ɵɵelement(13, "i", 11);
186
+ i0.ɵɵtext(14, " Create New ");
187
+ i0.ɵɵelementEnd();
188
+ i0.ɵɵelementStart(15, "kendo-button", 12);
189
+ i0.ɵɵlistener("click", function EntitySelectorDialogComponent_Template_kendo_button_click_15_listener() { return ctx.onCancel(); });
190
+ i0.ɵɵtext(16, "Cancel");
191
+ i0.ɵɵelementEnd();
192
+ i0.ɵɵelementStart(17, "kendo-button", 13);
193
+ i0.ɵɵlistener("click", function EntitySelectorDialogComponent_Template_kendo_button_click_17_listener() { return ctx.onSelect(); });
194
+ i0.ɵɵtext(18, "Select");
195
+ i0.ɵɵelementEnd()()();
196
+ } if (rf & 2) {
197
+ i0.ɵɵadvance(3);
198
+ i0.ɵɵproperty("ngIf", ctx.config.icon);
199
+ i0.ɵɵadvance();
200
+ i0.ɵɵtextInterpolate1(" ", ctx.config.title, "");
201
+ i0.ɵɵadvance(3);
202
+ i0.ɵɵtwoWayProperty("ngModel", ctx.searchText);
203
+ i0.ɵɵadvance(2);
204
+ i0.ɵɵconditional(ctx.isLoading ? 9 : -1);
205
+ i0.ɵɵadvance();
206
+ i0.ɵɵconditional(!ctx.isLoading ? 10 : -1);
207
+ i0.ɵɵadvance(7);
208
+ i0.ɵɵproperty("disabled", !ctx.selectedEntity);
209
+ } }, dependencies: [i3.NgIf, i4.NgControlStatus, i4.NgModel, i5.TextBoxComponent, i5.TextBoxPrefixTemplateDirective, i6.ButtonComponent], styles: [".dialog-wrapper[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 600px;\n width: 800px;\n }\n\n .dialog-header[_ngcontent-%COMP%] {\n padding: 16px;\n border-bottom: 1px solid #e0e6ed;\n }\n\n .dialog-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .dialog-content[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n flex: 1;\n padding: 16px;\n gap: 16px;\n overflow: hidden;\n }\n\n .dialog-actions[_ngcontent-%COMP%] {\n padding: 16px;\n border-top: 1px solid #e0e6ed;\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n }\n\n .search-bar[_ngcontent-%COMP%] {\n display: flex;\n gap: 12px;\n }\n\n .search-input[_ngcontent-%COMP%] {\n flex: 1;\n }\n\n .loading-state[_ngcontent-%COMP%], \n .empty-state[_ngcontent-%COMP%] {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n color: #6c757d;\n gap: 12px;\n }\n\n .loading-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%], \n .empty-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 48px;\n color: #dee2e6;\n }\n\n .entity-list-container[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n border: 1px solid #e0e6ed;\n border-radius: 8px;\n background: #f8f9fa;\n }\n\n .entity-list[_ngcontent-%COMP%] {\n padding: 8px;\n }\n\n .entity-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px;\n margin-bottom: 8px;\n background: white;\n border: 1px solid #e0e6ed;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .entity-item[_ngcontent-%COMP%]:hover {\n border-color: #2196f3;\n box-shadow: 0 2px 8px rgba(0,0,0,0.08);\n }\n\n .entity-item.selected[_ngcontent-%COMP%] {\n background: #e3f2fd;\n border-color: #2196f3;\n }\n\n .item-icon[_ngcontent-%COMP%] {\n width: 36px;\n height: 36px;\n background: #f0f4f8;\n border-radius: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .item-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: #2196f3;\n font-size: 16px;\n }\n\n .item-content[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n }\n\n .item-title[_ngcontent-%COMP%] {\n font-weight: 600;\n color: #2c3e50;\n margin-bottom: 4px;\n }\n\n .item-description[_ngcontent-%COMP%] {\n font-size: 13px;\n color: #6c757d;\n line-height: 1.4;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .item-status[_ngcontent-%COMP%] {\n margin-top: 4px;\n }\n\n .status-badge[_ngcontent-%COMP%] {\n font-size: 11px;\n padding: 2px 8px;\n border-radius: 12px;\n background: #e9ecef;\n color: #495057;\n font-weight: 500;\n }\n\n .status-badge.active[_ngcontent-%COMP%] {\n background: #d4edda;\n color: #28a745;\n }"] }); }
210
+ }
211
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EntitySelectorDialogComponent, [{
212
+ type: Component,
213
+ args: [{ selector: 'mj-entity-selector-dialog', template: `
214
+ <div class="dialog-wrapper">
215
+ <div class="dialog-header">
216
+ <h3><i *ngIf="config.icon" [class]="config.icon"></i> {{ config.title }}</h3>
217
+ </div>
218
+ <div class="dialog-content">
219
+ <!-- Search Bar -->
220
+ <div class="search-bar">
221
+ <kendo-textbox
222
+ [(ngModel)]="searchText"
223
+ placeholder="Search..."
224
+ (valueChange)="onSearchChange()"
225
+ class="search-input">
226
+ <ng-template kendoTextBoxPrefixTemplate>
227
+ <i class="fa-solid fa-search"></i>
228
+ </ng-template>
229
+ </kendo-textbox>
230
+ </div>
231
+
232
+ <!-- Loading State -->
233
+ @if (isLoading) {
234
+ <div class="loading-state">
235
+ <i class="fa-solid fa-spinner fa-spin"></i>
236
+ <p>Loading {{ config.entityName }}...</p>
237
+ </div>
238
+ }
239
+
240
+ <!-- Entity List -->
241
+ @if (!isLoading) {
242
+ <div class="entity-list-container">
243
+ @if (filteredEntities.length === 0) {
244
+ <div class="empty-state">
245
+ <i class="fa-solid fa-inbox"></i>
246
+ <p>No {{ config.entityName }} found</p>
247
+ </div>
248
+ } @else {
249
+ <div class="entity-list">
250
+ @for (entity of filteredEntities; track entity.ID) {
251
+ <div class="entity-item"
252
+ [class.selected]="selectedEntity?.ID === entity.ID"
253
+ (click)="selectEntity(entity)">
254
+ <div class="item-icon">
255
+ <i [class]="config.icon || 'fa-solid fa-file'"></i>
256
+ </div>
257
+ <div class="item-content">
258
+ <div class="item-title">{{ entity[config.displayField] || 'Untitled' }}</div>
259
+ @if (config.descriptionField && entity[config.descriptionField]) {
260
+ <div class="item-description">{{ entity[config.descriptionField] }}</div>
261
+ }
262
+ @if (config.statusField && entity[config.statusField]) {
263
+ <div class="item-status">
264
+ <span class="status-badge" [class.active]="entity[config.statusField] === 'Active'">
265
+ {{ entity[config.statusField] }}
266
+ </span>
267
+ </div>
268
+ }
269
+ </div>
270
+ </div>
271
+ }
272
+ </div>
273
+ }
274
+ </div>
275
+ }
276
+ </div>
277
+ <div class="dialog-actions">
278
+ <kendo-button themeColor="primary" (click)="createNew()">
279
+ <i class="fa-solid fa-plus"></i> Create New
280
+ </kendo-button>
281
+ <kendo-button (click)="onCancel()">Cancel</kendo-button>
282
+ <kendo-button themeColor="primary" [disabled]="!selectedEntity" (click)="onSelect()">Select</kendo-button>
283
+ </div>
284
+ </div>
285
+ `, styles: ["\n .dialog-wrapper {\n display: flex;\n flex-direction: column;\n height: 600px;\n width: 800px;\n }\n\n .dialog-header {\n padding: 16px;\n border-bottom: 1px solid #e0e6ed;\n }\n\n .dialog-header h3 {\n margin: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .dialog-content {\n display: flex;\n flex-direction: column;\n flex: 1;\n padding: 16px;\n gap: 16px;\n overflow: hidden;\n }\n\n .dialog-actions {\n padding: 16px;\n border-top: 1px solid #e0e6ed;\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n }\n\n .search-bar {\n display: flex;\n gap: 12px;\n }\n\n .search-input {\n flex: 1;\n }\n\n .loading-state,\n .empty-state {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n color: #6c757d;\n gap: 12px;\n }\n\n .loading-state i,\n .empty-state i {\n font-size: 48px;\n color: #dee2e6;\n }\n\n .entity-list-container {\n flex: 1;\n overflow-y: auto;\n border: 1px solid #e0e6ed;\n border-radius: 8px;\n background: #f8f9fa;\n }\n\n .entity-list {\n padding: 8px;\n }\n\n .entity-item {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px;\n margin-bottom: 8px;\n background: white;\n border: 1px solid #e0e6ed;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .entity-item:hover {\n border-color: #2196f3;\n box-shadow: 0 2px 8px rgba(0,0,0,0.08);\n }\n\n .entity-item.selected {\n background: #e3f2fd;\n border-color: #2196f3;\n }\n\n .item-icon {\n width: 36px;\n height: 36px;\n background: #f0f4f8;\n border-radius: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .item-icon i {\n color: #2196f3;\n font-size: 16px;\n }\n\n .item-content {\n flex: 1;\n min-width: 0;\n }\n\n .item-title {\n font-weight: 600;\n color: #2c3e50;\n margin-bottom: 4px;\n }\n\n .item-description {\n font-size: 13px;\n color: #6c757d;\n line-height: 1.4;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .item-status {\n margin-top: 4px;\n }\n\n .status-badge {\n font-size: 11px;\n padding: 2px 8px;\n border-radius: 12px;\n background: #e9ecef;\n color: #495057;\n font-weight: 500;\n }\n\n .status-badge.active {\n background: #d4edda;\n color: #28a745;\n }\n "] }]
286
+ }], () => [{ type: i1.SharedService }, { type: i2.DialogRef }], { config: [{
287
+ type: Input
288
+ }] }); })();
289
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EntitySelectorDialogComponent, { className: "EntitySelectorDialogComponent", filePath: "src/lib/custom/shared/entity-selector-dialog.component.ts", lineNumber: 246 }); })();
290
+ //# sourceMappingURL=entity-selector-dialog.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-selector-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/shared/entity-selector-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;;;;;;;IAmB3B,oBAAiD;;;IAA1B,iCAAqB;;;IAWpC,wBAAkC;;;IAO1C,8BAA2B;IACvB,wBAA2C;IAC3C,yBAAG;IAAA,YAAkC;IACzC,AADyC,iBAAI,EACvC;;;IADC,eAAkC;IAAlC,kEAAkC;;;IAQjC,+BAAyB;IACrB,wBAAiC;IACjC,yBAAG;IAAA,YAAgC;IACvC,AADuC,iBAAI,EACrC;;;IADC,eAAgC;IAAhC,gEAAgC;;;IAcnB,+BAA8B;IAAA,YAAqC;IAAA,iBAAM;;;;IAA3C,cAAqC;IAArC,+DAAqC;;;IAI/D,AADJ,+BAAyB,eAC+D;IAChF,YACJ;IACJ,AADI,iBAAO,EACL;;;;IAHyB,cAAwD;IAAxD,2EAAwD;IAC/E,cACJ;IADI,qEACJ;;;;IAfhB,+BAEoC;IAA/B,gPAAS,8BAAoB,KAAC;IAC/B,+BAAuB;IACnB,oBAAmD;IACvD,iBAAM;IAEF,AADJ,+BAA0B,cACE;IAAA,YAA+C;IAAA,iBAAM;IAI7E,AAHA,0HAAkE,6GAGV;IAQhE,AADI,iBAAM,EACJ;;;;IAlBD,8GAAmD;IAG7C,eAA2C;IAA3C,uDAA2C;IAGtB,eAA+C;IAA/C,yEAA+C;IACvE,cAEC;IAFD,sGAEC;IACD,cAMC;IAND,4FAMC;;;IAnBjB,+BAAyB;IACrB,8HAqBC;IACL,iBAAM;;;IAtBF,cAqBC;IArBD,sCAqBC;;;IA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AAC;IAC/B,CAAC;8FAtEQ,6BAA6B;oEAA7B,6BAA6B;YAhO1B,AADJ,AADJ,8BAA4B,aACG,SACnB;YAAA,0EAA6C;YAAK,YAAkB;YAC5E,AAD4E,iBAAK,EAC3E;YAIE,AADJ,AAFJ,8BAA4B,aAEA,uBAKK;YAHrB,mOAAwB;YAExB,6HAAe,oBAAgB,IAAC;YAEhC,8FAAwC;YAIhD,AADI,iBAAgB,EACd;YAWN,AARA,sFAAiB,2EAQC;YAmCtB,iBAAM;YAEF,AADJ,+BAA4B,wBACiC;YAAtB,iHAAS,eAAW,IAAC;YACpD,yBAAgC;YAAC,6BACrC;YAAA,iBAAe;YACf,yCAAmC;YAArB,iHAAS,cAAU,IAAC;YAAC,uBAAM;YAAA,iBAAe;YACxD,yCAAqF;YAArB,iHAAS,cAAU,IAAC;YAAC,uBAAM;YAEnG,AADI,AAD+F,iBAAe,EACxG,EACJ;;YApEU,eAAiB;YAAjB,sCAAiB;YAA6B,cAAkB;YAAlB,gDAAkB;YAMhE,eAAwB;YAAxB,8CAAwB;YAWhC,eAKC;YALD,wCAKC;YAGD,cAkCC;YAlCD,0CAkCC;YAOkC,eAA4B;YAA5B,8CAA4B;;;iFA8JlE,6BAA6B;cArOzC,SAAS;2BACI,2BAA2B,YAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwET;sEA4JQ,MAAM;kBAAd,KAAK;;kFADG,6BAA6B"}
@@ -0,0 +1,111 @@
1
+ import { DialogService, DialogRef } from '@progress/kendo-angular-dialog';
2
+ import { AIAgentEntity } from '@memberjunction/core-entities';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Service for managing test harness dialogs for AI Agents and AI Prompts.
6
+ * Provides a centralized way to open test harness dialogs with customizable options
7
+ * including dialog dimensions, initial data, and runtime configuration.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // Open AI Agent test harness
12
+ * const dialogRef = this.testHarnessService.openAgentTestHarness({
13
+ * agentId: 'agent-123',
14
+ * title: 'Test My Agent',
15
+ * initialDataContext: { user: 'john', role: 'admin' }
16
+ * });
17
+ *
18
+ * // Open AI Prompt test harness
19
+ * const dialogRef = this.testHarnessService.openPromptTestHarness({
20
+ * promptId: 'prompt-456',
21
+ * selectedModelId: 'gpt-4',
22
+ * initialTemplateVariables: { name: 'Alice', context: 'demo' }
23
+ * });
24
+ * ```
25
+ */
26
+ export declare class TestHarnessDialogService {
27
+ private dialogService;
28
+ /**
29
+ * Creates a new TestHarnessDialogService instance.
30
+ * @param dialogService - Kendo Angular dialog service for managing dialogs
31
+ */
32
+ constructor(dialogService: DialogService);
33
+ /**
34
+ * Opens the AI Agent Test Harness in a dialog with comprehensive configuration options.
35
+ * Supports both loading by agent ID or passing an existing agent entity.
36
+ *
37
+ * @param options - Configuration options for the dialog
38
+ * @param options.agentId - ID of the AI agent to load (alternative to agent parameter)
39
+ * @param options.agent - Pre-loaded AI agent entity (alternative to agentId parameter)
40
+ * @param options.title - Custom title for the dialog (defaults to agent name)
41
+ * @param options.width - Dialog width (CSS units or viewport percentage, defaults to '90vw')
42
+ * @param options.height - Dialog height (CSS units or viewport percentage, defaults to '90vh')
43
+ * @param options.initialDataContext - Initial data context variables for agent execution
44
+ * @param options.initialTemplateData - Initial template data variables for agent execution
45
+ * @param options.preventClose - Whether to prevent dialog closure (currently unused)
46
+ * @returns Reference to the opened dialog for further control
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * // Load agent by ID with initial context
51
+ * const dialogRef = this.openAgentTestHarness({
52
+ * agentId: 'agent-123',
53
+ * initialDataContext: {
54
+ * userId: 'user-456',
55
+ * department: 'Engineering'
56
+ * },
57
+ * width: '80vw',
58
+ * height: '75vh'
59
+ * });
60
+ *
61
+ * // Use existing agent entity
62
+ * const dialogRef = this.openAgentTestHarness({
63
+ * agent: myAgentEntity,
64
+ * title: 'Custom Test Session'
65
+ * });
66
+ * ```
67
+ */
68
+ openAgentTestHarness(options: {
69
+ agentId?: string;
70
+ agent?: AIAgentEntity;
71
+ title?: string;
72
+ width?: string | number;
73
+ height?: string | number;
74
+ initialDataContext?: Record<string, any>;
75
+ initialTemplateData?: Record<string, any>;
76
+ preventClose?: boolean;
77
+ }): DialogRef;
78
+ /**
79
+ * Convenience method to open an AI Agent Test Harness dialog using only the agent ID.
80
+ * Uses default dialog dimensions and no initial data.
81
+ *
82
+ * @param agentId - ID of the AI agent to test
83
+ * @returns Promise resolving to the dialog reference
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * const dialogRef = await this.testHarnessService.openAgentById('agent-123');
88
+ * ```
89
+ */
90
+ openAgentById(agentId: string): Promise<DialogRef>;
91
+ /**
92
+ * Helper method to convert string dimensions (including viewport units) to pixel numbers.
93
+ * Supports viewport width (vw), viewport height (vh), pixels (px), and plain numbers.
94
+ *
95
+ * @param value - Dimension value as string, number, or undefined
96
+ * @returns Converted pixel value or undefined if conversion fails
97
+ *
98
+ * @private
99
+ * @example
100
+ * ```typescript
101
+ * convertToNumber('90vw') // Returns ~1728 on 1920px screen
102
+ * convertToNumber('500px') // Returns 500
103
+ * convertToNumber(800) // Returns 800
104
+ * convertToNumber('auto') // Returns undefined
105
+ * ```
106
+ */
107
+ private convertToNumber;
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<TestHarnessDialogService, never>;
109
+ static ɵprov: i0.ɵɵInjectableDeclaration<TestHarnessDialogService>;
110
+ }
111
+ //# sourceMappingURL=test-harness-dialog.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-harness-dialog.service.d.ts","sourceRoot":"","sources":["../../../src/lib/custom/test-harness-dialog.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAkB,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAkB,MAAM,+BAA+B,CAAC;;AAK9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAGa,wBAAwB;IAKrB,OAAO,CAAC,aAAa;IAJjC;;;OAGG;gBACiB,aAAa,EAAE,aAAa;IAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,oBAAoB,CAAC,OAAO,EAAE;QAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACzC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;KAC1B,GAAG,SAAS;IA8Eb;;;;;;;;;;;OAWG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IASxD;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,eAAe;yCAtKd,wBAAwB;6CAAxB,wBAAwB;CA6LpC"}
@@ -0,0 +1,211 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { AITestHarnessDialogComponent } from './AIAgents/ai-test-harness-dialog.component';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@progress/kendo-angular-dialog";
5
+ // TODO: Prompt test harness will be added later
6
+ // import { AIPromptTestHarnessDialogComponent, AIPromptTestHarnessDialogData } from './AIPrompts/ai-prompt-test-harness-dialog.component';
7
+ /**
8
+ * Service for managing test harness dialogs for AI Agents and AI Prompts.
9
+ * Provides a centralized way to open test harness dialogs with customizable options
10
+ * including dialog dimensions, initial data, and runtime configuration.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * // Open AI Agent test harness
15
+ * const dialogRef = this.testHarnessService.openAgentTestHarness({
16
+ * agentId: 'agent-123',
17
+ * title: 'Test My Agent',
18
+ * initialDataContext: { user: 'john', role: 'admin' }
19
+ * });
20
+ *
21
+ * // Open AI Prompt test harness
22
+ * const dialogRef = this.testHarnessService.openPromptTestHarness({
23
+ * promptId: 'prompt-456',
24
+ * selectedModelId: 'gpt-4',
25
+ * initialTemplateVariables: { name: 'Alice', context: 'demo' }
26
+ * });
27
+ * ```
28
+ */
29
+ export class TestHarnessDialogService {
30
+ /**
31
+ * Creates a new TestHarnessDialogService instance.
32
+ * @param dialogService - Kendo Angular dialog service for managing dialogs
33
+ */
34
+ constructor(dialogService) {
35
+ this.dialogService = dialogService;
36
+ }
37
+ /**
38
+ * Opens the AI Agent Test Harness in a dialog with comprehensive configuration options.
39
+ * Supports both loading by agent ID or passing an existing agent entity.
40
+ *
41
+ * @param options - Configuration options for the dialog
42
+ * @param options.agentId - ID of the AI agent to load (alternative to agent parameter)
43
+ * @param options.agent - Pre-loaded AI agent entity (alternative to agentId parameter)
44
+ * @param options.title - Custom title for the dialog (defaults to agent name)
45
+ * @param options.width - Dialog width (CSS units or viewport percentage, defaults to '90vw')
46
+ * @param options.height - Dialog height (CSS units or viewport percentage, defaults to '90vh')
47
+ * @param options.initialDataContext - Initial data context variables for agent execution
48
+ * @param options.initialTemplateData - Initial template data variables for agent execution
49
+ * @param options.preventClose - Whether to prevent dialog closure (currently unused)
50
+ * @returns Reference to the opened dialog for further control
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * // Load agent by ID with initial context
55
+ * const dialogRef = this.openAgentTestHarness({
56
+ * agentId: 'agent-123',
57
+ * initialDataContext: {
58
+ * userId: 'user-456',
59
+ * department: 'Engineering'
60
+ * },
61
+ * width: '80vw',
62
+ * height: '75vh'
63
+ * });
64
+ *
65
+ * // Use existing agent entity
66
+ * const dialogRef = this.openAgentTestHarness({
67
+ * agent: myAgentEntity,
68
+ * title: 'Custom Test Session'
69
+ * });
70
+ * ```
71
+ */
72
+ openAgentTestHarness(options) {
73
+ const data = {
74
+ agentId: options.agentId,
75
+ agent: options.agent,
76
+ title: options.title,
77
+ width: options.width || '90vw',
78
+ height: options.height || '90vh',
79
+ initialDataContext: options.initialDataContext,
80
+ initialTemplateData: options.initialTemplateData
81
+ };
82
+ const dialogSettings = {
83
+ title: '',
84
+ content: AITestHarnessDialogComponent,
85
+ width: this.convertToNumber(data.width) || 1200,
86
+ height: this.convertToNumber(data.height) || 800,
87
+ minWidth: 800,
88
+ minHeight: 600,
89
+ autoFocusedElement: 'none',
90
+ cssClass: 'test-harness-dialog-wrapper'
91
+ };
92
+ const dialogRef = this.dialogService.open(dialogSettings);
93
+ // Pass data to the component instance
94
+ const componentInstance = dialogRef.content.instance;
95
+ componentInstance.data = data;
96
+ componentInstance.closeDialog.subscribe(() => {
97
+ dialogRef.close();
98
+ });
99
+ return dialogRef;
100
+ }
101
+ // TODO: Prompt test harness will be added later
102
+ // openPromptTestHarness(options: {
103
+ // promptId?: string;
104
+ // prompt?: AIPromptEntity;
105
+ // title?: string;
106
+ // width?: string | number;
107
+ // height?: string | number;
108
+ // initialTemplateVariables?: Record<string, any>;
109
+ // selectedModelId?: string;
110
+ // preventClose?: boolean;
111
+ // }): DialogRef {
112
+ // const data: AIPromptTestHarnessDialogData = {
113
+ // promptId: options.promptId,
114
+ // prompt: options.prompt,
115
+ // title: options.title,
116
+ // width: options.width || '90vw',
117
+ // height: options.height || '90vh',
118
+ // initialTemplateVariables: options.initialTemplateVariables,
119
+ // selectedModelId: options.selectedModelId
120
+ // };
121
+ //
122
+ // const dialogSettings: DialogSettings = {
123
+ // title: '',
124
+ // content: AIPromptTestHarnessDialogComponent,
125
+ // width: this.convertToNumber(data.width) || 1200,
126
+ // height: this.convertToNumber(data.height) || 800,
127
+ // minWidth: 800,
128
+ // minHeight: 600,
129
+ // autoFocusedElement: 'none',
130
+ // cssClass: 'test-harness-dialog-wrapper'
131
+ // };
132
+ //
133
+ // const dialogRef = this.dialogService.open(dialogSettings);
134
+ //
135
+ // // Pass data to the component instance
136
+ // const componentInstance = dialogRef.content.instance as AIPromptTestHarnessDialogComponent;
137
+ // componentInstance.data = data;
138
+ // componentInstance.closeDialog.subscribe(() => {
139
+ // dialogRef.close();
140
+ // });
141
+ //
142
+ // return dialogRef;
143
+ // }
144
+ /**
145
+ * Convenience method to open an AI Agent Test Harness dialog using only the agent ID.
146
+ * Uses default dialog dimensions and no initial data.
147
+ *
148
+ * @param agentId - ID of the AI agent to test
149
+ * @returns Promise resolving to the dialog reference
150
+ *
151
+ * @example
152
+ * ```typescript
153
+ * const dialogRef = await this.testHarnessService.openAgentById('agent-123');
154
+ * ```
155
+ */
156
+ async openAgentById(agentId) {
157
+ return this.openAgentTestHarness({ agentId });
158
+ }
159
+ // TODO: Prompt test harness will be added later
160
+ // async openPromptById(promptId: string): Promise<DialogRef> {
161
+ // return this.openPromptTestHarness({ promptId });
162
+ // }
163
+ /**
164
+ * Helper method to convert string dimensions (including viewport units) to pixel numbers.
165
+ * Supports viewport width (vw), viewport height (vh), pixels (px), and plain numbers.
166
+ *
167
+ * @param value - Dimension value as string, number, or undefined
168
+ * @returns Converted pixel value or undefined if conversion fails
169
+ *
170
+ * @private
171
+ * @example
172
+ * ```typescript
173
+ * convertToNumber('90vw') // Returns ~1728 on 1920px screen
174
+ * convertToNumber('500px') // Returns 500
175
+ * convertToNumber(800) // Returns 800
176
+ * convertToNumber('auto') // Returns undefined
177
+ * ```
178
+ */
179
+ convertToNumber(value) {
180
+ if (!value)
181
+ return undefined;
182
+ if (typeof value === 'number')
183
+ return value;
184
+ // Handle percentage values
185
+ if (value.endsWith('vw') || value.endsWith('vh')) {
186
+ const percentage = parseFloat(value) / 100;
187
+ if (value.endsWith('vw')) {
188
+ return window.innerWidth * percentage;
189
+ }
190
+ else {
191
+ return window.innerHeight * percentage;
192
+ }
193
+ }
194
+ // Handle pixel values
195
+ if (value.endsWith('px')) {
196
+ return parseFloat(value);
197
+ }
198
+ // Try to parse as number
199
+ const parsed = parseFloat(value);
200
+ return isNaN(parsed) ? undefined : parsed;
201
+ }
202
+ static { this.ɵfac = function TestHarnessDialogService_Factory(t) { return new (t || TestHarnessDialogService)(i0.ɵɵinject(i1.DialogService)); }; }
203
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: TestHarnessDialogService, factory: TestHarnessDialogService.ɵfac, providedIn: 'root' }); }
204
+ }
205
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TestHarnessDialogService, [{
206
+ type: Injectable,
207
+ args: [{
208
+ providedIn: 'root'
209
+ }]
210
+ }], () => [{ type: i1.DialogService }], null); })();
211
+ //# sourceMappingURL=test-harness-dialog.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-harness-dialog.service.js","sourceRoot":"","sources":["../../../src/lib/custom/test-harness-dialog.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,4BAA4B,EAA2B,MAAM,6CAA6C,CAAC;;;AACpH,gDAAgD;AAChD,2IAA2I;AAE3I;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,MAAM,OAAO,wBAAwB;IACjC;;;OAGG;IACH,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,oBAAoB,CAAC,OASpB;QACG,MAAM,IAAI,GAA4B;YAClC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,MAAM;YAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,MAAM;YAChC,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;YAC9C,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;SACnD,CAAC;QAEF,MAAM,cAAc,GAAmB;YACnC,KAAK,EAA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