@memberjunction/ng-core-entity-forms 5.30.1 → 5.31.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/dist/lib/__tests__/content-source-form.test.d.ts +2 -0
- package/dist/lib/__tests__/content-source-form.test.d.ts.map +1 -0
- package/dist/lib/__tests__/content-source-form.test.js +183 -0
- package/dist/lib/__tests__/content-source-form.test.js.map +1 -0
- package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/add-action-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/add-action-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/agent-advanced-settings-dialog.component.js +2 -2
- package/dist/lib/custom/AIAgents/agent-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js +15 -15
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js +9 -7
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js +11 -9
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.js +6 -5
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js +3 -3
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js +6 -6
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js.map +1 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js +7 -5
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-execution-log-form.component.js +3 -3
- package/dist/lib/custom/Actions/action-execution-log-form.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-form.component.js +12 -12
- package/dist/lib/custom/Actions/action-form.component.js.map +1 -1
- package/dist/lib/custom/ContentSources/content-source-form.component.d.ts +59 -5
- package/dist/lib/custom/ContentSources/content-source-form.component.d.ts.map +1 -1
- package/dist/lib/custom/ContentSources/content-source-form.component.js +379 -34
- package/dist/lib/custom/ContentSources/content-source-form.component.js.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.d.ts +1 -1
- package/dist/lib/custom/Entities/entity-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.js +5 -5
- package/dist/lib/custom/Entities/entity-form.component.js.map +1 -1
- package/dist/lib/custom/Lists/list-form.component.d.ts +1 -1
- package/dist/lib/custom/Lists/list-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Lists/list-form.component.js +10 -10
- package/dist/lib/custom/Lists/list-form.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-category-dialog.component.d.ts +2 -1
- package/dist/lib/custom/Queries/query-category-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Queries/query-category-dialog.component.js +9 -7
- package/dist/lib/custom/Queries/query-category-dialog.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-form.component.js +17 -17
- package/dist/lib/custom/Queries/query-form.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.d.ts +2 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.js +7 -6
- package/dist/lib/custom/Queries/query-run-dialog.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.d.ts +2 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.js +10 -8
- package/dist/lib/custom/Templates/template-param-dialog.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-params-grid.component.d.ts +2 -1
- package/dist/lib/custom/Templates/template-params-grid.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/template-params-grid.component.js +9 -7
- package/dist/lib/custom/Templates/template-params-grid.component.js.map +1 -1
- package/dist/lib/custom/Templates/templates-form.component.js +8 -8
- package/dist/lib/custom/Templates/templates-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.d.ts +3 -2
- package/dist/lib/custom/Tests/entity-link-pill.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.js +8 -6
- package/dist/lib/custom/Tests/entity-link-pill.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-form.component.d.ts +1 -1
- package/dist/lib/custom/Tests/test-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-form.component.js +7 -7
- package/dist/lib/custom/Tests/test-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-form.component.js +5 -5
- package/dist/lib/custom/Tests/test-run-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.d.ts +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.js +8 -8
- package/dist/lib/custom/Tests/test-suite-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.d.ts +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.js +6 -6
- package/dist/lib/custom/Tests/test-suite-run-form.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts +2 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js +8 -6
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.d.ts +9 -0
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.js +15 -3
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts +3 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js +10 -5
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js +2 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts +2 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.js +6 -4
- package/dist/lib/custom/shared/entity-selector-dialog.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.js +46 -28
- package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJCompanyIntegrationEntityMap/mjcompanyintegrationentitymap.form.component.js +10 -10
- package/dist/lib/generated/Entities/MJCompanyIntegrationEntityMap/mjcompanyintegrationentitymap.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJContentItem/mjcontentitem.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJContentItem/mjcontentitem.form.component.js +25 -7
- package/dist/lib/generated/Entities/MJContentItem/mjcontentitem.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.js +25 -7
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js +106 -88
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJTag/mjtag.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJTag/mjtag.form.component.js +181 -61
- package/dist/lib/generated/Entities/MJTag/mjtag.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJTagScope/mjtagscope.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJTagScope/mjtagscope.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJTagScope/mjtagscope.form.component.js +63 -0
- package/dist/lib/generated/Entities/MJTagScope/mjtagscope.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJTagSuggestion/mjtagsuggestion.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJTagSuggestion/mjtagsuggestion.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJTagSuggestion/mjtagsuggestion.form.component.js +95 -0
- package/dist/lib/generated/Entities/MJTagSuggestion/mjtagsuggestion.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.js +63 -0
- package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js +199 -181
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js.map +1 -1
- package/dist/lib/generated/generated-forms.module.d.ts +51 -48
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +27 -18
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/dist/lib/shared/components/template-editor.component.d.ts +3 -2
- package/dist/lib/shared/components/template-editor.component.d.ts.map +1 -1
- package/dist/lib/shared/components/template-editor.component.js +8 -6
- package/dist/lib/shared/components/template-editor.component.js.map +1 -1
- package/package.json +37 -35
|
@@ -5,6 +5,7 @@ import { MJTemplateEntity, MJAIPromptTypeEntity, MJTemplateContentEntity } from
|
|
|
5
5
|
import { MJAIPromptEntityExtended } from "@memberjunction/ai-core-plus";
|
|
6
6
|
import { TemplateEditorConfig } from '../../shared/components/template-editor.component';
|
|
7
7
|
import { AIPromptManagementService } from '../AIPrompts/ai-prompt-management.service';
|
|
8
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
export interface CreatePromptConfig {
|
|
10
11
|
/** Title for the dialog */
|
|
@@ -27,7 +28,7 @@ export interface CreatePromptResult {
|
|
|
27
28
|
* Creates entities but does not save them - returns entities for parent to add to PendingRecords.
|
|
28
29
|
* This ensures atomicity with the parent form's save operation.
|
|
29
30
|
*/
|
|
30
|
-
export declare class CreatePromptDialogComponent implements OnInit, OnDestroy {
|
|
31
|
+
export declare class CreatePromptDialogComponent extends BaseAngularComponent implements OnInit, OnDestroy {
|
|
31
32
|
private cdr;
|
|
32
33
|
private aiPromptManagementService;
|
|
33
34
|
config: CreatePromptConfig;
|
|
@@ -1 +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,EAAqB,YAAY,EAAE,MAAM,eAAe,CAAC;AACjH,OAAO,EAAe,SAAS,EAAc,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAa,MAAM,MAAM,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAChH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC
|
|
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,EAAqB,YAAY,EAAE,MAAM,eAAe,CAAC;AACjH,OAAO,EAAe,SAAS,EAAc,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAa,MAAM,MAAM,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAChH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAGtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AACrE,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,EAAE,wBAAwB,CAAC;IACjC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CAC9C;AAED;;;;GAIG;AACH,qBAMa,2BAA4B,SAAQ,oBAAqB,YAAW,MAAM,EAAE,SAAS;IAqC9F,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,yBAAyB;IAnCnC,MAAM,EAAE,kBAAkB,CAAM;IAGhC,OAAO,CAAC,QAAQ,CAAuB;IAChC,MAAM,qCAA4C;IAGzD,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,2BAAuC;IACjD,SAAS,2BAAuC;IAGhD,qBAAqB,0CAAmD;IAGxE,YAAY,EAAE,wBAAwB,GAAG,IAAI,CAAQ;IACrD,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAC/C,gBAAgB,EAAE,uBAAuB,EAAE,CAAM;IAGpB,cAAc,EAAE,GAAG,CAAC;IACjD,kBAAkB,UAAS;IAC3B,oBAAoB,EAAE,oBAAoB,CAIxC;IAGF,YAAY,EAAE,KAAK,GAAG,UAAU,CAAS;IAE/B,WAAW,qBAA4B;gBAGvC,GAAG,EAAE,iBAAiB,EACtB,yBAAyB,EAAE,yBAAyB;IAM9D,QAAQ;IAKR,WAAW;IAKX,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,iBAAiB;YAUX,eAAe;IAgDhB,wBAAwB,CAAC,IAAI,EAAE,MAAM;YAWpC,iBAAiB;IA6BxB,uBAAuB,CAAC,QAAQ,EAAE,uBAAuB,EAAE;IAIrD,IAAI;IAyDV,MAAM;IAKb;;OAEG;YACW,oBAAoB;IA8ClC,IAAW,eAAe,IAAI,gBAAgB,GAAG,IAAI,CAEpD;yCAxRU,2BAA2B;2CAA3B,2BAA2B;CAyRvC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Component, ViewChild, Output, EventEmitter } from '@angular/core';
|
|
2
2
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
|
3
3
|
import { Subject, BehaviorSubject, takeUntil } from 'rxjs';
|
|
4
|
-
import {
|
|
4
|
+
import { RunView } from '@memberjunction/core';
|
|
5
5
|
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
6
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
import * as i1 from "../AIPrompts/ai-prompt-management.service";
|
|
8
9
|
import * as i2 from "@angular/forms";
|
|
@@ -193,8 +194,9 @@ function CreatePromptDialogComponent_Conditional_18_Template(rf, ctx) { if (rf &
|
|
|
193
194
|
* Creates entities but does not save them - returns entities for parent to add to PendingRecords.
|
|
194
195
|
* This ensures atomicity with the parent form's save operation.
|
|
195
196
|
*/
|
|
196
|
-
export class CreatePromptDialogComponent {
|
|
197
|
+
export class CreatePromptDialogComponent extends BaseAngularComponent {
|
|
197
198
|
constructor(cdr, aiPromptManagementService) {
|
|
199
|
+
super();
|
|
198
200
|
this.cdr = cdr;
|
|
199
201
|
this.aiPromptManagementService = aiPromptManagementService;
|
|
200
202
|
// Configuration
|
|
@@ -252,7 +254,7 @@ export class CreatePromptDialogComponent {
|
|
|
252
254
|
this.isLoading$.next(true);
|
|
253
255
|
try {
|
|
254
256
|
// Load prompt types
|
|
255
|
-
const rv =
|
|
257
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
256
258
|
const typesResult = await rv.RunView({
|
|
257
259
|
EntityName: 'MJ: AI Prompt Types',
|
|
258
260
|
OrderBy: 'Name ASC',
|
|
@@ -266,7 +268,7 @@ export class CreatePromptDialogComponent {
|
|
|
266
268
|
}
|
|
267
269
|
}
|
|
268
270
|
// Create the prompt entity
|
|
269
|
-
const md =
|
|
271
|
+
const md = this.ProviderToUse;
|
|
270
272
|
this.promptEntity = await md.GetEntityObject('MJ: AI Prompts');
|
|
271
273
|
this.promptEntity.NewRecord();
|
|
272
274
|
// Set default values
|
|
@@ -300,7 +302,7 @@ export class CreatePromptDialogComponent {
|
|
|
300
302
|
if (!this.promptEntity)
|
|
301
303
|
return;
|
|
302
304
|
try {
|
|
303
|
-
const md =
|
|
305
|
+
const md = this.ProviderToUse;
|
|
304
306
|
// Create template entity
|
|
305
307
|
this.templateEntity = await md.GetEntityObject('MJ: Templates');
|
|
306
308
|
this.templateEntity.NewRecord();
|
|
@@ -413,7 +415,7 @@ export class CreatePromptDialogComponent {
|
|
|
413
415
|
} if (rf & 2) {
|
|
414
416
|
let _t;
|
|
415
417
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.templateEditor = _t.first);
|
|
416
|
-
} }, outputs: { DialogClose: "DialogClose" }, standalone: false, decls: 19, vars: 13, consts: [["templateEditor", ""], [1, "create-prompt-dialog"], [1, "loading-state"], [1, "dialog-content", 3, "formGroup"], [1, "dialog-footer"], [1, "footer-left"], [1, "form-hint"], [1, "fa-solid", "fa-info-circle"], [1, "footer-right"], ["mjButton", "", "variant", "flat", 3, "click", "disabled"], ["mjButton", "", "variant", "primary", 3, "click", "disabled"], [1, "loading-spinner"], [1, "fa-solid", "fa-spinner", "fa-spin", "fa-2x"], [1, "form-section"], [1, "section-title"], [1, "form-grid"], [1, "form-field"], ["for", "promptName", 1, "field-label", "required"], [1, "fa-solid", "fa-tag"], ["id", "promptName", "formControlName", "name", "placeholder", "Enter prompt name...", 1, "mj-input", "full-width"], [1, "field-error"], ["for", "promptType", 1, "field-label", "required"], [1, "fa-solid", "fa-category"], ["id", "promptType", "formControlName", "typeID", "TextField", "Name", "ValueField", "ID", "Placeholder", "Select prompt type...", 1, "full-width", 3, "Data", "ValuePrimitive"], ["for", "promptStatus", 1, "field-label"], [1, "fa-solid", "fa-toggle-on"], ["id", "promptStatus", "formControlName", "status", 1, "full-width", 3, "Data", "ValuePrimitive"], ["for", "outputType", 1, "field-label"], [1, "fa-solid", "fa-file-code"], ["id", "outputType", "formControlName", "outputType", 1, "full-width", 3, "Data", "ValuePrimitive"], [1, "form-field", "full-width"], ["for", "promptDescription", 1, "field-label"], [1, "fa-solid", "fa-align-left"], ["id", "promptDescription", "formControlName", "description", "placeholder", "Enter prompt description (optional)...", "rows", "3", 1, "mj-textarea", "full-width"], [1, "fa-solid", "fa-file-alt"], [1, "template-mode-section"], [1, "field-label"], [1, "fa-solid", "fa-cog"], [1, "template-mode-options"], [1, "radio-option"], ["type", "radio", "id", "templateNew", "value", "new", "formControlName", "templateMode", 1, "radio-input"], ["for", "templateNew", 1, "radio-label"], [1, "fa-solid", "fa-plus-circle"], ["type", "radio", "id", "templateExisting", "value", "existing", "formControlName", "templateMode", 1, "radio-input"], ["for", "templateExisting", 1, "radio-label"], [1, "fa-solid", "fa-link"], [1, "template-editor-section"], [1, "existing-template-section"], [1, "fa-solid", "fa-exclamation-triangle"], [1, "template-info"], [1, "template-name"], [1, "template-description"], [1, "template-editor-container"], [3, "contentChange", "template", "config"], [1, "existing-template-info"], [1, "template-header"], [1, "template-type-badge"], [1, "template-actions"], ["mjButton", "", "variant", "flat", 3, "click"], [1, "fa-solid", "fa-sync"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-plus"]], template: function CreatePromptDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
418
|
+
} }, outputs: { DialogClose: "DialogClose" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 19, vars: 13, consts: [["templateEditor", ""], [1, "create-prompt-dialog"], [1, "loading-state"], [1, "dialog-content", 3, "formGroup"], [1, "dialog-footer"], [1, "footer-left"], [1, "form-hint"], [1, "fa-solid", "fa-info-circle"], [1, "footer-right"], ["mjButton", "", "variant", "flat", 3, "click", "disabled"], ["mjButton", "", "variant", "primary", 3, "click", "disabled"], [1, "loading-spinner"], [1, "fa-solid", "fa-spinner", "fa-spin", "fa-2x"], [1, "form-section"], [1, "section-title"], [1, "form-grid"], [1, "form-field"], ["for", "promptName", 1, "field-label", "required"], [1, "fa-solid", "fa-tag"], ["id", "promptName", "formControlName", "name", "placeholder", "Enter prompt name...", 1, "mj-input", "full-width"], [1, "field-error"], ["for", "promptType", 1, "field-label", "required"], [1, "fa-solid", "fa-category"], ["id", "promptType", "formControlName", "typeID", "TextField", "Name", "ValueField", "ID", "Placeholder", "Select prompt type...", 1, "full-width", 3, "Data", "ValuePrimitive"], ["for", "promptStatus", 1, "field-label"], [1, "fa-solid", "fa-toggle-on"], ["id", "promptStatus", "formControlName", "status", 1, "full-width", 3, "Data", "ValuePrimitive"], ["for", "outputType", 1, "field-label"], [1, "fa-solid", "fa-file-code"], ["id", "outputType", "formControlName", "outputType", 1, "full-width", 3, "Data", "ValuePrimitive"], [1, "form-field", "full-width"], ["for", "promptDescription", 1, "field-label"], [1, "fa-solid", "fa-align-left"], ["id", "promptDescription", "formControlName", "description", "placeholder", "Enter prompt description (optional)...", "rows", "3", 1, "mj-textarea", "full-width"], [1, "fa-solid", "fa-file-alt"], [1, "template-mode-section"], [1, "field-label"], [1, "fa-solid", "fa-cog"], [1, "template-mode-options"], [1, "radio-option"], ["type", "radio", "id", "templateNew", "value", "new", "formControlName", "templateMode", 1, "radio-input"], ["for", "templateNew", 1, "radio-label"], [1, "fa-solid", "fa-plus-circle"], ["type", "radio", "id", "templateExisting", "value", "existing", "formControlName", "templateMode", 1, "radio-input"], ["for", "templateExisting", 1, "radio-label"], [1, "fa-solid", "fa-link"], [1, "template-editor-section"], [1, "existing-template-section"], [1, "fa-solid", "fa-exclamation-triangle"], [1, "template-info"], [1, "template-name"], [1, "template-description"], [1, "template-editor-container"], [3, "contentChange", "template", "config"], [1, "existing-template-info"], [1, "template-header"], [1, "template-type-badge"], [1, "template-actions"], ["mjButton", "", "variant", "flat", 3, "click"], [1, "fa-solid", "fa-sync"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-plus"]], template: function CreatePromptDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
417
419
|
i0.ɵɵelementStart(0, "div", 1);
|
|
418
420
|
i0.ɵɵconditionalCreate(1, CreatePromptDialogComponent_Conditional_1_Template, 5, 0, "div", 2);
|
|
419
421
|
i0.ɵɵpipe(2, "async");
|
|
@@ -457,5 +459,5 @@ export class CreatePromptDialogComponent {
|
|
|
457
459
|
}], DialogClose: [{
|
|
458
460
|
type: Output
|
|
459
461
|
}] }); })();
|
|
460
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CreatePromptDialogComponent, { className: "CreatePromptDialogComponent", filePath: "src/lib/custom/AIAgents/create-prompt-dialog.component.ts", lineNumber:
|
|
462
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CreatePromptDialogComponent, { className: "CreatePromptDialogComponent", filePath: "src/lib/custom/AIAgents/create-prompt-dialog.component.ts", lineNumber: 42 }); })();
|
|
461
463
|
//# sourceMappingURL=create-prompt-dialog.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-prompt-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/AIAgents/create-prompt-dialog.component.ts","../../../../src/lib/custom/AIAgents/create-prompt-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;;;;;;;;;;;ICAnE,AADF,8BAA2B,cACI;IAC3B,wBAAiD;IACnD,iBAAM;IACN,yBAAG;IAAA,+CAA+B;IACpC,AADoC,iBAAI,EAClC;;;IA2BI,+BAAyB;IACvB,wBAAgD;IAChD,kCACF;IAAA,iBAAM;;;IAqBN,+BAAyB;IACvB,wBAAgD;IAChD,kC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AgE;YAAhE,mGAAgE;YACtE,eAMC;YAND,iEAMC;;;iFDlNM,2BAA2B;cANvC,SAAS;6BACI,KAAK,YACP,yBAAyB;;kBA2BlC,SAAS;mBAAC,gBAAgB;;kBAW1B,MAAM;;kFAlCI,2BAA2B","sourcesContent":["import { Component, OnInit, OnDestroy, ChangeDetectorRef, ViewChild, Output, EventEmitter } from '@angular/core';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport { Subject, BehaviorSubject, takeUntil } from 'rxjs';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { MJTemplateEntity, MJAIPromptTypeEntity, MJTemplateContentEntity } from '@memberjunction/core-entities';\nimport { MJAIPromptEntityExtended } from \"@memberjunction/ai-core-plus\";\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { TemplateEditorConfig } from '../../shared/components/template-editor.component';\nimport { AIPromptManagementService } from '../AIPrompts/ai-prompt-management.service';\nimport { TemplateSelectorConfig } from '../AIPrompts/template-selector-dialog.component';\n\nexport interface CreatePromptConfig {\n /** Title for the dialog */\n title?: string;\n /** Initial name for the prompt */\n initialName?: string;\n /** Pre-selected prompt type ID */\n initialTypeID?: string;\n}\n\nexport interface CreatePromptResult {\n /** Created prompt entity (not saved to database) */\n prompt: MJAIPromptEntityExtended;\n /** Created template entity (not saved to database) */\n template?: MJTemplateEntity;\n /** Template content entities (not saved to database) */\n templateContents?: MJTemplateContentEntity[];\n}\n\n/**\n * Dialog for creating new AI Prompts with essential fields and basic template editing.\n * Creates entities but does not save them - returns entities for parent to add to PendingRecords.\n * This ensures atomicity with the parent form's save operation.\n */\n@Component({\n standalone: false,\n selector: 'mj-create-prompt-dialog',\n templateUrl: './create-prompt-dialog.component.html',\n styleUrls: ['./create-prompt-dialog.component.css']\n})\nexport class CreatePromptDialogComponent implements OnInit, OnDestroy {\n \n // Configuration\n config: CreatePromptConfig = {};\n \n // State management\n private destroy$ = new Subject<void>();\n public result = new Subject<CreatePromptResult | null>();\n \n // Form and validation\n promptForm: FormGroup;\n isLoading$ = new BehaviorSubject<boolean>(false);\n isSaving$ = new BehaviorSubject<boolean>(false);\n \n // Data\n availablePromptTypes$ = new BehaviorSubject<MJAIPromptTypeEntity[]>([]);\n \n // Entities (not saved to database)\n promptEntity: MJAIPromptEntityExtended | null = null;\n templateEntity: MJTemplateEntity | null = null;\n templateContents: MJTemplateContentEntity[] = [];\n \n // Template editor\n @ViewChild('templateEditor') templateEditor: any; // Template editor component reference\n showTemplateEditor = false;\n templateEditorConfig: TemplateEditorConfig = {\n allowEdit: true,\n showRunButton: false,\n compactMode: true // Compact mode for dialog\n };\n \n // Template state\n templateMode: 'new' | 'existing' = 'new';\n\n @Output() DialogClose = new EventEmitter<void>();\n\n constructor(\n private cdr: ChangeDetectorRef,\n private aiPromptManagementService: AIPromptManagementService\n ) {\n this.promptForm = this.createForm();\n }\n\n ngOnInit() {\n this.loadInitialData();\n this.setupFormWatching();\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n private createForm(): FormGroup {\n return new FormGroup({\n name: new FormControl(this.config.initialName || '', [Validators.required]),\n description: new FormControl(''),\n typeID: new FormControl(this.config.initialTypeID || '', [Validators.required]),\n status: new FormControl('Pending'),\n outputType: new FormControl('string'),\n templateMode: new FormControl('new')\n });\n }\n\n private setupFormWatching() {\n // Watch template mode changes\n this.promptForm.get('templateMode')?.valueChanges\n .pipe(takeUntil(this.destroy$))\n .subscribe(mode => {\n this.templateMode = mode;\n this.handleTemplateModeChange(mode);\n });\n }\n\n private async loadInitialData() {\n this.isLoading$.next(true);\n \n try {\n // Load prompt types\n const rv = new RunView();\n const typesResult = await rv.RunView<MJAIPromptTypeEntity>({\n EntityName: 'MJ: AI Prompt Types',\n OrderBy: 'Name ASC',\n ResultType: 'entity_object'\n });\n\n if (typesResult.Success && typesResult.Results) {\n this.availablePromptTypes$.next(typesResult.Results);\n \n // Set default type if not specified\n if (!this.config.initialTypeID && typesResult.Results.length > 0) {\n this.promptForm.patchValue({ typeID: typesResult.Results[0].ID });\n }\n }\n\n // Create the prompt entity\n const md = new Metadata();\n this.promptEntity = await md.GetEntityObject<MJAIPromptEntityExtended>('MJ: AI Prompts');\n this.promptEntity.NewRecord();\n \n // Set default values\n this.promptEntity.Status = 'Pending';\n this.promptEntity.OutputType = 'string';\n this.promptEntity.ValidationBehavior = 'None';\n this.promptEntity.EnableCaching = false;\n\n // Create default template since it's required\n await this.createNewTemplate();\n this.showTemplateEditor = true;\n\n } catch (error) {\n console.error('Error loading prompt creation data:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error loading data for prompt creation',\n 'error',\n 3000\n );\n } finally {\n this.isLoading$.next(false);\n }\n }\n\n public async handleTemplateModeChange(mode: string) {\n if (mode === 'new') {\n await this.createNewTemplate();\n this.showTemplateEditor = true;\n } else if (mode === 'existing') {\n await this.openTemplateSelector();\n }\n \n this.cdr.detectChanges();\n }\n\n private async createNewTemplate() {\n if (!this.promptEntity) return;\n\n try {\n const md = new Metadata();\n \n // Create template entity\n this.templateEntity = await md.GetEntityObject<MJTemplateEntity>('MJ: Templates');\n this.templateEntity.NewRecord();\n \n const promptName = this.promptForm.get('name')?.value || 'New Prompt';\n this.templateEntity.Name = `${promptName} Template`;\n this.templateEntity.Description = `Template for ${promptName}`;\n // Set UserID on template (required field)\n this.templateEntity.UserID = md.CurrentUser.ID;\n \n // Link template to prompt\n this.promptEntity.TemplateID = this.templateEntity.ID;\n\n } catch (error) {\n console.error('Error creating new template:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error creating template',\n 'error',\n 3000\n );\n }\n }\n\n public onTemplateContentChange(contents: MJTemplateContentEntity[]) {\n this.templateContents = contents || [];\n }\n\n public async save() {\n if (!this.promptForm.valid || !this.promptEntity) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please fill in all required fields',\n 'warning',\n 3000\n );\n return;\n }\n\n this.isSaving$.next(true);\n\n try {\n // Update prompt entity with form values\n const formValue = this.promptForm.value;\n this.promptEntity.Name = formValue.name;\n this.promptEntity.Description = formValue.description || '';\n this.promptEntity.TypeID = formValue.typeID;\n this.promptEntity.Status = formValue.status;\n this.promptEntity.OutputType = formValue.outputType;\n\n // Get template contents if template editor is active\n if (this.templateEditor && this.showTemplateEditor) {\n // Get the template contents from the editor without saving\n // The parent form will handle saving in the proper order\n this.templateContents = this.templateEditor.templateContents || [];\n \n // Ensure the template contents have the correct TemplateID\n if (this.templateContents && this.templateEntity) {\n this.templateContents.forEach(content => {\n content.TemplateID = this.templateEntity!.ID;\n });\n }\n }\n\n // Return the created entities (not saved to database)\n const result: CreatePromptResult = {\n prompt: this.promptEntity,\n template: this.templateEntity || undefined,\n templateContents: this.templateContents.length > 0 ? this.templateContents : undefined\n };\n\n this.result.next(result);\n this.DialogClose.emit();\n\n } catch (error) {\n console.error('Error preparing prompt for creation:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error preparing prompt for creation',\n 'error',\n 3000\n );\n } finally {\n this.isSaving$.next(false);\n }\n }\n\n public cancel() {\n this.result.next(null);\n this.DialogClose.emit();\n }\n\n /**\n * Opens the template selector dialog to link an existing template\n */\n private async openTemplateSelector() {\n const config: TemplateSelectorConfig = {\n title: 'Select Template for AI Prompt',\n showCreateNew: false,\n multiSelect: false,\n showActiveOnly: true\n };\n\n try {\n const result = await this.aiPromptManagementService.openTemplateSelectorDialog(config).toPromise();\n \n if (result && result.selectedTemplates && result.selectedTemplates.length > 0) {\n // Link the selected template\n this.templateEntity = result.selectedTemplates[0];\n this.promptEntity!.TemplateID = this.templateEntity.ID;\n \n // Update UI to show selected template info\n this.showTemplateEditor = false;\n \n MJNotificationService.Instance.CreateSimpleNotification(\n `Template \"${this.templateEntity.Name}\" linked successfully`,\n 'success',\n 3000\n );\n } else {\n // User cancelled, revert to new template mode\n this.promptForm.patchValue({ templateMode: 'new' });\n await this.createNewTemplate();\n this.showTemplateEditor = true;\n }\n } catch (error) {\n console.error('Error opening template selector:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error opening template selector',\n 'error',\n 3000\n );\n \n // Revert to new template mode\n this.promptForm.patchValue({ templateMode: 'new' });\n await this.createNewTemplate();\n this.showTemplateEditor = true;\n }\n }\n\n // Getter for template debugging\n public get currentTemplate(): MJTemplateEntity | null {\n return this.templateEntity;\n }\n}","<!-- Create Prompt Dialog -->\n<div class=\"create-prompt-dialog\">\n \n <!-- Loading State -->\n @if (isLoading$ | async) {\n <div class=\"loading-state\">\n <div class=\"loading-spinner\">\n <i class=\"fa-solid fa-spinner fa-spin fa-2x\"></i>\n </div>\n <p>Loading prompt creation form...</p>\n </div>\n } @else {\n \n <!-- Form Content -->\n <form [formGroup]=\"promptForm\" class=\"dialog-content\">\n \n <!-- Basic Prompt Information -->\n <div class=\"form-section\">\n <h4 class=\"section-title\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Basic Information\n </h4>\n \n <div class=\"form-grid\">\n \n <!-- Name Field -->\n <div class=\"form-field\">\n <label for=\"promptName\" class=\"field-label required\">\n <i class=\"fa-solid fa-tag\"></i>\n Name\n </label>\n <input\n id=\"promptName\"\n class=\"mj-input full-width\"\n formControlName=\"name\"\n placeholder=\"Enter prompt name...\">\n @if (promptForm.get('name')?.invalid && promptForm.get('name')?.touched) {\n <div class=\"field-error\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n Name is required\n </div>\n }\n </div>\n\n <!-- Type Field -->\n <div class=\"form-field\">\n <label for=\"promptType\" class=\"field-label required\">\n <i class=\"fa-solid fa-category\"></i>\n Type\n </label>\n <mj-dropdown\n id=\"promptType\"\n formControlName=\"typeID\"\n [Data]=\"availablePromptTypes$ | async\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"Select prompt type...\"\n class=\"full-width\">\n </mj-dropdown>\n @if (promptForm.get('typeID')?.invalid && promptForm.get('typeID')?.touched) {\n <div class=\"field-error\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n Type is required\n </div>\n }\n </div>\n\n <!-- Status Field -->\n <div class=\"form-field\">\n <label for=\"promptStatus\" class=\"field-label\">\n <i class=\"fa-solid fa-toggle-on\"></i>\n Status\n </label>\n <mj-dropdown\n id=\"promptStatus\"\n formControlName=\"status\"\n [Data]=\"['Pending', 'Active', 'Disabled']\"\n [ValuePrimitive]=\"true\"\n class=\"full-width\">\n </mj-dropdown>\n </div>\n\n <!-- Output Type Field -->\n <div class=\"form-field\">\n <label for=\"outputType\" class=\"field-label\">\n <i class=\"fa-solid fa-file-code\"></i>\n Output Type\n </label>\n <mj-dropdown\n id=\"outputType\"\n formControlName=\"outputType\"\n [Data]=\"['string', 'object']\"\n [ValuePrimitive]=\"true\"\n class=\"full-width\">\n </mj-dropdown>\n </div>\n\n </div>\n\n <!-- Description Field -->\n <div class=\"form-field full-width\">\n <label for=\"promptDescription\" class=\"field-label\">\n <i class=\"fa-solid fa-align-left\"></i>\n Description\n </label>\n <textarea\n id=\"promptDescription\"\n class=\"mj-textarea full-width\"\n formControlName=\"description\"\n placeholder=\"Enter prompt description (optional)...\"\n rows=\"3\"></textarea>\n </div>\n\n </div>\n\n <!-- Template Configuration -->\n <div class=\"form-section\">\n <h4 class=\"section-title\">\n <i class=\"fa-solid fa-file-alt\"></i>\n Template Configuration\n </h4>\n \n <div class=\"template-mode-section\">\n <label class=\"field-label\">\n <i class=\"fa-solid fa-cog\"></i>\n Template Mode\n </label>\n \n <div class=\"template-mode-options\">\n <div class=\"radio-option\">\n <input type=\"radio\" \n id=\"templateNew\" \n value=\"new\" \n formControlName=\"templateMode\"\n class=\"radio-input\">\n <label for=\"templateNew\" class=\"radio-label\">\n <i class=\"fa-solid fa-plus-circle\"></i>\n Create New Template\n </label>\n </div>\n \n <div class=\"radio-option\">\n <input type=\"radio\" \n id=\"templateExisting\" \n value=\"existing\" \n formControlName=\"templateMode\"\n class=\"radio-input\">\n <label for=\"templateExisting\" class=\"radio-label\">\n <i class=\"fa-solid fa-link\"></i>\n Link Existing Template\n </label>\n </div>\n </div>\n </div>\n\n <!-- Template Editor Section (New Template) -->\n @if (showTemplateEditor && templateEntity && templateMode === 'new') {\n <div class=\"template-editor-section\">\n <div class=\"template-info\">\n <h5 class=\"template-name\">\n <i class=\"fa-solid fa-file-code\"></i>\n {{ templateEntity.Name }}\n </h5>\n @if (templateEntity.Description) {\n <p class=\"template-description\">{{ templateEntity.Description }}</p>\n }\n </div>\n \n <div class=\"template-editor-container\">\n <mj-template-editor \n #templateEditor\n [template]=\"templateEntity\"\n [config]=\"templateEditorConfig\"\n (contentChange)=\"onTemplateContentChange($event)\">\n </mj-template-editor>\n </div>\n </div>\n }\n \n <!-- Existing Template Display -->\n @if (templateEntity && templateMode === 'existing') {\n <div class=\"existing-template-section\">\n <div class=\"existing-template-info\">\n <div class=\"template-header\">\n <h5 class=\"template-name\">\n <i class=\"fa-solid fa-link\"></i>\n {{ templateEntity.Name }}\n </h5>\n <span class=\"template-type-badge\">\n <i class=\"fa-solid fa-tag\"></i>\n Existing Template\n </span>\n </div>\n \n @if (templateEntity.Description) {\n <p class=\"template-description\">{{ templateEntity.Description }}</p>\n }\n \n <div class=\"template-actions\">\n <button mjButton\n variant=\"flat\"\n (click)=\"handleTemplateModeChange('existing')\">\n <i class=\"fa-solid fa-sync\"></i>\n Change Template\n </button>\n </div>\n </div>\n </div>\n }\n\n </div>\n\n </form>\n\n }\n\n</div>\n\n<!-- Dialog Footer -->\n<div class=\"dialog-footer\">\n <div class=\"footer-left\">\n <span class=\"form-hint\">\n <i class=\"fa-solid fa-info-circle\"></i>\n @if (templateMode === 'new') {\n Created prompts and templates will be saved when you save the AI Agent\n } @else {\n Created prompt will be linked to existing template when you save the AI Agent\n }\n </span>\n </div>\n \n <div class=\"footer-right\">\n <button mjButton\n variant=\"flat\"\n (click)=\"cancel()\"\n [disabled]=\"(isSaving$ | async) || false\">\n Cancel\n </button>\n\n <button mjButton\n variant=\"primary\"\n (click)=\"save()\"\n [disabled]=\"!promptForm.valid || ((isSaving$ | async) || false)\">\n @if (isSaving$ | async) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n Creating...\n } @else {\n <i class=\"fa-solid fa-plus\"></i>\n Create Prompt\n }\n </button>\n </div>\n</div>"]}
|
|
1
|
+
{"version":3,"file":"create-prompt-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/AIAgents/create-prompt-dialog.component.ts","../../../../src/lib/custom/AIAgents/create-prompt-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACjH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,EAAY,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAKzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;;;;ICL/D,AADF,8BAA2B,cACI;IAC3B,wBAAiD;IACnD,iBAAM;IACN,yBAAG;IAAA,+CAA+B;IACpC,AADoC,iBAAI,EAClC;;;IA2BI,+BAAyB;IACvB,wBAAgD;IAChD,kCACF;IAAA,iBAAM;;;IAqBN,+BAAyB;IACvB,wBAAgD;IAChD,kCACF;IAAA,iBAAM;;;IAqGJ,6BAAgC;IAAA,YAAgC;IAAA,iBAAI;;;IAApC,cAAgC;IAAhC,uDAAgC;;;;IALlE,AADF,AADF,+BAAqC,cACR,aACC;IACxB,wBAAqC;IACrC,YACF;IAAA,iBAAK;IACL,yHAAkC;IAGpC,iBAAM;IAGJ,AADF,+BAAuC,gCAKe;IAAlD,iPAAiB,sCAA+B,KAAC;IAGvD,AADE,AADE,iBAAqB,EACjB,EACF;;;IAfA,eACF;IADE,2DACF;IACA,cAEC;IAFD,4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C;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;YACzD,qBAAqB,CAAC,QAAQ,CAAC,wBAAwB,CACrD,iCAAiC,EACjC,OAAO,EACP,IAAI,CACL,CAAC;YAEF,8BAA8B;YAC9B,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;YACpD,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC/B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QACjC,CAAC;IACH,CAAC;IAED,gCAAgC;IAChC,IAAW,eAAe;QACxB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;4HAxRU,2BAA2B;oEAA3B,2BAA2B;;;;;;YCxCxC,8BAAkC;YAGhC,6FAA0B;;YAOxB,sGAAO;YA8MX,iBAAM;YAKF,AADF,AADF,8BAA2B,aACA,cACC;YACtB,uBAAuC;YAGrC,AAFF,mFAA8B,6DAErB;YAIb,AADE,iBAAO,EACH;YAGJ,AADF,+BAA0B,iBAI0B;;YAD1C,yGAAS,YAAQ,IAAC;YAExB,yBACF;YAAA,iBAAS;YAET,mCAGyE;;YADjE,yGAAS,UAAM,IAAC;YAEtB,qFAAyB;;YAGvB,2FAAO;YAMf,AADE,AADE,iBAAS,EACL,EACF;;YAzPJ,cAmNC;YAnND,8DAmNC;YASG,eAIC;YAJD,oDAIC;YAQK,eAAyC;YAAzC,wEAAyC;YAOzC,eAAgE;YAAhE,mGAAgE;YACtE,eAMC;YAND,iEAMC;;;iFDjNM,2BAA2B;cANvC,SAAS;6BACI,KAAK,YACP,yBAAyB;;kBA2BlC,SAAS;mBAAC,gBAAgB;;kBAW1B,MAAM;;kFAlCI,2BAA2B","sourcesContent":["import { Component, OnInit, OnDestroy, ChangeDetectorRef, ViewChild, Output, EventEmitter } from '@angular/core';\nimport { FormControl, FormGroup, Validators } from '@angular/forms';\nimport { Subject, BehaviorSubject, takeUntil } from 'rxjs';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { MJTemplateEntity, MJAIPromptTypeEntity, MJTemplateContentEntity } from '@memberjunction/core-entities';\nimport { MJAIPromptEntityExtended } from \"@memberjunction/ai-core-plus\";\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { TemplateEditorConfig } from '../../shared/components/template-editor.component';\nimport { AIPromptManagementService } from '../AIPrompts/ai-prompt-management.service';\nimport { TemplateSelectorConfig } from '../AIPrompts/template-selector-dialog.component';\n\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nexport interface CreatePromptConfig {\n /** Title for the dialog */\n title?: string;\n /** Initial name for the prompt */\n initialName?: string;\n /** Pre-selected prompt type ID */\n initialTypeID?: string;\n}\n\nexport interface CreatePromptResult {\n /** Created prompt entity (not saved to database) */\n prompt: MJAIPromptEntityExtended;\n /** Created template entity (not saved to database) */\n template?: MJTemplateEntity;\n /** Template content entities (not saved to database) */\n templateContents?: MJTemplateContentEntity[];\n}\n\n/**\n * Dialog for creating new AI Prompts with essential fields and basic template editing.\n * Creates entities but does not save them - returns entities for parent to add to PendingRecords.\n * This ensures atomicity with the parent form's save operation.\n */\n@Component({\n standalone: false,\n selector: 'mj-create-prompt-dialog',\n templateUrl: './create-prompt-dialog.component.html',\n styleUrls: ['./create-prompt-dialog.component.css']\n})\nexport class CreatePromptDialogComponent extends BaseAngularComponent implements OnInit, OnDestroy {\n \n // Configuration\n config: CreatePromptConfig = {};\n \n // State management\n private destroy$ = new Subject<void>();\n public result = new Subject<CreatePromptResult | null>();\n \n // Form and validation\n promptForm: FormGroup;\n isLoading$ = new BehaviorSubject<boolean>(false);\n isSaving$ = new BehaviorSubject<boolean>(false);\n \n // Data\n availablePromptTypes$ = new BehaviorSubject<MJAIPromptTypeEntity[]>([]);\n \n // Entities (not saved to database)\n promptEntity: MJAIPromptEntityExtended | null = null;\n templateEntity: MJTemplateEntity | null = null;\n templateContents: MJTemplateContentEntity[] = [];\n \n // Template editor\n @ViewChild('templateEditor') templateEditor: any; // Template editor component reference\n showTemplateEditor = false;\n templateEditorConfig: TemplateEditorConfig = {\n allowEdit: true,\n showRunButton: false,\n compactMode: true // Compact mode for dialog\n };\n \n // Template state\n templateMode: 'new' | 'existing' = 'new';\n\n @Output() DialogClose = new EventEmitter<void>();\n\n constructor(\n private cdr: ChangeDetectorRef,\n private aiPromptManagementService: AIPromptManagementService\n ) {\n super();\n this.promptForm = this.createForm();\n }\n\n ngOnInit() {\n this.loadInitialData();\n this.setupFormWatching();\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n private createForm(): FormGroup {\n return new FormGroup({\n name: new FormControl(this.config.initialName || '', [Validators.required]),\n description: new FormControl(''),\n typeID: new FormControl(this.config.initialTypeID || '', [Validators.required]),\n status: new FormControl('Pending'),\n outputType: new FormControl('string'),\n templateMode: new FormControl('new')\n });\n }\n\n private setupFormWatching() {\n // Watch template mode changes\n this.promptForm.get('templateMode')?.valueChanges\n .pipe(takeUntil(this.destroy$))\n .subscribe(mode => {\n this.templateMode = mode;\n this.handleTemplateModeChange(mode);\n });\n }\n\n private async loadInitialData() {\n this.isLoading$.next(true);\n \n try {\n // Load prompt types\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const typesResult = await rv.RunView<MJAIPromptTypeEntity>({\n EntityName: 'MJ: AI Prompt Types',\n OrderBy: 'Name ASC',\n ResultType: 'entity_object'\n });\n\n if (typesResult.Success && typesResult.Results) {\n this.availablePromptTypes$.next(typesResult.Results);\n \n // Set default type if not specified\n if (!this.config.initialTypeID && typesResult.Results.length > 0) {\n this.promptForm.patchValue({ typeID: typesResult.Results[0].ID });\n }\n }\n\n // Create the prompt entity\n const md = this.ProviderToUse;\n this.promptEntity = await md.GetEntityObject<MJAIPromptEntityExtended>('MJ: AI Prompts');\n this.promptEntity.NewRecord();\n \n // Set default values\n this.promptEntity.Status = 'Pending';\n this.promptEntity.OutputType = 'string';\n this.promptEntity.ValidationBehavior = 'None';\n this.promptEntity.EnableCaching = false;\n\n // Create default template since it's required\n await this.createNewTemplate();\n this.showTemplateEditor = true;\n\n } catch (error) {\n console.error('Error loading prompt creation data:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error loading data for prompt creation',\n 'error',\n 3000\n );\n } finally {\n this.isLoading$.next(false);\n }\n }\n\n public async handleTemplateModeChange(mode: string) {\n if (mode === 'new') {\n await this.createNewTemplate();\n this.showTemplateEditor = true;\n } else if (mode === 'existing') {\n await this.openTemplateSelector();\n }\n \n this.cdr.detectChanges();\n }\n\n private async createNewTemplate() {\n if (!this.promptEntity) return;\n\n try {\n const md = this.ProviderToUse;\n \n // Create template entity\n this.templateEntity = await md.GetEntityObject<MJTemplateEntity>('MJ: Templates');\n this.templateEntity.NewRecord();\n \n const promptName = this.promptForm.get('name')?.value || 'New Prompt';\n this.templateEntity.Name = `${promptName} Template`;\n this.templateEntity.Description = `Template for ${promptName}`;\n // Set UserID on template (required field)\n this.templateEntity.UserID = md.CurrentUser.ID;\n \n // Link template to prompt\n this.promptEntity.TemplateID = this.templateEntity.ID;\n\n } catch (error) {\n console.error('Error creating new template:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error creating template',\n 'error',\n 3000\n );\n }\n }\n\n public onTemplateContentChange(contents: MJTemplateContentEntity[]) {\n this.templateContents = contents || [];\n }\n\n public async save() {\n if (!this.promptForm.valid || !this.promptEntity) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please fill in all required fields',\n 'warning',\n 3000\n );\n return;\n }\n\n this.isSaving$.next(true);\n\n try {\n // Update prompt entity with form values\n const formValue = this.promptForm.value;\n this.promptEntity.Name = formValue.name;\n this.promptEntity.Description = formValue.description || '';\n this.promptEntity.TypeID = formValue.typeID;\n this.promptEntity.Status = formValue.status;\n this.promptEntity.OutputType = formValue.outputType;\n\n // Get template contents if template editor is active\n if (this.templateEditor && this.showTemplateEditor) {\n // Get the template contents from the editor without saving\n // The parent form will handle saving in the proper order\n this.templateContents = this.templateEditor.templateContents || [];\n \n // Ensure the template contents have the correct TemplateID\n if (this.templateContents && this.templateEntity) {\n this.templateContents.forEach(content => {\n content.TemplateID = this.templateEntity!.ID;\n });\n }\n }\n\n // Return the created entities (not saved to database)\n const result: CreatePromptResult = {\n prompt: this.promptEntity,\n template: this.templateEntity || undefined,\n templateContents: this.templateContents.length > 0 ? this.templateContents : undefined\n };\n\n this.result.next(result);\n this.DialogClose.emit();\n\n } catch (error) {\n console.error('Error preparing prompt for creation:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error preparing prompt for creation',\n 'error',\n 3000\n );\n } finally {\n this.isSaving$.next(false);\n }\n }\n\n public cancel() {\n this.result.next(null);\n this.DialogClose.emit();\n }\n\n /**\n * Opens the template selector dialog to link an existing template\n */\n private async openTemplateSelector() {\n const config: TemplateSelectorConfig = {\n title: 'Select Template for AI Prompt',\n showCreateNew: false,\n multiSelect: false,\n showActiveOnly: true\n };\n\n try {\n const result = await this.aiPromptManagementService.openTemplateSelectorDialog(config).toPromise();\n \n if (result && result.selectedTemplates && result.selectedTemplates.length > 0) {\n // Link the selected template\n this.templateEntity = result.selectedTemplates[0];\n this.promptEntity!.TemplateID = this.templateEntity.ID;\n \n // Update UI to show selected template info\n this.showTemplateEditor = false;\n \n MJNotificationService.Instance.CreateSimpleNotification(\n `Template \"${this.templateEntity.Name}\" linked successfully`,\n 'success',\n 3000\n );\n } else {\n // User cancelled, revert to new template mode\n this.promptForm.patchValue({ templateMode: 'new' });\n await this.createNewTemplate();\n this.showTemplateEditor = true;\n }\n } catch (error) {\n console.error('Error opening template selector:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error opening template selector',\n 'error',\n 3000\n );\n \n // Revert to new template mode\n this.promptForm.patchValue({ templateMode: 'new' });\n await this.createNewTemplate();\n this.showTemplateEditor = true;\n }\n }\n\n // Getter for template debugging\n public get currentTemplate(): MJTemplateEntity | null {\n return this.templateEntity;\n }\n}","<!-- Create Prompt Dialog -->\n<div class=\"create-prompt-dialog\">\n \n <!-- Loading State -->\n @if (isLoading$ | async) {\n <div class=\"loading-state\">\n <div class=\"loading-spinner\">\n <i class=\"fa-solid fa-spinner fa-spin fa-2x\"></i>\n </div>\n <p>Loading prompt creation form...</p>\n </div>\n } @else {\n \n <!-- Form Content -->\n <form [formGroup]=\"promptForm\" class=\"dialog-content\">\n \n <!-- Basic Prompt Information -->\n <div class=\"form-section\">\n <h4 class=\"section-title\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Basic Information\n </h4>\n \n <div class=\"form-grid\">\n \n <!-- Name Field -->\n <div class=\"form-field\">\n <label for=\"promptName\" class=\"field-label required\">\n <i class=\"fa-solid fa-tag\"></i>\n Name\n </label>\n <input\n id=\"promptName\"\n class=\"mj-input full-width\"\n formControlName=\"name\"\n placeholder=\"Enter prompt name...\">\n @if (promptForm.get('name')?.invalid && promptForm.get('name')?.touched) {\n <div class=\"field-error\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n Name is required\n </div>\n }\n </div>\n\n <!-- Type Field -->\n <div class=\"form-field\">\n <label for=\"promptType\" class=\"field-label required\">\n <i class=\"fa-solid fa-category\"></i>\n Type\n </label>\n <mj-dropdown\n id=\"promptType\"\n formControlName=\"typeID\"\n [Data]=\"availablePromptTypes$ | async\"\n TextField=\"Name\"\n ValueField=\"ID\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"Select prompt type...\"\n class=\"full-width\">\n </mj-dropdown>\n @if (promptForm.get('typeID')?.invalid && promptForm.get('typeID')?.touched) {\n <div class=\"field-error\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n Type is required\n </div>\n }\n </div>\n\n <!-- Status Field -->\n <div class=\"form-field\">\n <label for=\"promptStatus\" class=\"field-label\">\n <i class=\"fa-solid fa-toggle-on\"></i>\n Status\n </label>\n <mj-dropdown\n id=\"promptStatus\"\n formControlName=\"status\"\n [Data]=\"['Pending', 'Active', 'Disabled']\"\n [ValuePrimitive]=\"true\"\n class=\"full-width\">\n </mj-dropdown>\n </div>\n\n <!-- Output Type Field -->\n <div class=\"form-field\">\n <label for=\"outputType\" class=\"field-label\">\n <i class=\"fa-solid fa-file-code\"></i>\n Output Type\n </label>\n <mj-dropdown\n id=\"outputType\"\n formControlName=\"outputType\"\n [Data]=\"['string', 'object']\"\n [ValuePrimitive]=\"true\"\n class=\"full-width\">\n </mj-dropdown>\n </div>\n\n </div>\n\n <!-- Description Field -->\n <div class=\"form-field full-width\">\n <label for=\"promptDescription\" class=\"field-label\">\n <i class=\"fa-solid fa-align-left\"></i>\n Description\n </label>\n <textarea\n id=\"promptDescription\"\n class=\"mj-textarea full-width\"\n formControlName=\"description\"\n placeholder=\"Enter prompt description (optional)...\"\n rows=\"3\"></textarea>\n </div>\n\n </div>\n\n <!-- Template Configuration -->\n <div class=\"form-section\">\n <h4 class=\"section-title\">\n <i class=\"fa-solid fa-file-alt\"></i>\n Template Configuration\n </h4>\n \n <div class=\"template-mode-section\">\n <label class=\"field-label\">\n <i class=\"fa-solid fa-cog\"></i>\n Template Mode\n </label>\n \n <div class=\"template-mode-options\">\n <div class=\"radio-option\">\n <input type=\"radio\" \n id=\"templateNew\" \n value=\"new\" \n formControlName=\"templateMode\"\n class=\"radio-input\">\n <label for=\"templateNew\" class=\"radio-label\">\n <i class=\"fa-solid fa-plus-circle\"></i>\n Create New Template\n </label>\n </div>\n \n <div class=\"radio-option\">\n <input type=\"radio\" \n id=\"templateExisting\" \n value=\"existing\" \n formControlName=\"templateMode\"\n class=\"radio-input\">\n <label for=\"templateExisting\" class=\"radio-label\">\n <i class=\"fa-solid fa-link\"></i>\n Link Existing Template\n </label>\n </div>\n </div>\n </div>\n\n <!-- Template Editor Section (New Template) -->\n @if (showTemplateEditor && templateEntity && templateMode === 'new') {\n <div class=\"template-editor-section\">\n <div class=\"template-info\">\n <h5 class=\"template-name\">\n <i class=\"fa-solid fa-file-code\"></i>\n {{ templateEntity.Name }}\n </h5>\n @if (templateEntity.Description) {\n <p class=\"template-description\">{{ templateEntity.Description }}</p>\n }\n </div>\n \n <div class=\"template-editor-container\">\n <mj-template-editor \n #templateEditor\n [template]=\"templateEntity\"\n [config]=\"templateEditorConfig\"\n (contentChange)=\"onTemplateContentChange($event)\">\n </mj-template-editor>\n </div>\n </div>\n }\n \n <!-- Existing Template Display -->\n @if (templateEntity && templateMode === 'existing') {\n <div class=\"existing-template-section\">\n <div class=\"existing-template-info\">\n <div class=\"template-header\">\n <h5 class=\"template-name\">\n <i class=\"fa-solid fa-link\"></i>\n {{ templateEntity.Name }}\n </h5>\n <span class=\"template-type-badge\">\n <i class=\"fa-solid fa-tag\"></i>\n Existing Template\n </span>\n </div>\n \n @if (templateEntity.Description) {\n <p class=\"template-description\">{{ templateEntity.Description }}</p>\n }\n \n <div class=\"template-actions\">\n <button mjButton\n variant=\"flat\"\n (click)=\"handleTemplateModeChange('existing')\">\n <i class=\"fa-solid fa-sync\"></i>\n Change Template\n </button>\n </div>\n </div>\n </div>\n }\n\n </div>\n\n </form>\n\n }\n\n</div>\n\n<!-- Dialog Footer -->\n<div class=\"dialog-footer\">\n <div class=\"footer-left\">\n <span class=\"form-hint\">\n <i class=\"fa-solid fa-info-circle\"></i>\n @if (templateMode === 'new') {\n Created prompts and templates will be saved when you save the AI Agent\n } @else {\n Created prompt will be linked to existing template when you save the AI Agent\n }\n </span>\n </div>\n \n <div class=\"footer-right\">\n <button mjButton\n variant=\"flat\"\n (click)=\"cancel()\"\n [disabled]=\"(isSaving$ | async) || false\">\n Cancel\n </button>\n\n <button mjButton\n variant=\"primary\"\n (click)=\"save()\"\n [disabled]=\"!promptForm.valid || ((isSaving$ | async) || false)\">\n @if (isSaving$ | async) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n Creating...\n } @else {\n <i class=\"fa-solid fa-plus\"></i>\n Create Prompt\n }\n </button>\n </div>\n</div>"]}
|
|
@@ -4,6 +4,7 @@ import { Subject, BehaviorSubject } from 'rxjs';
|
|
|
4
4
|
import { MJAIAgentTypeEntity, MJAIAgentPromptEntity, MJAIAgentActionEntity, MJActionEntity } from '@memberjunction/core-entities';
|
|
5
5
|
import { AIAgentManagementService } from './ai-agent-management.service';
|
|
6
6
|
import { MJAIPromptEntityExtended, MJAIAgentEntityExtended } from "@memberjunction/ai-core-plus";
|
|
7
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export interface CreateSubAgentConfig {
|
|
9
10
|
/** Title for the dialog */
|
|
@@ -36,7 +37,7 @@ export interface CreateSubAgentResult {
|
|
|
36
37
|
* Creates entities but does not save them - returns entities for parent to add to PendingRecords.
|
|
37
38
|
* This ensures atomicity with the parent form's save operation.
|
|
38
39
|
*/
|
|
39
|
-
export declare class CreateSubAgentDialogComponent implements OnInit, OnDestroy {
|
|
40
|
+
export declare class CreateSubAgentDialogComponent extends BaseAngularComponent implements OnInit, OnDestroy {
|
|
40
41
|
private cdr;
|
|
41
42
|
private agentManagementService;
|
|
42
43
|
private viewContainerRef;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-sub-agent-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/AIAgents/create-sub-agent-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAU,YAAY,EAAE,MAAM,eAAe,CAAC;AACxH,OAAO,EAAe,SAAS,EAAc,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAa,MAAM,MAAM,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAElI,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC
|
|
1
|
+
{"version":3,"file":"create-sub-agent-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/AIAgents/create-sub-agent-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAU,YAAY,EAAE,MAAM,eAAe,CAAC;AACxH,OAAO,EAAe,SAAS,EAAc,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAa,MAAM,MAAM,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAElI,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AACrE,MAAM,WAAW,oBAAoB;IACnC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,QAAQ,EAAE,uBAAuB,CAAC;IAClC,yDAAyD;IACzD,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACvC,yDAAyD;IACzD,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACvC,gDAAgD;IAChD,UAAU,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACxC,yDAAyD;IACzD,kBAAkB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC3B,0DAA0D;IA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I,MAAM,CAErC;IAED,IAAW,iBAAiB,IAAI,MAAM,CAErC;yCAhgBU,6BAA6B;2CAA7B,6BAA6B;CAigBzC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Component, Output, EventEmitter } from '@angular/core';
|
|
2
2
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
|
3
3
|
import { Subject, BehaviorSubject, takeUntil } from 'rxjs';
|
|
4
|
-
import {
|
|
4
|
+
import { RunView } from '@memberjunction/core';
|
|
5
5
|
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
6
6
|
import { UUIDsEqual } from '@memberjunction/global';
|
|
7
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
import * as i1 from "./ai-agent-management.service";
|
|
9
10
|
import * as i2 from "@angular/forms";
|
|
@@ -284,8 +285,9 @@ function CreateSubAgentDialogComponent_Conditional_18_Template(rf, ctx) { if (rf
|
|
|
284
285
|
* Creates entities but does not save them - returns entities for parent to add to PendingRecords.
|
|
285
286
|
* This ensures atomicity with the parent form's save operation.
|
|
286
287
|
*/
|
|
287
|
-
export class CreateSubAgentDialogComponent {
|
|
288
|
+
export class CreateSubAgentDialogComponent extends BaseAngularComponent {
|
|
288
289
|
constructor(cdr, agentManagementService, viewContainerRef) {
|
|
290
|
+
super();
|
|
289
291
|
this.cdr = cdr;
|
|
290
292
|
this.agentManagementService = agentManagementService;
|
|
291
293
|
this.viewContainerRef = viewContainerRef;
|
|
@@ -352,7 +354,7 @@ export class CreateSubAgentDialogComponent {
|
|
|
352
354
|
async loadInitialData() {
|
|
353
355
|
this.isLoading$.next(true);
|
|
354
356
|
try {
|
|
355
|
-
const rv =
|
|
357
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
356
358
|
// Load all data in a single batch for better performance
|
|
357
359
|
const results = await rv.RunViews([
|
|
358
360
|
// Agent types (index 0)
|
|
@@ -396,7 +398,7 @@ export class CreateSubAgentDialogComponent {
|
|
|
396
398
|
this.availableActions$.next(actionsResult.Results);
|
|
397
399
|
}
|
|
398
400
|
// Create the sub-agent entity
|
|
399
|
-
const md =
|
|
401
|
+
const md = this.ProviderToUse;
|
|
400
402
|
this.subAgentEntity = await md.GetEntityObject('MJ: AI Agents');
|
|
401
403
|
this.subAgentEntity.NewRecord();
|
|
402
404
|
// Set default values
|
|
@@ -462,7 +464,7 @@ export class CreateSubAgentDialogComponent {
|
|
|
462
464
|
// Add to UI
|
|
463
465
|
this.linkedPrompts.push(...newPrompts);
|
|
464
466
|
// Create agent prompt link entities
|
|
465
|
-
const md =
|
|
467
|
+
const md = this.ProviderToUse;
|
|
466
468
|
for (const prompt of newPrompts) {
|
|
467
469
|
const agentPrompt = await md.GetEntityObject('MJ: AI Agent Prompts');
|
|
468
470
|
agentPrompt.NewRecord();
|
|
@@ -514,7 +516,7 @@ export class CreateSubAgentDialogComponent {
|
|
|
514
516
|
// Add to UI
|
|
515
517
|
this.linkedPrompts.push(result.prompt);
|
|
516
518
|
// Create agent prompt link entity
|
|
517
|
-
const md =
|
|
519
|
+
const md = this.ProviderToUse;
|
|
518
520
|
const agentPrompt = await md.GetEntityObject('MJ: AI Agent Prompts');
|
|
519
521
|
agentPrompt.NewRecord();
|
|
520
522
|
agentPrompt.AgentID = this.subAgentEntity.ID;
|
|
@@ -561,7 +563,7 @@ export class CreateSubAgentDialogComponent {
|
|
|
561
563
|
// Add to UI
|
|
562
564
|
this.linkedActions.push(...newActions);
|
|
563
565
|
// Create agent action link entities
|
|
564
|
-
const md =
|
|
566
|
+
const md = this.ProviderToUse;
|
|
565
567
|
for (const action of newActions) {
|
|
566
568
|
const agentAction = await md.GetEntityObject('MJ: AI Agent Actions');
|
|
567
569
|
agentAction.NewRecord();
|
|
@@ -670,7 +672,7 @@ export class CreateSubAgentDialogComponent {
|
|
|
670
672
|
return this.linkedActions.length;
|
|
671
673
|
}
|
|
672
674
|
static { this.ɵfac = function CreateSubAgentDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CreateSubAgentDialogComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.AIAgentManagementService), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); }; }
|
|
673
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CreateSubAgentDialogComponent, selectors: [["mj-create-sub-agent-dialog"]], outputs: { DialogClose: "DialogClose" }, standalone: false, decls: 19, vars: 14, consts: [[1, "sub-agent-dialog"], [1, "sub-agent-header"], [1, "dialog-title"], [1, "fa-solid", "fa-robot"], [1, "parent-info"], [1, "loading-container"], [1, "sub-agent-form", 3, "formGroup"], [1, "dialog-actions"], ["type", "button", 1, "btn", "btn-secondary", 3, "click", "disabled"], [1, "fa-solid", "fa-times"], ["type", "button", 1, "btn", "btn-primary", 3, "click", "disabled"], [1, "fa-solid", "fa-link"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "form-section"], [1, "section-title"], [1, "fa-solid", "fa-info-circle"], [1, "form-row"], [1, "form-group"], ["for", "name"], ["type", "text", "id", "name", "formControlName", "name", "placeholder", "Enter sub-agent name", 1, "form-control"], ["for", "typeID"], ["id", "typeID", "formControlName", "typeID", 1, "form-control"], ["value", ""], [3, "value"], ["for", "description"], ["id", "description", "formControlName", "description", "rows", "2", "placeholder", "Enter description", 1, "form-control"], ["for", "status"], ["id", "status", "formControlName", "status", 1, "form-control"], ["value", "Pending"], ["value", "Active"], ["value", "Disabled"], ["for", "executionMode"], ["id", "executionMode", "formControlName", "executionMode", 1, "form-control"], ["value", "Sequential"], ["value", "Parallel"], [1, "fa-solid", "fa-bullseye"], ["for", "purpose"], ["type", "text", "id", "purpose", "formControlName", "purpose", "placeholder", "Enter the purpose of this sub-agent", 1, "form-control"], ["for", "userMessage"], ["id", "userMessage", "formControlName", "userMessage", "rows", "3", "placeholder", "Enter user message", 1, "form-control"], [1, "fa-solid", "fa-cogs"], ["for", "modelSelectionMode"], ["id", "modelSelectionMode", "formControlName", "modelSelectionMode", 1, "form-control"], ["value", "Agent Type"], ["value", "Agent"], ["for", "temperature"], ["type", "number", "id", "temperature", "formControlName", "temperature", "min", "0", "max", "2", "step", "0.1", 1, "form-control"], ["for", "topP"], ["type", "number", "id", "topP", "formControlName", "topP", "min", "0", "max", "1", "step", "0.1", 1, "form-control"], ["for", "topK"], ["type", "number", "id", "topK", "formControlName", "topK", "min", "1", "max", "100", "step", "1", 1, "form-control"], ["for", "maxTokens"], ["type", "number", "id", "maxTokens", "formControlName", "maxTokens", "min", "1", "max", "32000", "step", "1", 1, "form-control"], ["for", "enableCaching"], ["type", "checkbox", "id", "enableCaching", "formControlName", "enableCaching"], ["for", "cacheTTL"], ["type", "number", "id", "cacheTTL", "formControlName", "cacheTTL", "min", "60", "max", "86400", "step", "60", 1, "form-control"], [1, "fa-solid", "fa-comments"], [1, "section-actions"], ["type", "button", 1, "btn", "btn-primary", "btn-sm", 3, "click"], [1, "fa-solid", "fa-plus"], ["type", "button", 1, "btn", "btn-success", "btn-sm", 3, "click"], [1, "linked-items"], [1, "empty-state"], [1, "fa-solid", "fa-bolt"], [1, "linked-item", "prompt-item"], [1, "item-info"], [1, "item-name"], [1, "item-description"], ["type", "button", 1, "btn", "btn-danger", "btn-xs", 3, "click"], [1, "linked-item", "action-item"], [1, "fa-solid", "fa-save"]], template: function CreateSubAgentDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
675
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CreateSubAgentDialogComponent, selectors: [["mj-create-sub-agent-dialog"]], outputs: { DialogClose: "DialogClose" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 19, vars: 14, consts: [[1, "sub-agent-dialog"], [1, "sub-agent-header"], [1, "dialog-title"], [1, "fa-solid", "fa-robot"], [1, "parent-info"], [1, "loading-container"], [1, "sub-agent-form", 3, "formGroup"], [1, "dialog-actions"], ["type", "button", 1, "btn", "btn-secondary", 3, "click", "disabled"], [1, "fa-solid", "fa-times"], ["type", "button", 1, "btn", "btn-primary", 3, "click", "disabled"], [1, "fa-solid", "fa-link"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "form-section"], [1, "section-title"], [1, "fa-solid", "fa-info-circle"], [1, "form-row"], [1, "form-group"], ["for", "name"], ["type", "text", "id", "name", "formControlName", "name", "placeholder", "Enter sub-agent name", 1, "form-control"], ["for", "typeID"], ["id", "typeID", "formControlName", "typeID", 1, "form-control"], ["value", ""], [3, "value"], ["for", "description"], ["id", "description", "formControlName", "description", "rows", "2", "placeholder", "Enter description", 1, "form-control"], ["for", "status"], ["id", "status", "formControlName", "status", 1, "form-control"], ["value", "Pending"], ["value", "Active"], ["value", "Disabled"], ["for", "executionMode"], ["id", "executionMode", "formControlName", "executionMode", 1, "form-control"], ["value", "Sequential"], ["value", "Parallel"], [1, "fa-solid", "fa-bullseye"], ["for", "purpose"], ["type", "text", "id", "purpose", "formControlName", "purpose", "placeholder", "Enter the purpose of this sub-agent", 1, "form-control"], ["for", "userMessage"], ["id", "userMessage", "formControlName", "userMessage", "rows", "3", "placeholder", "Enter user message", 1, "form-control"], [1, "fa-solid", "fa-cogs"], ["for", "modelSelectionMode"], ["id", "modelSelectionMode", "formControlName", "modelSelectionMode", 1, "form-control"], ["value", "Agent Type"], ["value", "Agent"], ["for", "temperature"], ["type", "number", "id", "temperature", "formControlName", "temperature", "min", "0", "max", "2", "step", "0.1", 1, "form-control"], ["for", "topP"], ["type", "number", "id", "topP", "formControlName", "topP", "min", "0", "max", "1", "step", "0.1", 1, "form-control"], ["for", "topK"], ["type", "number", "id", "topK", "formControlName", "topK", "min", "1", "max", "100", "step", "1", 1, "form-control"], ["for", "maxTokens"], ["type", "number", "id", "maxTokens", "formControlName", "maxTokens", "min", "1", "max", "32000", "step", "1", 1, "form-control"], ["for", "enableCaching"], ["type", "checkbox", "id", "enableCaching", "formControlName", "enableCaching"], ["for", "cacheTTL"], ["type", "number", "id", "cacheTTL", "formControlName", "cacheTTL", "min", "60", "max", "86400", "step", "60", 1, "form-control"], [1, "fa-solid", "fa-comments"], [1, "section-actions"], ["type", "button", 1, "btn", "btn-primary", "btn-sm", 3, "click"], [1, "fa-solid", "fa-plus"], ["type", "button", 1, "btn", "btn-success", "btn-sm", 3, "click"], [1, "linked-items"], [1, "empty-state"], [1, "fa-solid", "fa-bolt"], [1, "linked-item", "prompt-item"], [1, "item-info"], [1, "item-name"], [1, "item-description"], ["type", "button", 1, "btn", "btn-danger", "btn-xs", 3, "click"], [1, "linked-item", "action-item"], [1, "fa-solid", "fa-save"]], template: function CreateSubAgentDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
674
676
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h2", 2);
|
|
675
677
|
i0.ɵɵelement(3, "i", 3);
|
|
676
678
|
i0.ɵɵtext(4);
|
|
@@ -714,5 +716,5 @@ export class CreateSubAgentDialogComponent {
|
|
|
714
716
|
}], () => [{ type: i0.ChangeDetectorRef }, { type: i1.AIAgentManagementService }, { type: i0.ViewContainerRef }], { DialogClose: [{
|
|
715
717
|
type: Output
|
|
716
718
|
}] }); })();
|
|
717
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CreateSubAgentDialogComponent, { className: "CreateSubAgentDialogComponent", filePath: "src/lib/custom/AIAgents/create-sub-agent-dialog.component.ts", lineNumber:
|
|
719
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CreateSubAgentDialogComponent, { className: "CreateSubAgentDialogComponent", filePath: "src/lib/custom/AIAgents/create-sub-agent-dialog.component.ts", lineNumber: 50 }); })();
|
|
718
720
|
//# sourceMappingURL=create-sub-agent-dialog.component.js.map
|