@memberjunction/ng-core-entity-forms 2.70.0 → 2.71.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 (64) hide show
  1. package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts +65 -0
  2. package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts.map +1 -0
  3. package/dist/lib/custom/AIAgents/add-action-dialog.component.js +578 -0
  4. package/dist/lib/custom/AIAgents/add-action-dialog.component.js.map +1 -0
  5. package/dist/lib/custom/AIAgents/agent-advanced-settings-dialog.component.d.ts +1 -0
  6. package/dist/lib/custom/AIAgents/agent-advanced-settings-dialog.component.d.ts.map +1 -0
  7. package/dist/lib/custom/AIAgents/agent-advanced-settings-dialog.component.js +282 -0
  8. package/dist/lib/custom/AIAgents/agent-advanced-settings-dialog.component.js.map +1 -0
  9. package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts +58 -0
  10. package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts.map +1 -0
  11. package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js +400 -0
  12. package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js.map +1 -0
  13. package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts +119 -23
  14. package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
  15. package/dist/lib/custom/AIAgents/ai-agent-form.component.js +1815 -924
  16. package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
  17. package/dist/lib/custom/AIAgents/ai-agent-management.service.d.ts +159 -0
  18. package/dist/lib/custom/AIAgents/ai-agent-management.service.d.ts.map +1 -0
  19. package/dist/lib/custom/AIAgents/ai-agent-management.service.js +315 -0
  20. package/dist/lib/custom/AIAgents/ai-agent-management.service.js.map +1 -0
  21. package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts +67 -0
  22. package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts.map +1 -0
  23. package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js +463 -0
  24. package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js.map +1 -0
  25. package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts +82 -0
  26. package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts.map +1 -0
  27. package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js +708 -0
  28. package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js.map +1 -0
  29. package/dist/lib/custom/AIAgents/new-agent-dialog.component.js +2 -2
  30. package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts +65 -0
  31. package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts.map +1 -0
  32. package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js +379 -0
  33. package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js.map +1 -0
  34. package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts +58 -0
  35. package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts.map +1 -0
  36. package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js +373 -0
  37. package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js.map +1 -0
  38. package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts +61 -0
  39. package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts.map +1 -0
  40. package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js +459 -0
  41. package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js.map +1 -0
  42. package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts +90 -10
  43. package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts.map +1 -1
  44. package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js +1159 -687
  45. package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js.map +1 -1
  46. package/dist/lib/custom/AIPrompts/ai-prompt-management.service.d.ts +27 -0
  47. package/dist/lib/custom/AIPrompts/ai-prompt-management.service.d.ts.map +1 -0
  48. package/dist/lib/custom/AIPrompts/ai-prompt-management.service.js +88 -0
  49. package/dist/lib/custom/AIPrompts/ai-prompt-management.service.js.map +1 -0
  50. package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts +69 -0
  51. package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts.map +1 -0
  52. package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js +442 -0
  53. package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js.map +1 -0
  54. package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js +2 -2
  55. package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js.map +1 -1
  56. package/dist/lib/custom/custom-forms.module.d.ts +40 -33
  57. package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
  58. package/dist/lib/custom/custom-forms.module.js +26 -2
  59. package/dist/lib/custom/custom-forms.module.js.map +1 -1
  60. package/dist/lib/shared/components/template-editor.component.d.ts +8 -2
  61. package/dist/lib/shared/components/template-editor.component.d.ts.map +1 -1
  62. package/dist/lib/shared/components/template-editor.component.js +58 -23
  63. package/dist/lib/shared/components/template-editor.component.js.map +1 -1
  64. package/package.json +16 -16
@@ -0,0 +1,315 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { AddActionDialogComponent } from './add-action-dialog.component';
4
+ import { PromptSelectorDialogComponent } from './prompt-selector-dialog.component';
5
+ import { AgentPromptAdvancedSettingsDialogComponent } from './agent-prompt-advanced-settings-dialog.component';
6
+ import { SubAgentAdvancedSettingsDialogComponent } from './sub-agent-advanced-settings-dialog.component';
7
+ import { SubAgentSelectorDialogComponent } from './sub-agent-selector-dialog.component';
8
+ import { CreatePromptDialogComponent } from './create-prompt-dialog.component';
9
+ import { CreateSubAgentDialogComponent } from './create-sub-agent-dialog.component';
10
+ import * as i0 from "@angular/core";
11
+ import * as i1 from "@progress/kendo-angular-dialog";
12
+ /**
13
+ * Consolidated service for managing AI Agent operations including:
14
+ * - Adding/removing actions
15
+ * - Advanced settings configuration
16
+ * - Agent creation (future)
17
+ * - Agent editing operations
18
+ *
19
+ * This service centralizes all agent-related dialog and management functionality
20
+ * to provide a consistent interface for both editing existing agents and creating new ones.
21
+ */
22
+ export class AIAgentManagementService {
23
+ constructor(dialogService) {
24
+ this.dialogService = dialogService;
25
+ }
26
+ // === Action Management ===
27
+ /**
28
+ * Opens the Add Action dialog for selecting actions to link to an agent
29
+ *
30
+ * @param config Configuration for the action selection dialog
31
+ * @returns Observable that emits the selected actions when dialog is closed
32
+ */
33
+ openAddActionDialog(config) {
34
+ const dialogRef = this.dialogService.open({
35
+ title: `Add Actions to ${config.agentName}`,
36
+ content: AddActionDialogComponent,
37
+ actions: [], // Component handles actions
38
+ width: 1000,
39
+ height: 700,
40
+ minWidth: 800,
41
+ minHeight: 600,
42
+ preventAction: () => false
43
+ });
44
+ // Pass configuration to the dialog component
45
+ const componentInstance = dialogRef.content.instance;
46
+ componentInstance.agentId = config.agentId;
47
+ componentInstance.agentName = config.agentName;
48
+ componentInstance.existingActionIds = [...config.existingActionIds];
49
+ return componentInstance.result.asObservable();
50
+ }
51
+ // === Prompt Management ===
52
+ /**
53
+ * Opens the prompt selector dialog for selecting general prompts to add to an agent
54
+ *
55
+ * @param config Configuration for the prompt selection dialog
56
+ * @returns Observable that emits the selected prompts when dialog is closed
57
+ */
58
+ openPromptSelectorDialog(config) {
59
+ const selectorConfig = {
60
+ title: config.title || 'Select Prompts',
61
+ multiSelect: config.multiSelect ?? true,
62
+ selectedPromptIds: config.selectedPromptIds || [],
63
+ showCreateNew: config.showCreateNew ?? true,
64
+ extraFilter: config.extraFilter,
65
+ linkedPromptIds: config.linkedPromptIds || []
66
+ };
67
+ const dialogRef = this.dialogService.open({
68
+ title: selectorConfig.title,
69
+ content: PromptSelectorDialogComponent,
70
+ actions: [], // Component handles actions
71
+ width: 900,
72
+ height: 600,
73
+ minWidth: 600,
74
+ minHeight: 400,
75
+ preventAction: () => false
76
+ });
77
+ // Pass configuration to the dialog component
78
+ const componentInstance = dialogRef.content.instance;
79
+ componentInstance.config = selectorConfig;
80
+ return componentInstance.result.asObservable();
81
+ }
82
+ /**
83
+ * Opens the prompt selector for selecting a context compression prompt (single select)
84
+ *
85
+ * @param config Configuration for the context compression prompt selection
86
+ * @returns Observable that emits the selected prompt when dialog is closed
87
+ */
88
+ openContextCompressionPromptSelector(config) {
89
+ return new Observable(observer => {
90
+ this.openPromptSelectorDialog({
91
+ title: 'Select Context Compression Prompt',
92
+ multiSelect: false,
93
+ selectedPromptIds: config.currentPromptId ? [config.currentPromptId] : [],
94
+ showCreateNew: false,
95
+ extraFilter: undefined, // Show all active prompts
96
+ viewContainerRef: config.viewContainerRef
97
+ }).subscribe(result => {
98
+ if (result && result.selectedPrompts.length > 0) {
99
+ observer.next(result.selectedPrompts[0]);
100
+ }
101
+ else {
102
+ observer.next(null);
103
+ }
104
+ observer.complete();
105
+ });
106
+ });
107
+ }
108
+ // === Sub-Agent Management ===
109
+ /**
110
+ * Opens the sub-agent selector dialog for selecting agents to convert to sub-agents
111
+ *
112
+ * @param config Configuration for the sub-agent selection dialog
113
+ * @returns Observable that emits the selected agents when dialog is closed
114
+ */
115
+ openSubAgentSelectorDialog(config) {
116
+ const selectorConfig = {
117
+ title: config.title || 'Add Sub-Agents',
118
+ multiSelect: config.multiSelect ?? true,
119
+ selectedAgentIds: config.selectedAgentIds || [],
120
+ showCreateNew: config.showCreateNew ?? true,
121
+ parentAgentId: config.parentAgentId
122
+ };
123
+ const dialogRef = this.dialogService.open({
124
+ title: selectorConfig.title,
125
+ content: SubAgentSelectorDialogComponent,
126
+ actions: [], // Component handles actions
127
+ width: 1000,
128
+ height: 700,
129
+ minWidth: 800,
130
+ minHeight: 600,
131
+ preventAction: () => false
132
+ });
133
+ // Pass configuration to the dialog component
134
+ const componentInstance = dialogRef.content.instance;
135
+ componentInstance.config = selectorConfig;
136
+ return componentInstance.result.asObservable();
137
+ }
138
+ // === Advanced Settings for Related Entities ===
139
+ /**
140
+ * Opens the advanced settings dialog for an AI Agent Prompt
141
+ *
142
+ * @param config Configuration for the agent prompt advanced settings dialog
143
+ * @returns Observable that emits the form data when dialog is closed, or null if cancelled
144
+ */
145
+ openAgentPromptAdvancedSettingsDialog(config) {
146
+ const dialogRef = this.dialogService.open({
147
+ title: `Advanced Settings - Prompt Configuration`,
148
+ content: AgentPromptAdvancedSettingsDialogComponent,
149
+ actions: [], // Component handles actions
150
+ width: 700,
151
+ height: 600,
152
+ minWidth: 500,
153
+ minHeight: 400,
154
+ preventAction: () => false
155
+ });
156
+ // Pass configuration to the dialog component
157
+ const componentInstance = dialogRef.content.instance;
158
+ componentInstance.agentPrompt = config.agentPrompt;
159
+ componentInstance.allAgentPrompts = config.allAgentPrompts;
160
+ return componentInstance.result.asObservable();
161
+ }
162
+ /**
163
+ * Opens the advanced settings dialog for a Sub-Agent
164
+ *
165
+ * @param config Configuration for the sub-agent advanced settings dialog
166
+ * @returns Observable that emits the form data when dialog is closed, or null if cancelled
167
+ */
168
+ openSubAgentAdvancedSettingsDialog(config) {
169
+ const dialogRef = this.dialogService.open({
170
+ title: `Advanced Settings - ${config.subAgent.Name || 'Sub-Agent'}`,
171
+ content: SubAgentAdvancedSettingsDialogComponent,
172
+ actions: [], // Component handles actions
173
+ width: 700,
174
+ height: 600,
175
+ minWidth: 500,
176
+ minHeight: 400,
177
+ preventAction: () => false
178
+ });
179
+ // Pass configuration to the dialog component
180
+ const componentInstance = dialogRef.content.instance;
181
+ componentInstance.subAgent = config.subAgent;
182
+ componentInstance.allSubAgents = config.allSubAgents;
183
+ return componentInstance.result.asObservable();
184
+ }
185
+ // === Prompt Creation ===
186
+ /**
187
+ * Opens the create prompt dialog for creating new prompts from within the AI Agent form
188
+ * Returns the created entities (not saved to database) for parent to add to PendingRecords
189
+ *
190
+ * @param config Configuration for prompt creation
191
+ * @returns Observable that emits the created prompt and related entities when dialog is closed
192
+ */
193
+ openCreatePromptDialog(config) {
194
+ const createConfig = {
195
+ title: config.title || 'Create New Prompt',
196
+ initialName: config.initialName,
197
+ initialTypeID: config.initialTypeID
198
+ };
199
+ const dialogRef = this.dialogService.open({
200
+ title: createConfig.title,
201
+ content: CreatePromptDialogComponent,
202
+ actions: [], // Component handles actions
203
+ width: 900,
204
+ height: 700,
205
+ minWidth: 700,
206
+ minHeight: 500,
207
+ autoFocusedElement: undefined, // Allows ESC key to work
208
+ preventAction: (action) => {
209
+ // Allow ESC key to close the dialog
210
+ return action === 'close' ? false : false;
211
+ }
212
+ });
213
+ // Pass configuration to the dialog component
214
+ const componentInstance = dialogRef.content.instance;
215
+ componentInstance.config = createConfig;
216
+ return componentInstance.result.asObservable();
217
+ }
218
+ // === Sub-Agent Creation ===
219
+ /**
220
+ * Opens the create sub-agent dialog for creating new sub-agents from within the AI Agent form
221
+ * Returns the created entities (not saved to database) for parent to add to PendingRecords
222
+ *
223
+ * @param config Configuration for sub-agent creation
224
+ * @returns Observable that emits the created sub-agent and related entities when dialog is closed
225
+ */
226
+ openCreateSubAgentDialog(config) {
227
+ const createConfig = {
228
+ title: config.title || 'Create New Sub-Agent',
229
+ initialName: config.initialName,
230
+ initialTypeID: config.initialTypeID,
231
+ parentAgentId: config.parentAgentId,
232
+ parentAgentName: config.parentAgentName
233
+ };
234
+ const dialogRef = this.dialogService.open({
235
+ title: createConfig.title,
236
+ content: CreateSubAgentDialogComponent,
237
+ actions: [], // Component handles actions
238
+ width: 1000,
239
+ height: 800,
240
+ minWidth: 800,
241
+ minHeight: 600,
242
+ autoFocusedElement: undefined, // Allows ESC key to work
243
+ preventAction: (action) => {
244
+ // Allow ESC key to close the dialog
245
+ return action === 'close' ? false : false;
246
+ }
247
+ });
248
+ // Pass configuration to the dialog component
249
+ const componentInstance = dialogRef.content.instance;
250
+ componentInstance.config = createConfig;
251
+ return componentInstance.result.asObservable();
252
+ }
253
+ // === Future: Agent Creation ===
254
+ /**
255
+ * Opens the agent creation dialog (to be implemented)
256
+ * This will reuse existing components and provide a streamlined agent creation experience
257
+ *
258
+ * @param config Configuration for agent creation
259
+ * @returns Observable that emits the created agent when dialog is closed
260
+ */
261
+ openCreateAgentDialog(config) {
262
+ // TODO: Implement agent creation dialog
263
+ // This will reuse the same form components and advanced settings
264
+ // but in a creation context rather than editing context
265
+ throw new Error('Agent creation dialog not yet implemented');
266
+ }
267
+ // === Utility Methods ===
268
+ /**
269
+ * Validates agent configuration and relationships
270
+ * Used by both creation and editing workflows
271
+ */
272
+ validateAgentConfiguration(agent) {
273
+ const errors = [];
274
+ // ParentID vs ExposeAsAction validation
275
+ if (agent.ParentID && agent.ExposeAsAction) {
276
+ errors.push('Agents with a parent cannot be exposed as actions');
277
+ }
278
+ // Context compression validation
279
+ if (agent.EnableContextCompression) {
280
+ if (!agent.ContextCompressionMessageThreshold) {
281
+ errors.push('Context compression requires a message threshold');
282
+ }
283
+ if (!agent.ContextCompressionPromptID) {
284
+ errors.push('Context compression requires a compression prompt');
285
+ }
286
+ if (!agent.ContextCompressionMessageRetentionCount) {
287
+ errors.push('Context compression requires a message retention count');
288
+ }
289
+ }
290
+ return {
291
+ isValid: errors.length === 0,
292
+ errors
293
+ };
294
+ }
295
+ // === Sub-Agent Management ===
296
+ /**
297
+ * Future method for managing sub-agent relationships
298
+ * This will handle ParentID, ExecutionOrder, and ExecutionMode
299
+ * in the context of the parent agent's sub-agents section
300
+ */
301
+ openSubAgentManagementDialog(config) {
302
+ // TODO: Implement sub-agent management dialog
303
+ // This will handle the hierarchy settings that were removed from Advanced Settings
304
+ throw new Error('Sub-agent management dialog not yet implemented');
305
+ }
306
+ static { this.ɵfac = function AIAgentManagementService_Factory(t) { return new (t || AIAgentManagementService)(i0.ɵɵinject(i1.DialogService)); }; }
307
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AIAgentManagementService, factory: AIAgentManagementService.ɵfac, providedIn: 'root' }); }
308
+ }
309
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AIAgentManagementService, [{
310
+ type: Injectable,
311
+ args: [{
312
+ providedIn: 'root'
313
+ }]
314
+ }], () => [{ type: i1.DialogService }], null); })();
315
+ //# sourceMappingURL=ai-agent-management.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-agent-management.service.js","sourceRoot":"","sources":["../../../../src/lib/custom/AIAgents/ai-agent-management.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoB,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAA8C,MAAM,oCAAoC,CAAC;AAC/H,OAAO,EAAE,0CAA0C,EAAuC,MAAM,mDAAmD,CAAC;AACpJ,OAAO,EAAE,uCAAuC,EAAoC,MAAM,gDAAgD,CAAC;AAC3I,OAAO,EAAE,+BAA+B,EAAkD,MAAM,uCAAuC,CAAC;AACxI,OAAO,EAAE,2BAA2B,EAA0C,MAAM,kCAAkC,CAAC;AACvH,OAAO,EAAE,6BAA6B,EAA8C,MAAM,qCAAqC,CAAC;;;AAEhI;;;;;;;;;GASG;AAIH,MAAM,OAAO,wBAAwB;IAEnC,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAEpD,4BAA4B;IAE5B;;;;;OAKG;IACH,mBAAmB,CAAC,MAKnB;QACC,MAAM,SAAS,GAAc,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YACnD,KAAK,EAAE,kBAAkB,MAAM,CAAC,SAAS,EAAE;YAC3C,OAAO,EAAE,wBAAwB;YACjC,OAAO,EAAE,EAAE,EAAE,4BAA4B;YACzC,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,GAAG;YACX,Q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CAAwC;QACxC,iEAAiE;QACjE,wDAAwD;QACxD,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,CAAC;IAED,0BAA0B;IAE1B;;;OAGG;IACH,0BAA0B,CAAC,KAAoB;QAC7C,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,wCAAwC;QACxC,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;YAC3C,MAAM,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QACnE,CAAC;QAED,iCAAiC;QACjC,IAAI,KAAK,CAAC,wBAAwB,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,CAAC,kCAAkC,EAAE,CAAC;gBAC9C,MAAM,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;YAClE,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAAE,CAAC;gBACtC,MAAM,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;YACnE,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,uCAAuC,EAAE,CAAC;gBACnD,MAAM,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC5B,MAAM;SACP,CAAC;IACJ,CAAC;IAED,+BAA+B;IAE/B;;;;OAIG;IACH,4BAA4B,CAAC,MAI5B;QACC,8CAA8C;QAC9C,mFAAmF;QACnF,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;yFAtXU,wBAAwB;uEAAxB,wBAAwB,WAAxB,wBAAwB,mBAFvB,MAAM;;iFAEP,wBAAwB;cAHpC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB"}
@@ -0,0 +1,67 @@
1
+ import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
2
+ import { FormGroup } from '@angular/forms';
3
+ import { DialogRef } from '@progress/kendo-angular-dialog';
4
+ import { Subject, BehaviorSubject } from 'rxjs';
5
+ import { AIPromptEntity, TemplateEntity, AIPromptTypeEntity, TemplateContentEntity } from '@memberjunction/core-entities';
6
+ import { TemplateEditorConfig } from '../../shared/components/template-editor.component';
7
+ import { AIPromptManagementService } from '../AIPrompts/ai-prompt-management.service';
8
+ import * as i0 from "@angular/core";
9
+ export interface CreatePromptConfig {
10
+ /** Title for the dialog */
11
+ title?: string;
12
+ /** Initial name for the prompt */
13
+ initialName?: string;
14
+ /** Pre-selected prompt type ID */
15
+ initialTypeID?: string;
16
+ }
17
+ export interface CreatePromptResult {
18
+ /** Created prompt entity (not saved to database) */
19
+ prompt: AIPromptEntity;
20
+ /** Created template entity (not saved to database) */
21
+ template?: TemplateEntity;
22
+ /** Template content entities (not saved to database) */
23
+ templateContents?: TemplateContentEntity[];
24
+ }
25
+ /**
26
+ * Dialog for creating new AI Prompts with essential fields and basic template editing.
27
+ * Creates entities but does not save them - returns entities for parent to add to PendingRecords.
28
+ * This ensures atomicity with the parent form's save operation.
29
+ */
30
+ export declare class CreatePromptDialogComponent implements OnInit, OnDestroy {
31
+ private dialogRef;
32
+ private cdr;
33
+ private aiPromptManagementService;
34
+ config: CreatePromptConfig;
35
+ private destroy$;
36
+ result: Subject<CreatePromptResult | null>;
37
+ promptForm: FormGroup;
38
+ isLoading$: BehaviorSubject<boolean>;
39
+ isSaving$: BehaviorSubject<boolean>;
40
+ availablePromptTypes$: BehaviorSubject<AIPromptTypeEntity[]>;
41
+ promptEntity: AIPromptEntity | null;
42
+ templateEntity: TemplateEntity | null;
43
+ templateContents: TemplateContentEntity[];
44
+ templateEditor: any;
45
+ showTemplateEditor: boolean;
46
+ templateEditorConfig: TemplateEditorConfig;
47
+ templateMode: 'new' | 'existing';
48
+ constructor(dialogRef: DialogRef, cdr: ChangeDetectorRef, aiPromptManagementService: AIPromptManagementService);
49
+ ngOnInit(): void;
50
+ ngOnDestroy(): void;
51
+ private createForm;
52
+ private setupFormWatching;
53
+ private loadInitialData;
54
+ handleTemplateModeChange(mode: string): Promise<void>;
55
+ private createNewTemplate;
56
+ onTemplateContentChange(contents: TemplateContentEntity[]): void;
57
+ save(): Promise<void>;
58
+ cancel(): void;
59
+ /**
60
+ * Opens the template selector dialog to link an existing template
61
+ */
62
+ private openTemplateSelector;
63
+ get currentTemplate(): TemplateEntity | null;
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<CreatePromptDialogComponent, never>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<CreatePromptDialogComponent, "mj-create-prompt-dialog", never, {}, {}, never, never, false, never>;
66
+ }
67
+ //# sourceMappingURL=create-prompt-dialog.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-prompt-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/AIAgents/create-prompt-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAa,MAAM,eAAe,CAAC;AAC3F,OAAO,EAAe,SAAS,EAAc,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,eAAe,EAAa,MAAM,MAAM,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE1H,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;;AAGtF,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,MAAM,EA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