@memberjunction/ng-flow-editor 5.4.0 → 5.5.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/agent-editor/agent-flow-transformer.service.d.ts.map +1 -1
- package/dist/lib/agent-editor/agent-flow-transformer.service.js +9 -8
- package/dist/lib/agent-editor/agent-flow-transformer.service.js.map +1 -1
- package/dist/lib/agent-editor/agent-properties-panel.component.d.ts.map +1 -1
- package/dist/lib/agent-editor/agent-properties-panel.component.js +7 -6
- package/dist/lib/agent-editor/agent-properties-panel.component.js.map +1 -1
- package/dist/lib/agent-editor/agent-step-list.component.d.ts +1 -0
- package/dist/lib/agent-editor/agent-step-list.component.d.ts.map +1 -1
- package/dist/lib/agent-editor/agent-step-list.component.js +7 -3
- package/dist/lib/agent-editor/agent-step-list.component.js.map +1 -1
- package/dist/lib/agent-editor/flow-agent-editor.component.d.ts.map +1 -1
- package/dist/lib/agent-editor/flow-agent-editor.component.js +17 -16
- package/dist/lib/agent-editor/flow-agent-editor.component.js.map +1 -1
- package/dist/lib/components/flow-editor.component.d.ts.map +1 -1
- package/dist/lib/components/flow-editor.component.js +34 -33
- package/dist/lib/components/flow-editor.component.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-step-list.component.d.ts","sourceRoot":"","sources":["../../../src/lib/agent-editor/agent-step-list.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAA8C,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;;
|
|
1
|
+
{"version":3,"file":"agent-step-list.component.d.ts","sourceRoot":"","sources":["../../../src/lib/agent-editor/agent-step-list.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAA8C,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;;AAG7F;;;GAGG;AACH,qBA+Ma,sBAAsB;IACxB,KAAK,EAAE,mBAAmB,EAAE,CAAM;IAClC,KAAK,EAAE,uBAAuB,EAAE,CAAM;IACtC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEpC,WAAW,oCAA2C;IAEhE,cAAc,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO;IAIlD,iBAAiB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM;yCAXzC,sBAAsB;2CAAtB,sBAAsB;CAqBlC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component, Input, Output, EventEmitter, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { UUIDsEqual } from '@memberjunction/global';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
function AgentStepListComponent_Conditional_7_For_15_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
4
5
|
i0.ɵɵelement(0, "i", 13);
|
|
@@ -25,7 +26,7 @@ function AgentStepListComponent_Conditional_7_For_15_Template(rf, ctx) { if (rf
|
|
|
25
26
|
} if (rf & 2) {
|
|
26
27
|
const step_r2 = ctx.$implicit;
|
|
27
28
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
28
|
-
i0.ɵɵclassProp("mj-step-list-row--selected", ctx_r2.
|
|
29
|
+
i0.ɵɵclassProp("mj-step-list-row--selected", ctx_r2.IsStepSelected(step_r2));
|
|
29
30
|
i0.ɵɵadvance(2);
|
|
30
31
|
i0.ɵɵtextInterpolate(step_r2.Name);
|
|
31
32
|
i0.ɵɵadvance(2);
|
|
@@ -129,6 +130,9 @@ export class AgentStepListComponent {
|
|
|
129
130
|
Paths = [];
|
|
130
131
|
SelectedStepID = null;
|
|
131
132
|
StepClicked = new EventEmitter();
|
|
133
|
+
IsStepSelected(step) {
|
|
134
|
+
return UUIDsEqual(this.SelectedStepID, step.ID);
|
|
135
|
+
}
|
|
132
136
|
getConfiguredItem(step) {
|
|
133
137
|
switch (step.StepType) {
|
|
134
138
|
case 'Action': return step.Action || '—';
|
|
@@ -196,7 +200,7 @@ export class AgentStepListComponent {
|
|
|
196
200
|
<tbody>
|
|
197
201
|
@for (step of Steps; track step) {
|
|
198
202
|
<tr
|
|
199
|
-
[class.mj-step-list-row--selected]="
|
|
203
|
+
[class.mj-step-list-row--selected]="IsStepSelected(step)"
|
|
200
204
|
(click)="StepClicked.emit(step)">
|
|
201
205
|
<td class="mj-step-list-name">{{ step.Name }}</td>
|
|
202
206
|
<td>
|
|
@@ -274,5 +278,5 @@ export class AgentStepListComponent {
|
|
|
274
278
|
}], StepClicked: [{
|
|
275
279
|
type: Output
|
|
276
280
|
}] }); })();
|
|
277
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AgentStepListComponent, { className: "AgentStepListComponent", filePath: "src/lib/agent-editor/agent-step-list.component.ts", lineNumber:
|
|
281
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AgentStepListComponent, { className: "AgentStepListComponent", filePath: "src/lib/agent-editor/agent-step-list.component.ts", lineNumber: 216 }); })();
|
|
278
282
|
//# sourceMappingURL=agent-step-list.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-step-list.component.js","sourceRoot":"","sources":["../../../src/lib/agent-editor/agent-step-list.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;;;IA+C3F,wBAAoD;;;;IAhB1D,6BAEmC;IAAjC,wNAAS,gCAAsB,KAAC;IAChC,8BAA8B;IAAA,YAAe;IAAA,iBAAK;IAEhD,AADF,0BAAI,eACqE;IACrE,YACF;IACF,AADE,iBAAO,EACJ;IAEH,AADF,0BAAI,eACiE;IACjE,YACF;IACF,AADE,iBAAO,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;YAJD,kDAIC;;;iFAsHE,sBAAsB;cA/MlC,SAAS;6BACI,KAAK,YACP,oBAAoB,YACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0FP,iBA+GY,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM;;kBAG9C,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kFALI,sBAAsB","sourcesContent":["import { Component, Input, Output, EventEmitter, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';\nimport { MJAIAgentStepEntity, MJAIAgentStepPathEntity } from '@memberjunction/core-entities';\n\n/**\n * Tabular list view of agent steps and paths.\n * Alternative to the visual flow canvas — useful for quick overview and bulk editing.\n */\n@Component({\n standalone: false,\n selector: 'mj-agent-step-list',\n template: `\n <div class=\"mj-step-list\">\n <!-- Steps Section -->\n <div class=\"mj-step-list-section\">\n <div class=\"mj-step-list-section-header\">\n <h4><i class=\"fa-solid fa-circle-nodes\"></i> Steps ({{ Steps.length }})</h4>\n </div>\n <div class=\"mj-step-list-table-wrap\">\n @if (Steps.length > 0) {\n <table class=\"mj-step-list-table\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Type</th>\n <th>Status</th>\n <th>Start</th>\n <th>Configured</th>\n </tr>\n </thead>\n <tbody>\n @for (step of Steps; track step) {\n <tr\n [class.mj-step-list-row--selected]=\"SelectedStepID === step.ID\"\n (click)=\"StepClicked.emit(step)\">\n <td class=\"mj-step-list-name\">{{ step.Name }}</td>\n <td>\n <span class=\"mj-step-list-type-badge\" [attr.data-type]=\"step.StepType\">\n {{ step.StepType }}\n </span>\n </td>\n <td>\n <span class=\"mj-step-list-status\" [attr.data-status]=\"step.Status\">\n {{ step.Status }}\n </span>\n </td>\n <td>\n @if (step.StartingStep) {\n <i class=\"fa-solid fa-check mj-step-list-check\"></i>\n }\n </td>\n <td class=\"mj-step-list-configured\">{{ getConfiguredItem(step) }}</td>\n </tr>\n }\n </tbody>\n </table>\n }\n @if (Steps.length === 0) {\n <div class=\"mj-step-list-empty\">\n No steps defined\n </div>\n }\n </div>\n </div>\n \n <!-- Paths Section -->\n <div class=\"mj-step-list-section\">\n <div class=\"mj-step-list-section-header\">\n <h4><i class=\"fa-solid fa-link\"></i> Paths ({{ Paths.length }})</h4>\n </div>\n <div class=\"mj-step-list-table-wrap\">\n @if (Paths.length > 0) {\n <table class=\"mj-step-list-table\">\n <thead>\n <tr>\n <th>From</th>\n <th>To</th>\n <th>Condition</th>\n <th>Priority</th>\n </tr>\n </thead>\n <tbody>\n @for (path of Paths; track path) {\n <tr>\n <td>{{ path.OriginStep }}</td>\n <td>{{ path.DestinationStep }}</td>\n <td class=\"mj-step-list-condition\">{{ path.Condition || '(always)' }}</td>\n <td>{{ path.Priority }}</td>\n </tr>\n }\n </tbody>\n </table>\n }\n @if (Paths.length === 0) {\n <div class=\"mj-step-list-empty\">\n No paths defined\n </div>\n }\n </div>\n </div>\n </div>\n `,\n styles: [`\n .mj-step-list {\n padding: 16px;\n overflow-y: auto;\n height: 100%;\n }\n\n .mj-step-list-section {\n margin-bottom: 24px;\n }\n\n .mj-step-list-section-header h4 {\n font-size: 14px;\n font-weight: 600;\n color: #334155;\n margin: 0 0 10px;\n display: flex;\n align-items: center;\n gap: 8px;\n i { font-size: 13px; color: #64748b; }\n }\n\n .mj-step-list-table-wrap {\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n overflow: hidden;\n }\n\n .mj-step-list-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 13px;\n\n th {\n background: #f8fafc;\n padding: 8px 12px;\n text-align: left;\n font-weight: 600;\n color: #64748b;\n font-size: 11px;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n border-bottom: 1px solid #e2e8f0;\n }\n\n td {\n padding: 8px 12px;\n color: #334155;\n border-bottom: 1px solid #f1f5f9;\n }\n\n tbody tr {\n cursor: pointer;\n transition: background-color 0.1s ease;\n &:hover { background: #f8fafc; }\n &:last-child td { border-bottom: none; }\n }\n }\n\n .mj-step-list-row--selected {\n background: #eff6ff !important;\n }\n\n .mj-step-list-name { font-weight: 500; }\n\n .mj-step-list-type-badge {\n font-size: 11px;\n font-weight: 500;\n padding: 2px 8px;\n border-radius: 4px;\n background: #f1f5f9;\n color: #475569;\n }\n\n .mj-step-list-status {\n font-size: 11px;\n font-weight: 500;\n &[data-status=\"Active\"] { color: #10b981; }\n &[data-status=\"Disabled\"] { color: #94a3b8; }\n &[data-status=\"Pending\"] { color: #f59e0b; }\n }\n\n .mj-step-list-check { color: #10b981; font-size: 12px; }\n\n .mj-step-list-configured {\n color: #64748b;\n font-size: 12px;\n max-width: 200px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .mj-step-list-condition {\n font-family: 'SF Mono', monospace;\n font-size: 11px;\n color: #64748b;\n max-width: 200px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .mj-step-list-empty {\n padding: 24px;\n text-align: center;\n color: #94a3b8;\n font-size: 13px;\n }\n `],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AgentStepListComponent {\n @Input() Steps: MJAIAgentStepEntity[] = [];\n @Input() Paths: MJAIAgentStepPathEntity[] = [];\n @Input() SelectedStepID: string | null = null;\n\n @Output() StepClicked = new EventEmitter<MJAIAgentStepEntity>();\n\n getConfiguredItem(step: MJAIAgentStepEntity): string {\n switch (step.StepType) {\n case 'Action': return step.Action || '—';\n case 'Prompt': return step.Prompt || '—';\n case 'Sub-Agent': return step.SubAgent || '—';\n case 'ForEach':\n case 'While': return `${step.LoopBodyType ?? 'Action'} loop`;\n default: return '—';\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"agent-step-list.component.js","sourceRoot":"","sources":["../../../src/lib/agent-editor/agent-step-list.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,S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,AADF,AAFF,8BAA0B,aAEU,aACS,SACnC;YAAA,uBAAwC;YAAC,YAA0B;YACzE,AADyE,iBAAK,EACxE;YACN,8BAAqC;YACnC,2FAAwB;YAsCxB,wFAA0B;YAM9B,AADE,iBAAM,EACF;YAKF,AADF,AADF,8BAAkC,cACS,UACnC;YAAA,wBAAgC;YAAC,aAA0B;YACjE,AADiE,iBAAK,EAChE;YACN,+BAAqC;YACnC,6FAAwB;YAsBxB,0FAA0B;YAOhC,AADE,AADE,iBAAM,EACF,EACF;;YApF6C,eAA0B;YAA1B,wDAA0B;YAGvE,eAqCC;YArCD,+CAqCC;YACD,cAIC;YAJD,iDAIC;YAOoC,eAA0B;YAA1B,wDAA0B;YAG/D,eAqBC;YArBD,gDAqBC;YACD,cAIC;YAJD,kDAIC;;;iFAsHE,sBAAsB;cA/MlC,SAAS;6BACI,KAAK,YACP,oBAAoB,YACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0FP,iBA+GY,iBAAiB,CAAC,IAAI,mBACpB,uBAAuB,CAAC,MAAM;;kBAG9C,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kFALI,sBAAsB","sourcesContent":["import { Component, Input, Output, EventEmitter, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';\nimport { MJAIAgentStepEntity, MJAIAgentStepPathEntity } from '@memberjunction/core-entities';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/**\n * Tabular list view of agent steps and paths.\n * Alternative to the visual flow canvas — useful for quick overview and bulk editing.\n */\n@Component({\n standalone: false,\n selector: 'mj-agent-step-list',\n template: `\n <div class=\"mj-step-list\">\n <!-- Steps Section -->\n <div class=\"mj-step-list-section\">\n <div class=\"mj-step-list-section-header\">\n <h4><i class=\"fa-solid fa-circle-nodes\"></i> Steps ({{ Steps.length }})</h4>\n </div>\n <div class=\"mj-step-list-table-wrap\">\n @if (Steps.length > 0) {\n <table class=\"mj-step-list-table\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Type</th>\n <th>Status</th>\n <th>Start</th>\n <th>Configured</th>\n </tr>\n </thead>\n <tbody>\n @for (step of Steps; track step) {\n <tr\n [class.mj-step-list-row--selected]=\"IsStepSelected(step)\"\n (click)=\"StepClicked.emit(step)\">\n <td class=\"mj-step-list-name\">{{ step.Name }}</td>\n <td>\n <span class=\"mj-step-list-type-badge\" [attr.data-type]=\"step.StepType\">\n {{ step.StepType }}\n </span>\n </td>\n <td>\n <span class=\"mj-step-list-status\" [attr.data-status]=\"step.Status\">\n {{ step.Status }}\n </span>\n </td>\n <td>\n @if (step.StartingStep) {\n <i class=\"fa-solid fa-check mj-step-list-check\"></i>\n }\n </td>\n <td class=\"mj-step-list-configured\">{{ getConfiguredItem(step) }}</td>\n </tr>\n }\n </tbody>\n </table>\n }\n @if (Steps.length === 0) {\n <div class=\"mj-step-list-empty\">\n No steps defined\n </div>\n }\n </div>\n </div>\n \n <!-- Paths Section -->\n <div class=\"mj-step-list-section\">\n <div class=\"mj-step-list-section-header\">\n <h4><i class=\"fa-solid fa-link\"></i> Paths ({{ Paths.length }})</h4>\n </div>\n <div class=\"mj-step-list-table-wrap\">\n @if (Paths.length > 0) {\n <table class=\"mj-step-list-table\">\n <thead>\n <tr>\n <th>From</th>\n <th>To</th>\n <th>Condition</th>\n <th>Priority</th>\n </tr>\n </thead>\n <tbody>\n @for (path of Paths; track path) {\n <tr>\n <td>{{ path.OriginStep }}</td>\n <td>{{ path.DestinationStep }}</td>\n <td class=\"mj-step-list-condition\">{{ path.Condition || '(always)' }}</td>\n <td>{{ path.Priority }}</td>\n </tr>\n }\n </tbody>\n </table>\n }\n @if (Paths.length === 0) {\n <div class=\"mj-step-list-empty\">\n No paths defined\n </div>\n }\n </div>\n </div>\n </div>\n `,\n styles: [`\n .mj-step-list {\n padding: 16px;\n overflow-y: auto;\n height: 100%;\n }\n\n .mj-step-list-section {\n margin-bottom: 24px;\n }\n\n .mj-step-list-section-header h4 {\n font-size: 14px;\n font-weight: 600;\n color: #334155;\n margin: 0 0 10px;\n display: flex;\n align-items: center;\n gap: 8px;\n i { font-size: 13px; color: #64748b; }\n }\n\n .mj-step-list-table-wrap {\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n overflow: hidden;\n }\n\n .mj-step-list-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 13px;\n\n th {\n background: #f8fafc;\n padding: 8px 12px;\n text-align: left;\n font-weight: 600;\n color: #64748b;\n font-size: 11px;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n border-bottom: 1px solid #e2e8f0;\n }\n\n td {\n padding: 8px 12px;\n color: #334155;\n border-bottom: 1px solid #f1f5f9;\n }\n\n tbody tr {\n cursor: pointer;\n transition: background-color 0.1s ease;\n &:hover { background: #f8fafc; }\n &:last-child td { border-bottom: none; }\n }\n }\n\n .mj-step-list-row--selected {\n background: #eff6ff !important;\n }\n\n .mj-step-list-name { font-weight: 500; }\n\n .mj-step-list-type-badge {\n font-size: 11px;\n font-weight: 500;\n padding: 2px 8px;\n border-radius: 4px;\n background: #f1f5f9;\n color: #475569;\n }\n\n .mj-step-list-status {\n font-size: 11px;\n font-weight: 500;\n &[data-status=\"Active\"] { color: #10b981; }\n &[data-status=\"Disabled\"] { color: #94a3b8; }\n &[data-status=\"Pending\"] { color: #f59e0b; }\n }\n\n .mj-step-list-check { color: #10b981; font-size: 12px; }\n\n .mj-step-list-configured {\n color: #64748b;\n font-size: 12px;\n max-width: 200px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .mj-step-list-condition {\n font-family: 'SF Mono', monospace;\n font-size: 11px;\n color: #64748b;\n max-width: 200px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .mj-step-list-empty {\n padding: 24px;\n text-align: center;\n color: #94a3b8;\n font-size: 13px;\n }\n `],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AgentStepListComponent {\n @Input() Steps: MJAIAgentStepEntity[] = [];\n @Input() Paths: MJAIAgentStepPathEntity[] = [];\n @Input() SelectedStepID: string | null = null;\n\n @Output() StepClicked = new EventEmitter<MJAIAgentStepEntity>();\n\n IsStepSelected(step: MJAIAgentStepEntity): boolean {\n return UUIDsEqual(this.SelectedStepID, step.ID);\n }\n\n getConfiguredItem(step: MJAIAgentStepEntity): string {\n switch (step.StepType) {\n case 'Action': return step.Action || '—';\n case 'Prompt': return step.Prompt || '—';\n case 'Sub-Agent': return step.SubAgent || '—';\n case 'ForEach':\n case 'While': return `${step.LoopBodyType ?? 'Action'} loop`;\n default: return '—';\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-agent-editor.component.d.ts","sourceRoot":"","sources":["../../../src/lib/agent-editor/flow-agent-editor.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACqB,YAAY,EAAa,MAAM,EAAE,SAAS,EAAE,SAAS,EAC/E,aAAa,EAAE,iBAAiB,EAChC,UAAU,EAAE,SAAS,EACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAkB,MAAM,+BAA+B,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACvK,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAA2B,MAAM,kCAAkC,CAAC;;
|
|
1
|
+
{"version":3,"file":"flow-agent-editor.component.d.ts","sourceRoot":"","sources":["../../../src/lib/agent-editor/flow-agent-editor.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACqB,YAAY,EAAa,MAAM,EAAE,SAAS,EAAE,SAAS,EAC/E,aAAa,EAAE,iBAAiB,EAChC,UA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BN,wBAAwB;2CAAxB,wBAAwB;CAixBpC"}
|
|
@@ -2,6 +2,7 @@ import { Component, Input, Output, EventEmitter, ViewChild, ViewEncapsulation, H
|
|
|
2
2
|
import { Metadata, RunView, CompositeKey } from '@memberjunction/core';
|
|
3
3
|
import { UserInfoEngine } from '@memberjunction/core-entities';
|
|
4
4
|
import { AgentFlowTransformerService, AGENT_STEP_TYPE_CONFIGS } from './agent-flow-transformer.service';
|
|
5
|
+
import { UUIDsEqual } from '@memberjunction/global';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
import * as i1 from "./agent-flow-transformer.service";
|
|
7
8
|
import * as i2 from "@angular/common";
|
|
@@ -441,7 +442,7 @@ export class FlowAgentEditorComponent {
|
|
|
441
442
|
* Called on every node move so that rebuildFlowModel() never loses drag changes. */
|
|
442
443
|
syncPositionsToEntities() {
|
|
443
444
|
for (const node of this.nodes) {
|
|
444
|
-
const step = this.steps.find(s => s.ID
|
|
445
|
+
const step = this.steps.find(s => UUIDsEqual(s.ID, node.ID));
|
|
445
446
|
if (step) {
|
|
446
447
|
this.transformer.ApplyNodePosition(step, node);
|
|
447
448
|
}
|
|
@@ -497,7 +498,7 @@ export class FlowAgentEditorComponent {
|
|
|
497
498
|
if (!this.AgentID)
|
|
498
499
|
return;
|
|
499
500
|
// Prevent duplicate
|
|
500
|
-
const exists = this.paths.some(p => p.OriginStepID
|
|
501
|
+
const exists = this.paths.some(p => UUIDsEqual(p.OriginStepID, event.SourceNodeID) && UUIDsEqual(p.DestinationStepID, event.TargetNodeID));
|
|
501
502
|
if (exists)
|
|
502
503
|
return;
|
|
503
504
|
const md = new Metadata();
|
|
@@ -514,7 +515,7 @@ export class FlowAgentEditorComponent {
|
|
|
514
515
|
}
|
|
515
516
|
onNodeSelected(node) {
|
|
516
517
|
if (node) {
|
|
517
|
-
this.selectedStep = this.steps.find(s => s.ID
|
|
518
|
+
this.selectedStep = this.steps.find(s => UUIDsEqual(s.ID, node.ID)) ?? null;
|
|
518
519
|
this.selectedConnection = null;
|
|
519
520
|
this.selectedPathEntity = null;
|
|
520
521
|
this.showPropertiesPanel = true;
|
|
@@ -536,7 +537,7 @@ export class FlowAgentEditorComponent {
|
|
|
536
537
|
onConnectionSelected(conn) {
|
|
537
538
|
if (conn) {
|
|
538
539
|
this.selectedConnection = conn;
|
|
539
|
-
this.selectedPathEntity = this.paths.find(p => p.ID
|
|
540
|
+
this.selectedPathEntity = this.paths.find(p => UUIDsEqual(p.ID, conn.ID)) ?? null;
|
|
540
541
|
this.selectedStep = null;
|
|
541
542
|
this.showPropertiesPanel = true;
|
|
542
543
|
}
|
|
@@ -547,36 +548,36 @@ export class FlowAgentEditorComponent {
|
|
|
547
548
|
this.cdr.detectChanges();
|
|
548
549
|
}
|
|
549
550
|
onNodeRemoved(node) {
|
|
550
|
-
const step = this.steps.find(s => s.ID
|
|
551
|
+
const step = this.steps.find(s => UUIDsEqual(s.ID, node.ID));
|
|
551
552
|
if (step) {
|
|
552
553
|
// Track for deletion on save (only if it was previously saved)
|
|
553
554
|
if (step.IsSaved) {
|
|
554
555
|
this.deletedStepIDs.push(step.ID);
|
|
555
556
|
// Also mark paths connected to this step for deletion
|
|
556
|
-
const connectedPaths = this.paths.filter(p => p.OriginStepID
|
|
557
|
+
const connectedPaths = this.paths.filter(p => UUIDsEqual(p.OriginStepID, step.ID) || UUIDsEqual(p.DestinationStepID, step.ID));
|
|
557
558
|
for (const path of connectedPaths) {
|
|
558
559
|
if (path.IsSaved) {
|
|
559
560
|
this.deletedPathIDs.push(path.ID);
|
|
560
561
|
}
|
|
561
562
|
}
|
|
562
563
|
}
|
|
563
|
-
this.steps = this.steps.filter(s => s.ID
|
|
564
|
-
this.paths = this.paths.filter(p => p.OriginStepID
|
|
564
|
+
this.steps = this.steps.filter(s => !UUIDsEqual(s.ID, node.ID));
|
|
565
|
+
this.paths = this.paths.filter(p => !UUIDsEqual(p.OriginStepID, node.ID) && !UUIDsEqual(p.DestinationStepID, node.ID));
|
|
565
566
|
this.markDirty();
|
|
566
567
|
}
|
|
567
568
|
}
|
|
568
569
|
onConnectionRemoved(conn) {
|
|
569
|
-
const path = this.paths.find(p => p.ID
|
|
570
|
+
const path = this.paths.find(p => UUIDsEqual(p.ID, conn.ID));
|
|
570
571
|
if (path) {
|
|
571
572
|
if (path.IsSaved) {
|
|
572
573
|
this.deletedPathIDs.push(path.ID);
|
|
573
574
|
}
|
|
574
|
-
this.paths = this.paths.filter(p => p.ID
|
|
575
|
+
this.paths = this.paths.filter(p => !UUIDsEqual(p.ID, conn.ID));
|
|
575
576
|
this.markDirty();
|
|
576
577
|
}
|
|
577
578
|
}
|
|
578
579
|
onConnectionReassigned(event) {
|
|
579
|
-
const path = this.paths.find(p => p.ID
|
|
580
|
+
const path = this.paths.find(p => UUIDsEqual(p.ID, event.ConnectionID));
|
|
580
581
|
if (!path)
|
|
581
582
|
return;
|
|
582
583
|
// Update the entity's origin/destination to match the new visual endpoints
|
|
@@ -602,7 +603,7 @@ export class FlowAgentEditorComponent {
|
|
|
602
603
|
// ── Properties Panel Events ─────────────────────────────────
|
|
603
604
|
onStepChanged(step) {
|
|
604
605
|
// Update the corresponding flow node in-place and push to generic editor
|
|
605
|
-
const node = this.nodes.find(n => n.ID
|
|
606
|
+
const node = this.nodes.find(n => UUIDsEqual(n.ID, step.ID));
|
|
606
607
|
if (node) {
|
|
607
608
|
const newLabel = step.Name;
|
|
608
609
|
const newSubtitle = this.transformer.BuildStepSubtitle(step);
|
|
@@ -689,7 +690,7 @@ export class FlowAgentEditorComponent {
|
|
|
689
690
|
this.cdr.detectChanges();
|
|
690
691
|
}
|
|
691
692
|
onDeleteStepRequested(step) {
|
|
692
|
-
const node = this.nodes.find(n => n.ID
|
|
693
|
+
const node = this.nodes.find(n => UUIDsEqual(n.ID, step.ID));
|
|
693
694
|
if (node) {
|
|
694
695
|
this.flowEditor?.SelectNode(step.ID);
|
|
695
696
|
this.flowEditor?.DeleteSelected();
|
|
@@ -699,12 +700,12 @@ export class FlowAgentEditorComponent {
|
|
|
699
700
|
this.cdr.detectChanges();
|
|
700
701
|
}
|
|
701
702
|
onDeletePathRequested(path) {
|
|
702
|
-
const conn = this.connections.find(c => c.ID
|
|
703
|
+
const conn = this.connections.find(c => UUIDsEqual(c.ID, path.ID));
|
|
703
704
|
if (conn) {
|
|
704
705
|
if (path.IsSaved) {
|
|
705
706
|
this.deletedPathIDs.push(path.ID);
|
|
706
707
|
}
|
|
707
|
-
this.paths = this.paths.filter(p => p.ID
|
|
708
|
+
this.paths = this.paths.filter(p => !UUIDsEqual(p.ID, path.ID));
|
|
708
709
|
this.rebuildFlowModel();
|
|
709
710
|
this.markDirty();
|
|
710
711
|
}
|
|
@@ -995,5 +996,5 @@ export class FlowAgentEditorComponent {
|
|
|
995
996
|
type: HostListener,
|
|
996
997
|
args: ['document:keydown.escape']
|
|
997
998
|
}] }); })();
|
|
998
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FlowAgentEditorComponent, { className: "FlowAgentEditorComponent", filePath: "src/lib/agent-editor/flow-agent-editor.component.ts", lineNumber:
|
|
999
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FlowAgentEditorComponent, { className: "FlowAgentEditorComponent", filePath: "src/lib/agent-editor/flow-agent-editor.component.ts", lineNumber: 28 }); })();
|
|
999
1000
|
//# sourceMappingURL=flow-agent-editor.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-agent-editor.component.js","sourceRoot":"","sources":["../../../src/lib/agent-editor/flow-agent-editor.component.ts","../../../src/lib/agent-editor/flow-agent-editor.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EACf,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAE/E,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YA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GD,cAuBC;YAvBD,iDAuBC;;;iFD1MU,wBAAwB;cARpC,SAAS;6BACI,KAAK,YACP,sBAAsB,iBAGjB,iBAAiB,CAAC,IAAI,aAC1B,CAAC,2BAA2B,CAAC;;kBAIvC,WAAW;mBAAC,wCAAwC;;kBAGpD,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAGN,SAAS;mBAAC,YAAY;;kBA4rBtB,YAAY;mBAAC,yBAAyB;;kFA5sB5B,wBAAwB","sourcesContent":["import {\n Component, Input, Output, EventEmitter, ViewChild, OnInit, OnChanges, OnDestroy,\n SimpleChanges, ChangeDetectorRef, ViewEncapsulation, HostListener, HostBinding,\n ElementRef, Renderer2\n} from '@angular/core';\nimport { Metadata, RunView, CompositeKey } from '@memberjunction/core';\nimport { MJAIAgentStepEntity, MJAIAgentStepPathEntity, UserInfoEngine } from '@memberjunction/core-entities';\nimport { FlowNode, FlowConnection, FlowNodeAddedEvent, FlowConnectionCreatedEvent, FlowConnectionReassignedEvent, FlowNodeTypeConfig } from '../interfaces/flow-types';\nimport { FlowEditorComponent } from '../components/flow-editor.component';\nimport { AgentFlowTransformerService, AGENT_STEP_TYPE_CONFIGS } from './agent-flow-transformer.service';\n\n/** View mode for the agent editor */\nexport type AgentEditorViewMode = 'diagram' | 'list';\n\n/**\n * Flow Agent Editor — wraps the generic FlowEditorComponent with\n * MJ agent-specific CRUD, properties panel, and data transformation.\n */\n@Component({\n standalone: false,\n selector: 'mj-flow-agent-editor',\n templateUrl: './flow-agent-editor.component.html',\n styleUrls: ['./flow-agent-editor.component.css'],\n encapsulation: ViewEncapsulation.None,\n providers: [AgentFlowTransformerService]\n})\nexport class FlowAgentEditorComponent implements OnInit, OnChanges, OnDestroy {\n // ── Host Bindings ─────────────────────────────────────────────\n @HostBinding('class.mj-flow-agent-editor--fullscreen') get HostFullScreen(): boolean { return this.FullScreen; }\n\n // ── Inputs ──────────────────────────────────────────────────\n @Input() AgentID: string | null = null;\n @Input() EditMode = true;\n @Input() FullScreen = false;\n\n // ── Outputs ─────────────────────────────────────────────────\n @Output() FlowSaved = new EventEmitter<void>();\n @Output() FlowChanged = new EventEmitter<boolean>();\n @Output() FullScreenToggled = new EventEmitter<boolean>();\n @Output() StepSelected = new EventEmitter<MJAIAgentStepEntity | null>();\n\n // ── View Children ───────────────────────────────────────────\n @ViewChild('flowEditor') protected flowEditor: FlowEditorComponent | undefined;\n\n // ── State ───────────────────────────────────────────────────\n protected nodes: FlowNode[] = [];\n protected connections: FlowConnection[] = [];\n protected nodeTypes: FlowNodeTypeConfig[] = AGENT_STEP_TYPE_CONFIGS;\n protected viewMode: AgentEditorViewMode = 'diagram';\n protected isLoading = true;\n protected isSaving = false;\n protected hasUnsavedChanges = false;\n protected lastSaved: Date | null = null;\n\n // Fullscreen self-contained edit mode\n protected fullscreenEditMode = false;\n protected showUnsavedDialog = false;\n\n // Entity data\n protected steps: MJAIAgentStepEntity[] = [];\n protected paths: MJAIAgentStepPathEntity[] = [];\n protected deletedStepIDs: string[] = [];\n protected deletedPathIDs: string[] = [];\n\n // Selected items\n protected selectedStep: MJAIAgentStepEntity | null = null;\n protected selectedConnection: FlowConnection | null = null;\n protected selectedPathEntity: MJAIAgentStepPathEntity | null = null;\n protected showPropertiesPanel = false;\n\n // Picker data (includes icon fields for node rendering)\n protected availableActions: Array<{ ID: string; Name: string; IconClass?: string | null }> = [];\n protected availablePrompts: Array<{ ID: string; Name: string }> = [];\n protected availableAgents: Array<{ ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null }> = [];\n\n // Permission state — cached once on init\n protected userCanUpdate = false;\n\n // User view preferences (persisted via UserInfoEngine)\n protected prefShowGrid = true;\n protected prefShowMinimap = true;\n protected prefShowLegend = true;\n\n private static readonly PREF_KEY = 'flow-editor/view-prefs';\n\n // Initial zoom state\n private needsInitialZoom = false;\n private resizeObserver: ResizeObserver | null = null;\n\n // Fullscreen DOM relocation state\n private originalParent: HTMLElement | null = null;\n private originalNextSibling: Node | null = null;\n private backdropElement: HTMLElement | null = null;\n\n constructor(\n private cdr: ChangeDetectorRef,\n private transformer: AgentFlowTransformerService,\n private elRef: ElementRef<HTMLElement>,\n private renderer: Renderer2\n ) {}\n\n // ── Lifecycle ───────────────────────────────────────────────\n\n ngOnInit(): void {\n this.loadViewPreferences();\n this.checkUpdatePermission();\n if (this.AgentID) {\n this.loadAll();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['AgentID'] && !changes['AgentID'].firstChange && this.AgentID) {\n this.loadAll();\n }\n }\n\n ngOnDestroy(): void {\n this.teardownResizeObserver();\n // Restore element to original parent if still in fullscreen\n if (this.FullScreen) {\n this.restoreFromFullscreen();\n }\n }\n\n // ── Data Loading ────────────────────────────────────────────\n\n private async loadAll(): Promise<void> {\n this.isLoading = true;\n this.cdr.detectChanges();\n\n try {\n await Promise.all([\n this.loadStepsAndPaths(),\n this.loadPickerData()\n ]);\n this.rebuildFlowModel();\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n\n // Flag that we need an initial zoom; it will fire when the host element\n // first becomes visible (e.g. Kendo PanelBar expands)\n this.setupInitialZoomObserver();\n }\n }\n\n private async loadStepsAndPaths(): Promise<void> {\n if (!this.AgentID) return;\n const rv = new RunView();\n const [stepsResult, pathsResult] = await rv.RunViews([\n {\n EntityName: 'MJ: AI Agent Steps',\n ExtraFilter: `AgentID='${this.AgentID}'`,\n OrderBy: 'Name ASC',\n ResultType: 'entity_object'\n },\n {\n EntityName: 'MJ: AI Agent Step Paths',\n ExtraFilter: `OriginStepID IN (SELECT ID FROM [__mj].[AIAgentStep] WHERE AgentID='${this.AgentID}')`,\n OrderBy: 'Priority DESC',\n ResultType: 'entity_object'\n }\n ]);\n\n this.steps = stepsResult.Success ? (stepsResult.Results as MJAIAgentStepEntity[]) : [];\n this.paths = pathsResult.Success ? (pathsResult.Results as MJAIAgentStepPathEntity[]) : [];\n this.deletedStepIDs = [];\n this.deletedPathIDs = [];\n }\n\n private async loadPickerData(): Promise<void> {\n const rv = new RunView();\n const [actionsResult, promptsResult, agentsResult] = await rv.RunViews([\n {\n EntityName: 'MJ: Actions',\n Fields: ['ID', 'Name', 'IconClass'],\n ExtraFilter: `Status='Active'`,\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n },\n {\n EntityName: 'MJ: AI Prompts',\n Fields: ['ID', 'Name'],\n ExtraFilter: '',\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n },\n {\n EntityName: 'MJ: AI Agents',\n Fields: ['ID', 'Name', 'IconClass', 'LogoURL'],\n ExtraFilter: this.AgentID ? `ID <> '${this.AgentID}'` : '',\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n }\n ]);\n\n this.availableActions = actionsResult.Success\n ? (actionsResult.Results as Array<{ ID: string; Name: string; IconClass?: string | null }>)\n : [];\n this.availablePrompts = promptsResult.Success\n ? (promptsResult.Results as Array<{ ID: string; Name: string }>)\n : [];\n this.availableAgents = agentsResult.Success\n ? (agentsResult.Results as Array<{ ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null }>)\n : [];\n }\n\n private rebuildFlowModel(): void {\n this.nodes = this.transformer.StepsToNodes(this.steps, this.availableActions, this.availableAgents);\n this.connections = this.transformer.PathsToConnections(this.paths);\n }\n\n /**\n * Observe the host element's size. When it transitions from zero to non-zero height\n * (i.e. the collapsed Kendo panel expands), trigger the initial auto-arrange or zoom-to-fit.\n */\n private setupInitialZoomObserver(): void {\n if (this.nodes.length === 0) return;\n\n this.needsInitialZoom = true;\n this.teardownResizeObserver();\n\n this.resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const height = entry.contentRect.height;\n if (height > 0 && this.needsInitialZoom) {\n this.needsInitialZoom = false;\n this.teardownResizeObserver();\n // Short delay for Foblex canvas to finish its own init after becoming visible\n setTimeout(() => this.applyInitialZoom(), 100);\n }\n }\n });\n\n this.resizeObserver.observe(this.elRef.nativeElement);\n }\n\n private applyInitialZoom(): void {\n if (!this.flowEditor || this.nodes.length === 0) return;\n const allAtOrigin = this.nodes.every(n => n.Position.X === 0 && n.Position.Y === 0);\n if (allAtOrigin) {\n this.flowEditor.AutoArrange();\n } else {\n this.flowEditor.ZoomToFit();\n }\n }\n\n private teardownResizeObserver(): void {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n // ── Save ────────────────────────────────────────────────────\n\n async Save(): Promise<void> {\n if (this.isSaving || !this.AgentID) return;\n this.isSaving = true;\n this.cdr.detectChanges();\n\n try {\n // Update positions from canvas to entities\n this.syncPositionsFromCanvas();\n\n // Delete removed items first\n await this.deleteRemovedEntities();\n\n // Save all steps\n for (const step of this.steps) {\n const result = await step.Save();\n if (!result) {\n console.error(`Failed to save step: ${step.Name}`, step.LatestResult);\n }\n }\n\n // Save all paths\n for (const path of this.paths) {\n const result = await path.Save();\n if (!result) {\n console.error(`Failed to save path: ${path.ID}`, path.LatestResult);\n }\n }\n\n this.hasUnsavedChanges = false;\n this.lastSaved = new Date();\n\n // Exit self-contained fullscreen edit mode after successful save\n if (this.fullscreenEditMode) {\n this.fullscreenEditMode = false;\n }\n\n this.FlowSaved.emit();\n } catch (err) {\n console.error('Error saving flow:', err);\n } finally {\n this.isSaving = false;\n this.cdr.detectChanges();\n }\n }\n\n private syncPositionsFromCanvas(): void {\n this.syncPositionsToEntities();\n }\n\n /** Write current FlowNode positions back to the underlying step entities.\n * Called on every node move so that rebuildFlowModel() never loses drag changes. */\n private syncPositionsToEntities(): void {\n for (const node of this.nodes) {\n const step = this.steps.find(s => s.ID === node.ID);\n if (step) {\n this.transformer.ApplyNodePosition(step, node);\n }\n }\n }\n\n private async deleteRemovedEntities(): Promise<void> {\n const md = new Metadata();\n\n for (const pathId of this.deletedPathIDs) {\n const pathEntity = await md.GetEntityObject<MJAIAgentStepPathEntity>('MJ: AI Agent Step Paths');\n await pathEntity.InnerLoad(CompositeKey.FromID(pathId));\n await pathEntity.Delete();\n }\n\n for (const stepId of this.deletedStepIDs) {\n const stepEntity = await md.GetEntityObject<MJAIAgentStepEntity>('MJ: AI Agent Steps');\n await stepEntity.InnerLoad(CompositeKey.FromID(stepId));\n await stepEntity.Delete();\n }\n\n this.deletedPathIDs = [];\n this.deletedStepIDs = [];\n }\n\n // ── Flow Editor Event Handlers ──────────────────────────────\n\n protected async onNodeAdded(event: FlowNodeAddedEvent): Promise<void> {\n if (!this.AgentID) return;\n\n const md = new Metadata();\n const step = await md.GetEntityObject<MJAIAgentStepEntity>('MJ: AI Agent Steps');\n step.NewRecord(); // This generates a UUID immediately - available before Save()\n step.AgentID = this.AgentID;\n step.Name = event.Node.Label;\n step.StepType = event.Node.Type as 'Action' | 'Prompt' | 'Sub-Agent' | 'ForEach' | 'While';\n step.Status = 'Active';\n step.StartingStep = this.steps.length === 0; // First step is starting step\n step.PositionX = Math.round(event.DropPosition.X);\n step.PositionY = Math.round(event.DropPosition.Y);\n step.OnErrorBehavior = 'fail';\n step.RetryCount = 0;\n step.TimeoutSeconds = 600;\n\n // Add the unsaved step to the array - it already has a UUID from NewRecord()\n // This allows connections to be drawn immediately without waiting for a database save\n this.steps.push(step);\n\n // Build a FlowNode using the entity's pre-generated ID so Foblex can track it\n const newNode = this.transformer.StepToNode(step, this.availableActions, this.availableAgents);\n this.nodes.push(newNode);\n this.markDirty();\n\n // Select the new node\n setTimeout(() => {\n this.flowEditor?.SelectNode(step.ID);\n this.onNodeSelected(newNode);\n }, 100);\n\n this.cdr.detectChanges();\n }\n\n protected async onConnectionCreated(event: FlowConnectionCreatedEvent): Promise<void> {\n if (!this.AgentID) return;\n\n // Prevent duplicate\n const exists = this.paths.some(\n p => p.OriginStepID === event.SourceNodeID && p.DestinationStepID === event.TargetNodeID\n );\n if (exists) return;\n\n const md = new Metadata();\n const path = await md.GetEntityObject<MJAIAgentStepPathEntity>('MJ: AI Agent Step Paths');\n path.NewRecord(); // Generates UUID immediately - available before Save()\n path.OriginStepID = event.SourceNodeID;\n path.DestinationStepID = event.TargetNodeID;\n path.Priority = 0;\n\n // Add unsaved path to the array - save will happen on main Save() button\n this.paths.push(path);\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onNodeSelected(node: FlowNode | null): void {\n if (node) {\n this.selectedStep = this.steps.find(s => s.ID === node.ID) ?? null;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.showPropertiesPanel = true;\n this.StepSelected.emit(this.selectedStep);\n } else {\n this.selectedStep = null;\n // Only hide the panel if no connection is currently selected.\n // When the user clicks a connection, Foblex fires NodeSelected(null) AND\n // ConnectionSelected(conn) — we must not let the null-node event hide\n // the panel that the connection event just opened.\n if (!this.selectedConnection) {\n this.showPropertiesPanel = false;\n }\n this.StepSelected.emit(null);\n }\n this.cdr.detectChanges();\n }\n\n protected onConnectionSelected(conn: FlowConnection | null): void {\n if (conn) {\n this.selectedConnection = conn;\n this.selectedPathEntity = this.paths.find(p => p.ID === conn.ID) ?? null;\n this.selectedStep = null;\n this.showPropertiesPanel = true;\n } else {\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n }\n this.cdr.detectChanges();\n }\n\n protected onNodeRemoved(node: FlowNode): void {\n const step = this.steps.find(s => s.ID === node.ID);\n if (step) {\n // Track for deletion on save (only if it was previously saved)\n if (step.IsSaved) {\n this.deletedStepIDs.push(step.ID);\n // Also mark paths connected to this step for deletion\n const connectedPaths = this.paths.filter(\n p => p.OriginStepID === step.ID || p.DestinationStepID === step.ID\n );\n for (const path of connectedPaths) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n }\n }\n this.steps = this.steps.filter(s => s.ID !== node.ID);\n this.paths = this.paths.filter(\n p => p.OriginStepID !== node.ID && p.DestinationStepID !== node.ID\n );\n this.markDirty();\n }\n }\n\n protected onConnectionRemoved(conn: FlowConnection): void {\n const path = this.paths.find(p => p.ID === conn.ID);\n if (path) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n this.paths = this.paths.filter(p => p.ID !== conn.ID);\n this.markDirty();\n }\n }\n\n protected onConnectionReassigned(event: FlowConnectionReassignedEvent): void {\n const path = this.paths.find(p => p.ID === event.ConnectionID);\n if (!path) return;\n\n // Update the entity's origin/destination to match the new visual endpoints\n path.OriginStepID = event.NewSourceNodeID;\n path.DestinationStepID = event.NewTargetNodeID;\n\n // Rebuild all connections so sibling-based visual logic recalculates\n // (e.g., Default vs Duplicate Default labels depend on sibling analysis)\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onNodesChanged(nodes: FlowNode[]): void {\n this.nodes = nodes;\n // Sync canvas positions back to entities immediately so that\n // any subsequent rebuildFlowModel() preserves drag changes.\n this.syncPositionsToEntities();\n this.markDirty(); \n }\n\n protected onConnectionsChanged(connections: FlowConnection[]): void {\n this.connections = connections;\n this.markDirty();\n }\n\n // ── Properties Panel Events ─────────────────────────────────\n\n protected onStepChanged(step: MJAIAgentStepEntity): void {\n // Update the corresponding flow node in-place and push to generic editor\n const node = this.nodes.find(n => n.ID === step.ID);\n if (node) {\n const newLabel = step.Name;\n const newSubtitle = this.transformer.BuildStepSubtitle(step);\n const baseStatus = this.transformer.MapStepStatus(step.Status);\n const warningMessage = (baseStatus !== 'disabled') ? this.transformer.BuildConfigWarningMessage(step) : null;\n const newStatus = warningMessage ? 'warning' : baseStatus;\n const newIsStart = step.StartingStep === true;\n\n node.Label = newLabel;\n node.Subtitle = newSubtitle;\n node.Status = newStatus;\n node.StatusMessage = warningMessage ?? undefined;\n node.IsStartNode = newIsStart;\n\n // Update input port disabled state for starting steps\n const inputPort = node.Ports.find(p => p.Direction === 'input');\n if (inputPort) {\n inputPort.Disabled = newIsStart;\n }\n\n // Re-resolve icon from picker data (handles action/agent assignment changes)\n const resolved = this.transformer.ResolveStepIcon(step, this.availableActions, this.availableAgents);\n node.Icon = resolved.Icon;\n if (!node.Data) node.Data = {};\n node.Data['LogoURL'] = resolved.LogoURL ?? null;\n\n // For loop nodes, rebuild the loop-specific Data properties so the\n // inner body card updates immediately when the user changes body type / config\n if (step.StepType === 'ForEach' || step.StepType === 'While') {\n this.updateLoopNodeData(step, node);\n }\n\n // Push visual update to the generic flow editor (creates new object ref for OnPush)\n this.flowEditor?.UpdateNode(step.ID, {\n Label: newLabel,\n Subtitle: newSubtitle,\n Status: newStatus,\n StatusMessage: warningMessage ?? undefined,\n IsStartNode: newIsStart,\n Icon: resolved.Icon,\n Data: node.Data\n });\n }\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n /** Update loop-specific data fields on a FlowNode from the step entity */\n private updateLoopNodeData(step: MJAIAgentStepEntity, node: FlowNode): void {\n if (!node.Data) node.Data = {};\n // Delegate to the transformer's public methods for consistency\n const bodyType = step.LoopBodyType;\n node.Data['LoopBodyType'] = bodyType ?? null;\n node.Data['LoopBodyName'] = this.resolveLoopBodyNameFromStep(step);\n node.Data['LoopBodyIcon'] = this.getBodyTypeIcon(bodyType);\n node.Data['LoopBodyColor'] = this.getBodyTypeColor(bodyType);\n node.Data['LoopIterationSummary'] = this.transformer.BuildLoopIterationSummary(step);\n }\n\n private resolveLoopBodyNameFromStep(step: MJAIAgentStepEntity): string | null {\n switch (step.LoopBodyType) {\n case 'Action': return step.Action ?? null;\n case 'Prompt': return step.Prompt ?? null;\n case 'Sub-Agent': return step.SubAgent ?? null;\n default: return null;\n }\n }\n\n private getBodyTypeIcon(bodyType: string | null): string {\n switch (bodyType) {\n case 'Action': return 'fa-bolt';\n case 'Prompt': return 'fa-comment-dots';\n case 'Sub-Agent': return 'fa-robot';\n default: return 'fa-circle-nodes';\n }\n }\n\n private getBodyTypeColor(bodyType: string | null): string {\n switch (bodyType) {\n case 'Action': return '#3B82F6';\n case 'Prompt': return '#8B5CF6';\n case 'Sub-Agent': return '#10B981';\n default: return '#6B7280';\n }\n }\n\n protected onPathChanged(path: MJAIAgentStepPathEntity): void {\n // Rebuild all connections from the same origin since always/conditional logic\n // depends on sibling paths (e.g., \"Default\" label only appears when siblings exist)\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onDeleteStepRequested(step: MJAIAgentStepEntity): void {\n const node = this.nodes.find(n => n.ID === step.ID);\n if (node) {\n this.flowEditor?.SelectNode(step.ID);\n this.flowEditor?.DeleteSelected();\n }\n this.showPropertiesPanel = false;\n this.selectedStep = null;\n this.cdr.detectChanges();\n }\n\n protected onDeletePathRequested(path: MJAIAgentStepPathEntity): void {\n const conn = this.connections.find(c => c.ID === path.ID);\n if (conn) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n this.paths = this.paths.filter(p => p.ID !== path.ID);\n this.rebuildFlowModel();\n this.markDirty();\n }\n this.showPropertiesPanel = false;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.cdr.detectChanges();\n }\n\n protected onCloseProperties(): void {\n this.showPropertiesPanel = false;\n this.flowEditor?.ClearSelection();\n }\n\n // ── View & UI Controls ──────────────────────────────────────\n\n protected toggleViewMode(): void {\n this.viewMode = this.viewMode === 'diagram' ? 'list' : 'diagram';\n this.cdr.detectChanges();\n }\n\n /** Whether editing is currently allowed — combines parent EditMode + fullscreen self-contained edit */\n get isEditingActive(): boolean {\n return this.EditMode || this.fullscreenEditMode;\n }\n\n protected toggleFullscreenEditMode(): void {\n this.fullscreenEditMode = !this.fullscreenEditMode;\n this.cdr.detectChanges();\n }\n\n protected cancelFullscreenEdit(): void {\n if (this.hasUnsavedChanges) {\n // Reload to discard changes\n this.fullscreenEditMode = false;\n this.hasUnsavedChanges = false;\n this.loadAll();\n } else {\n this.fullscreenEditMode = false;\n this.cdr.detectChanges();\n }\n }\n\n protected toggleFullScreen(): void {\n if (this.FullScreen && this.hasUnsavedChanges) {\n this.showUnsavedDialog = true;\n this.cdr.detectChanges();\n return;\n }\n this.performFullscreenToggle();\n }\n\n protected onUnsavedDialogSave(): void {\n this.showUnsavedDialog = false;\n this.Save().then(() => this.performFullscreenToggle());\n }\n\n protected onUnsavedDialogDiscard(): void {\n this.showUnsavedDialog = false;\n this.hasUnsavedChanges = false;\n this.fullscreenEditMode = false;\n this.performFullscreenToggle();\n // Reload original data\n this.loadAll();\n }\n\n protected onUnsavedDialogCancel(): void {\n this.showUnsavedDialog = false;\n this.cdr.detectChanges();\n }\n\n private performFullscreenToggle(): void {\n this.FullScreen = !this.FullScreen;\n\n if (this.FullScreen) {\n this.moveToBodyForFullscreen();\n } else {\n this.fullscreenEditMode = false;\n this.restoreFromFullscreen();\n }\n\n this.FullScreenToggled.emit(this.FullScreen);\n this.cdr.detectChanges();\n // Re-fit after layout change\n setTimeout(() => this.flowEditor?.ZoomToFit(), 200);\n }\n\n private moveToBodyForFullscreen(): void {\n const hostEl = this.elRef.nativeElement;\n this.originalParent = hostEl.parentElement;\n this.originalNextSibling = hostEl.nextSibling;\n\n // Create backdrop as a separate body-level element so it covers everything\n this.backdropElement = this.renderer.createElement('div');\n this.renderer.addClass(this.backdropElement, 'mj-agent-editor-backdrop');\n this.renderer.listen(this.backdropElement, 'click', () => this.toggleFullScreen());\n this.renderer.appendChild(document.body, this.backdropElement);\n\n // Move the host element to body — @HostBinding applies the fixed-position class\n this.renderer.appendChild(document.body, hostEl);\n }\n\n private restoreFromFullscreen(): void {\n // Remove backdrop\n if (this.backdropElement) {\n this.renderer.removeChild(document.body, this.backdropElement);\n this.backdropElement = null;\n }\n\n // Restore host element to original position\n if (!this.originalParent) return;\n const hostEl = this.elRef.nativeElement;\n if (this.originalNextSibling) {\n this.renderer.insertBefore(this.originalParent, hostEl, this.originalNextSibling);\n } else {\n this.renderer.appendChild(this.originalParent, hostEl);\n }\n this.originalParent = null;\n this.originalNextSibling = null;\n }\n\n protected onStepClickedInList(step: MJAIAgentStepEntity): void {\n this.selectedStep = step;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.showPropertiesPanel = true;\n this.StepSelected.emit(step);\n this.cdr.detectChanges();\n }\n\n // ── Keyboard Shortcuts ─────────────────────────────────────\n\n @HostListener('document:keydown.escape')\n protected onEscapeKey(): void {\n if (this.showUnsavedDialog) {\n this.onUnsavedDialogCancel();\n } else if (this.FullScreen) {\n this.toggleFullScreen();\n }\n }\n\n // ── Permission Check ────────────────────────────────────────\n\n private checkUpdatePermission(): void {\n const md = new Metadata();\n const entity = md.EntityByName('MJ: AI Agents');\n if (entity) {\n const perms = entity.GetUserPermisions(md.CurrentUser);\n this.userCanUpdate = perms?.CanUpdate === true;\n }\n }\n\n // ── View Preference Persistence ─────────────────────────────\n\n private loadViewPreferences(): void {\n const raw = UserInfoEngine.Instance.GetSetting(FlowAgentEditorComponent.PREF_KEY);\n if (raw) {\n try {\n const prefs = JSON.parse(raw) as { grid?: boolean; minimap?: boolean; legend?: boolean };\n if (prefs.grid != null) this.prefShowGrid = prefs.grid;\n if (prefs.minimap != null) this.prefShowMinimap = prefs.minimap;\n if (prefs.legend != null) this.prefShowLegend = prefs.legend;\n } catch {\n // Ignore malformed preference data\n }\n }\n }\n\n private saveViewPreferences(): void {\n const prefs = JSON.stringify({\n grid: this.prefShowGrid,\n minimap: this.prefShowMinimap,\n legend: this.prefShowLegend\n });\n // Fire-and-forget — preference save errors are non-critical\n UserInfoEngine.Instance.SetSetting(FlowAgentEditorComponent.PREF_KEY, prefs);\n }\n\n protected onGridPrefChanged(show: boolean): void {\n this.prefShowGrid = show;\n this.saveViewPreferences();\n }\n\n protected onMinimapPrefChanged(show: boolean): void {\n this.prefShowMinimap = show;\n this.saveViewPreferences();\n }\n\n protected onLegendPrefChanged(show: boolean): void {\n this.prefShowLegend = show;\n this.saveViewPreferences();\n }\n\n // ── Helpers ─────────────────────────────────────────────────\n\n private markDirty(): void {\n if (!this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n this.FlowChanged.emit(true);\n }\n }\n}\n","<div class=\"mj-agent-editor\">\n\n <!-- ── Toolbar ─────────────────────────────────────────────── -->\n <div class=\"mj-agent-editor-toolbar\" [class.mj-agent-editor-toolbar--editing]=\"isEditingActive\">\n <div class=\"mj-agent-editor-toolbar-left\">\n <!-- Undo / Redo (edit mode only) -->\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn\"\n [disabled]=\"!flowEditor?.CanUndo\" (click)=\"flowEditor?.Undo()\" title=\"Undo (Ctrl+Z)\">\n <i class=\"fa-solid fa-rotate-left\"></i>\n </button>\n }\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn\"\n [disabled]=\"!flowEditor?.CanRedo\" (click)=\"flowEditor?.Redo()\" title=\"Redo (Ctrl+Y)\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n </button>\n }\n </div>\n\n <div class=\"mj-agent-editor-toolbar-center\">\n <!-- Fullscreen title -->\n <span class=\"mj-agent-editor-title\">\n <i class=\"fa-solid fa-diagram-project\"></i> Flow Configuration\n </span>\n\n <!-- View Mode Toggle -->\n <div class=\"mj-agent-editor-view-toggle\">\n <button class=\"mj-agent-editor-view-btn\"\n [class.mj-agent-editor-view-btn--active]=\"viewMode === 'diagram'\"\n (click)=\"viewMode = 'diagram'\">\n <i class=\"fa-solid fa-diagram-project\"></i> Diagram\n </button>\n <button class=\"mj-agent-editor-view-btn\"\n [class.mj-agent-editor-view-btn--active]=\"viewMode === 'list'\"\n (click)=\"viewMode = 'list'\">\n <i class=\"fa-solid fa-list\"></i> List\n </button>\n </div>\n\n <!-- Mode indicator badge -->\n @if (isEditingActive) {\n <span class=\"mj-agent-editor-mode-badge mj-agent-editor-mode-badge--editing\">\n <i class=\"fa-solid fa-pen\"></i> Editing\n </span>\n }\n @if (!isEditingActive) {\n <span class=\"mj-agent-editor-mode-badge mj-agent-editor-mode-badge--readonly\">\n <i class=\"fa-solid fa-lock\"></i> Read Only\n </span>\n }\n </div>\n\n <div class=\"mj-agent-editor-toolbar-right\">\n <!-- Status indicators -->\n @if (hasUnsavedChanges) {\n <span class=\"mj-agent-editor-status mj-agent-editor-status--unsaved\">\n <i class=\"fa-solid fa-circle\"></i> Unsaved\n </span>\n }\n @if (lastSaved) {\n <span class=\"mj-agent-editor-status\">\n Saved {{ lastSaved | date:'shortTime' }}\n </span>\n }\n\n <!-- Save + Cancel (when editing) -->\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--primary\"\n [disabled]=\"isSaving || !hasUnsavedChanges\" (click)=\"Save()\">\n <i class=\"fa-solid\" [ngClass]=\"isSaving ? 'fa-spinner fa-spin' : 'fa-floppy-disk'\"></i>\n {{ isSaving ? 'Saving...' : 'Save' }}\n </button>\n }\n @if (fullscreenEditMode && !EditMode) {\n <button\n class=\"mj-agent-editor-btn\"\n (click)=\"cancelFullscreenEdit()\" title=\"Cancel editing\">\n <i class=\"fa-solid fa-xmark\"></i> Cancel\n </button>\n }\n\n @if (isEditingActive) {\n <div class=\"mj-agent-editor-btn-divider\"></div>\n }\n\n <!-- Fullscreen edit toggle (only when parent is NOT in edit mode) -->\n @if (!EditMode && !fullscreenEditMode && userCanUpdate) {\n <button\n class=\"mj-agent-editor-btn mj-agent-editor-btn--edit\"\n (click)=\"toggleFullscreenEditMode()\" title=\"Edit flow\">\n <i class=\"fa-solid fa-pen-to-square\"></i> Edit\n </button>\n }\n\n <!-- Expand / Close fullscreen -->\n @if (!FullScreen) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--expand\"\n (click)=\"toggleFullScreen()\" title=\"Expand to full screen\">\n <i class=\"fa-solid fa-up-right-and-down-left-from-center\"></i> Expand\n </button>\n }\n @if (FullScreen) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--close\"\n (click)=\"toggleFullScreen()\" title=\"Close full screen (Esc)\">\n <i class=\"fa-solid fa-xmark\"></i> Close\n </button>\n }\n </div>\n </div>\n\n <!-- ── Loading State ─────────────────────────────────────── -->\n @if (isLoading) {\n <div class=\"mj-agent-editor-loading\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading flow...</span>\n </div>\n }\n\n <!-- ── Main Content ──────────────────────────────────────── -->\n @if (!isLoading) {\n <div class=\"mj-agent-editor-body\">\n <!-- Diagram View -->\n @if (viewMode === 'diagram') {\n <div class=\"mj-agent-editor-diagram\">\n <mj-flow-editor #flowEditor\n [Nodes]=\"nodes\"\n [Connections]=\"connections\"\n [NodeTypes]=\"nodeTypes\"\n [ReadOnly]=\"!isEditingActive\"\n [ShowMinimap]=\"prefShowMinimap\"\n [ShowPalette]=\"isEditingActive\"\n [ShowGrid]=\"prefShowGrid\"\n [ShowLegend]=\"prefShowLegend\"\n [ShowStatusBar]=\"true\"\n [ShowToolbar]=\"true\"\n [AutoLayoutDirection]=\"'vertical'\"\n (NodeSelected)=\"onNodeSelected($event)\"\n (NodeAdded)=\"onNodeAdded($event)\"\n (NodeRemoved)=\"onNodeRemoved($event)\"\n (ConnectionCreated)=\"onConnectionCreated($event)\"\n (ConnectionRemoved)=\"onConnectionRemoved($event)\"\n (ConnectionReassigned)=\"onConnectionReassigned($event)\"\n (ConnectionSelected)=\"onConnectionSelected($event)\"\n (NodesChanged)=\"onNodesChanged($event)\"\n (ConnectionsChanged)=\"onConnectionsChanged($event)\"\n (GridToggled)=\"onGridPrefChanged($event)\"\n (MinimapToggled)=\"onMinimapPrefChanged($event)\"\n (LegendToggled)=\"onLegendPrefChanged($event)\">\n </mj-flow-editor>\n <!-- Properties Panel -->\n <div class=\"mj-agent-editor-properties\"\n [class.mj-agent-editor-properties--visible]=\"showPropertiesPanel\">\n <mj-agent-properties-panel\n [Step]=\"selectedStep\"\n [SelectedConnection]=\"selectedConnection\"\n [PathEntity]=\"selectedPathEntity\"\n [ReadOnly]=\"!isEditingActive\"\n [Actions]=\"availableActions\"\n [Prompts]=\"availablePrompts\"\n [Agents]=\"availableAgents\"\n [AllSteps]=\"steps\"\n (StepChanged)=\"onStepChanged($event)\"\n (PathChanged)=\"onPathChanged($event)\"\n (DeleteStepRequested)=\"onDeleteStepRequested($event)\"\n (DeletePathRequested)=\"onDeletePathRequested($event)\"\n (CloseRequested)=\"onCloseProperties()\">\n </mj-agent-properties-panel>\n </div>\n </div>\n }\n <!-- List View -->\n @if (viewMode === 'list') {\n <div class=\"mj-agent-editor-list\">\n <mj-agent-step-list\n [Steps]=\"steps\"\n [Paths]=\"paths\"\n [SelectedStepID]=\"selectedStep?.ID || null\"\n (StepClicked)=\"onStepClickedInList($event)\">\n </mj-agent-step-list>\n <!-- Properties Panel in list mode too -->\n <div class=\"mj-agent-editor-properties\"\n [class.mj-agent-editor-properties--visible]=\"showPropertiesPanel\">\n <mj-agent-properties-panel\n [Step]=\"selectedStep\"\n [SelectedConnection]=\"selectedConnection\"\n [PathEntity]=\"selectedPathEntity\"\n [ReadOnly]=\"!isEditingActive\"\n [Actions]=\"availableActions\"\n [Prompts]=\"availablePrompts\"\n [Agents]=\"availableAgents\"\n [AllSteps]=\"steps\"\n (StepChanged)=\"onStepChanged($event)\"\n (PathChanged)=\"onPathChanged($event)\"\n (DeleteStepRequested)=\"onDeleteStepRequested($event)\"\n (DeletePathRequested)=\"onDeletePathRequested($event)\"\n (CloseRequested)=\"onCloseProperties()\">\n </mj-agent-properties-panel>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- ── Unsaved Changes Dialog ──────────────────────────── -->\n @if (showUnsavedDialog) {\n <div class=\"mj-agent-editor-dialog-overlay\">\n <div class=\"mj-agent-editor-dialog\">\n <div class=\"mj-agent-editor-dialog-icon\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </div>\n <h3 class=\"mj-agent-editor-dialog-title\">Unsaved Changes</h3>\n <p class=\"mj-agent-editor-dialog-message\">\n You have unsaved changes to this flow. What would you like to do?\n </p>\n <div class=\"mj-agent-editor-dialog-actions\">\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--primary\" (click)=\"onUnsavedDialogSave()\">\n <i class=\"fa-solid fa-floppy-disk\"></i> Save & Close\n </button>\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--danger-outline\" (click)=\"onUnsavedDialogDiscard()\">\n Discard Changes\n </button>\n <button class=\"mj-agent-editor-btn\" (click)=\"onUnsavedDialogCancel()\">\n Cancel\n </button>\n </div>\n </div>\n </div>\n }\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"flow-agent-editor.component.js","sourceRoot":"","sources":["../../../src/lib/agent-editor/flow-agent-editor.component.ts","../../../src/lib/agent-editor/flow-agent-editor.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EACf,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAE/E,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAgD,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG7G,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;;;;;;;;;ICH5C,kCACuF;IAAnD,4PAA4B;IAC9D,wBAAuC;IACzC,iBAAS;;;IAFP,0FAAiC;;;;IAKnC,kCACuF;IAAnD,4PAA4B;IAC9D,wBAAwC;IAC1C,iBAAS;;;IAFP,0FAAiC;;;IA4BnC,gCAA6E;IAC3E,wBAA+B;IAAC,yBAClC;IAAA,iBAAO;;;IAGP,gCAA8E;IAC5E,wBAAgC;IAAC,2BACnC;IAAA,iBAAO;;;IAOP,gCAAqE;IACnE,wBAAkC;IAAC,yBACrC;IAAA,iBAAO;;;IAGP,gCAAqC;IACnC,YACF;;IAAA,iBAAO;;;IADL,cACF;IADE,0FACF;;;;IAKA,kCAC+D;IAAjB,6LAAS,aAAM,KAAC;IAC5D,wBAAuF;IACvF,YACF;IAAA,iBAAS;;;IAHP,uEAA2C;IACvB,cAA8D;IAA9D,mFAA8D;IAClF,cACF;IADE,uEACF;;;;IAGA,kCAE0D;IAAxD,6LAAS,6BAAsB,KAAC;IAChC,wBAAiC;IAAC,wBACpC;IAAA,iBAAS;;;IAI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B;YAA5B,qHAAoB,MAAM,IAAC;YAC3B,yBAAgC;YAAC,uBACnC;YACF,AADE,iBAAS,EACL;YAGN,8FAAuB;YAKvB,8FAAwB;YAK1B,iBAAM;YAEN,gCAA2C;YAEzC,8FAAyB;YAKzB,8FAAiB;YAOjB,gGAAuB;YAOvB,gGAAuC;YAQvC,6FAAuB;YAKvB,gGAAyD;YASzD,gGAAmB;YAMnB,gGAAkB;YAOtB,AADE,iBAAM,EACF;YAGN,6FAAiB;YAQjB,6FAAkB;YAqFlB,8FAAyB;YAwB3B,iBAAM;;YAlOiC,cAA0D;YAA1D,uEAA0D;YAG3F,eAKC;YALD,8CAKC;YACD,cAKC;YALD,8CAKC;YAYG,eAAiE;YAAjE,8EAAiE;YAKjE,eAA8D;YAA9D,2EAA8D;YAOlE,eAIC;YAJD,+CAIC;YACD,cAIC;YAJD,gDAIC;YAKD,eAIC;YAJD,iDAIC;YACD,cAIC;YAJD,yCAIC;YAGD,cAMC;YAND,+CAMC;YACD,cAMC;YAND,mEAMC;YAED,cAEC;YAFD,+CAEC;YAGD,cAMC;YAND,yFAMC;YAGD,cAKC;YALD,2CAKC;YACD,cAKC;YALD,0CAKC;YAKL,cAKC;YALD,yCAKC;YAGD,cAkFC;YAlFD,0CAkFC;YAGD,cAuBC;YAvBD,iDAuBC;;;iFDzMU,wBAAwB;cARpC,SAAS;6BACI,KAAK,YACP,sBAAsB,iBAGjB,iBAAiB,CAAC,IAAI,aAC1B,CAAC,2BAA2B,CAAC;;kBAIvC,WAAW;mBAAC,wCAAwC;;kBAGpD,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAGL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kBAGN,SAAS;mBAAC,YAAY;;kBA4rBtB,YAAY;mBAAC,yBAAyB;;kFA5sB5B,wBAAwB","sourcesContent":["import {\n Component, Input, Output, EventEmitter, ViewChild, OnInit, OnChanges, OnDestroy,\n SimpleChanges, ChangeDetectorRef, ViewEncapsulation, HostListener, HostBinding,\n ElementRef, Renderer2\n} from '@angular/core';\nimport { Metadata, RunView, CompositeKey } from '@memberjunction/core';\nimport { MJAIAgentStepEntity, MJAIAgentStepPathEntity, UserInfoEngine } from '@memberjunction/core-entities';\nimport { FlowNode, FlowConnection, FlowNodeAddedEvent, FlowConnectionCreatedEvent, FlowConnectionReassignedEvent, FlowNodeTypeConfig } from '../interfaces/flow-types';\nimport { FlowEditorComponent } from '../components/flow-editor.component';\nimport { AgentFlowTransformerService, AGENT_STEP_TYPE_CONFIGS } from './agent-flow-transformer.service';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/** View mode for the agent editor */\nexport type AgentEditorViewMode = 'diagram' | 'list';\n\n/**\n * Flow Agent Editor — wraps the generic FlowEditorComponent with\n * MJ agent-specific CRUD, properties panel, and data transformation.\n */\n@Component({\n standalone: false,\n selector: 'mj-flow-agent-editor',\n templateUrl: './flow-agent-editor.component.html',\n styleUrls: ['./flow-agent-editor.component.css'],\n encapsulation: ViewEncapsulation.None,\n providers: [AgentFlowTransformerService]\n})\nexport class FlowAgentEditorComponent implements OnInit, OnChanges, OnDestroy {\n // ── Host Bindings ─────────────────────────────────────────────\n @HostBinding('class.mj-flow-agent-editor--fullscreen') get HostFullScreen(): boolean { return this.FullScreen; }\n\n // ── Inputs ──────────────────────────────────────────────────\n @Input() AgentID: string | null = null;\n @Input() EditMode = true;\n @Input() FullScreen = false;\n\n // ── Outputs ─────────────────────────────────────────────────\n @Output() FlowSaved = new EventEmitter<void>();\n @Output() FlowChanged = new EventEmitter<boolean>();\n @Output() FullScreenToggled = new EventEmitter<boolean>();\n @Output() StepSelected = new EventEmitter<MJAIAgentStepEntity | null>();\n\n // ── View Children ───────────────────────────────────────────\n @ViewChild('flowEditor') protected flowEditor: FlowEditorComponent | undefined;\n\n // ── State ───────────────────────────────────────────────────\n protected nodes: FlowNode[] = [];\n protected connections: FlowConnection[] = [];\n protected nodeTypes: FlowNodeTypeConfig[] = AGENT_STEP_TYPE_CONFIGS;\n protected viewMode: AgentEditorViewMode = 'diagram';\n protected isLoading = true;\n protected isSaving = false;\n protected hasUnsavedChanges = false;\n protected lastSaved: Date | null = null;\n\n // Fullscreen self-contained edit mode\n protected fullscreenEditMode = false;\n protected showUnsavedDialog = false;\n\n // Entity data\n protected steps: MJAIAgentStepEntity[] = [];\n protected paths: MJAIAgentStepPathEntity[] = [];\n protected deletedStepIDs: string[] = [];\n protected deletedPathIDs: string[] = [];\n\n // Selected items\n protected selectedStep: MJAIAgentStepEntity | null = null;\n protected selectedConnection: FlowConnection | null = null;\n protected selectedPathEntity: MJAIAgentStepPathEntity | null = null;\n protected showPropertiesPanel = false;\n\n // Picker data (includes icon fields for node rendering)\n protected availableActions: Array<{ ID: string; Name: string; IconClass?: string | null }> = [];\n protected availablePrompts: Array<{ ID: string; Name: string }> = [];\n protected availableAgents: Array<{ ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null }> = [];\n\n // Permission state — cached once on init\n protected userCanUpdate = false;\n\n // User view preferences (persisted via UserInfoEngine)\n protected prefShowGrid = true;\n protected prefShowMinimap = true;\n protected prefShowLegend = true;\n\n private static readonly PREF_KEY = 'flow-editor/view-prefs';\n\n // Initial zoom state\n private needsInitialZoom = false;\n private resizeObserver: ResizeObserver | null = null;\n\n // Fullscreen DOM relocation state\n private originalParent: HTMLElement | null = null;\n private originalNextSibling: Node | null = null;\n private backdropElement: HTMLElement | null = null;\n\n constructor(\n private cdr: ChangeDetectorRef,\n private transformer: AgentFlowTransformerService,\n private elRef: ElementRef<HTMLElement>,\n private renderer: Renderer2\n ) {}\n\n // ── Lifecycle ───────────────────────────────────────────────\n\n ngOnInit(): void {\n this.loadViewPreferences();\n this.checkUpdatePermission();\n if (this.AgentID) {\n this.loadAll();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['AgentID'] && !changes['AgentID'].firstChange && this.AgentID) {\n this.loadAll();\n }\n }\n\n ngOnDestroy(): void {\n this.teardownResizeObserver();\n // Restore element to original parent if still in fullscreen\n if (this.FullScreen) {\n this.restoreFromFullscreen();\n }\n }\n\n // ── Data Loading ────────────────────────────────────────────\n\n private async loadAll(): Promise<void> {\n this.isLoading = true;\n this.cdr.detectChanges();\n\n try {\n await Promise.all([\n this.loadStepsAndPaths(),\n this.loadPickerData()\n ]);\n this.rebuildFlowModel();\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n\n // Flag that we need an initial zoom; it will fire when the host element\n // first becomes visible (e.g. Kendo PanelBar expands)\n this.setupInitialZoomObserver();\n }\n }\n\n private async loadStepsAndPaths(): Promise<void> {\n if (!this.AgentID) return;\n const rv = new RunView();\n const [stepsResult, pathsResult] = await rv.RunViews([\n {\n EntityName: 'MJ: AI Agent Steps',\n ExtraFilter: `AgentID='${this.AgentID}'`,\n OrderBy: 'Name ASC',\n ResultType: 'entity_object'\n },\n {\n EntityName: 'MJ: AI Agent Step Paths',\n ExtraFilter: `OriginStepID IN (SELECT ID FROM [__mj].[AIAgentStep] WHERE AgentID='${this.AgentID}')`,\n OrderBy: 'Priority DESC',\n ResultType: 'entity_object'\n }\n ]);\n\n this.steps = stepsResult.Success ? (stepsResult.Results as MJAIAgentStepEntity[]) : [];\n this.paths = pathsResult.Success ? (pathsResult.Results as MJAIAgentStepPathEntity[]) : [];\n this.deletedStepIDs = [];\n this.deletedPathIDs = [];\n }\n\n private async loadPickerData(): Promise<void> {\n const rv = new RunView();\n const [actionsResult, promptsResult, agentsResult] = await rv.RunViews([\n {\n EntityName: 'MJ: Actions',\n Fields: ['ID', 'Name', 'IconClass'],\n ExtraFilter: `Status='Active'`,\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n },\n {\n EntityName: 'MJ: AI Prompts',\n Fields: ['ID', 'Name'],\n ExtraFilter: '',\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n },\n {\n EntityName: 'MJ: AI Agents',\n Fields: ['ID', 'Name', 'IconClass', 'LogoURL'],\n ExtraFilter: this.AgentID ? `ID <> '${this.AgentID}'` : '',\n OrderBy: 'Name ASC',\n ResultType: 'simple'\n }\n ]);\n\n this.availableActions = actionsResult.Success\n ? (actionsResult.Results as Array<{ ID: string; Name: string; IconClass?: string | null }>)\n : [];\n this.availablePrompts = promptsResult.Success\n ? (promptsResult.Results as Array<{ ID: string; Name: string }>)\n : [];\n this.availableAgents = agentsResult.Success\n ? (agentsResult.Results as Array<{ ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null }>)\n : [];\n }\n\n private rebuildFlowModel(): void {\n this.nodes = this.transformer.StepsToNodes(this.steps, this.availableActions, this.availableAgents);\n this.connections = this.transformer.PathsToConnections(this.paths);\n }\n\n /**\n * Observe the host element's size. When it transitions from zero to non-zero height\n * (i.e. the collapsed Kendo panel expands), trigger the initial auto-arrange or zoom-to-fit.\n */\n private setupInitialZoomObserver(): void {\n if (this.nodes.length === 0) return;\n\n this.needsInitialZoom = true;\n this.teardownResizeObserver();\n\n this.resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const height = entry.contentRect.height;\n if (height > 0 && this.needsInitialZoom) {\n this.needsInitialZoom = false;\n this.teardownResizeObserver();\n // Short delay for Foblex canvas to finish its own init after becoming visible\n setTimeout(() => this.applyInitialZoom(), 100);\n }\n }\n });\n\n this.resizeObserver.observe(this.elRef.nativeElement);\n }\n\n private applyInitialZoom(): void {\n if (!this.flowEditor || this.nodes.length === 0) return;\n const allAtOrigin = this.nodes.every(n => n.Position.X === 0 && n.Position.Y === 0);\n if (allAtOrigin) {\n this.flowEditor.AutoArrange();\n } else {\n this.flowEditor.ZoomToFit();\n }\n }\n\n private teardownResizeObserver(): void {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n // ── Save ────────────────────────────────────────────────────\n\n async Save(): Promise<void> {\n if (this.isSaving || !this.AgentID) return;\n this.isSaving = true;\n this.cdr.detectChanges();\n\n try {\n // Update positions from canvas to entities\n this.syncPositionsFromCanvas();\n\n // Delete removed items first\n await this.deleteRemovedEntities();\n\n // Save all steps\n for (const step of this.steps) {\n const result = await step.Save();\n if (!result) {\n console.error(`Failed to save step: ${step.Name}`, step.LatestResult);\n }\n }\n\n // Save all paths\n for (const path of this.paths) {\n const result = await path.Save();\n if (!result) {\n console.error(`Failed to save path: ${path.ID}`, path.LatestResult);\n }\n }\n\n this.hasUnsavedChanges = false;\n this.lastSaved = new Date();\n\n // Exit self-contained fullscreen edit mode after successful save\n if (this.fullscreenEditMode) {\n this.fullscreenEditMode = false;\n }\n\n this.FlowSaved.emit();\n } catch (err) {\n console.error('Error saving flow:', err);\n } finally {\n this.isSaving = false;\n this.cdr.detectChanges();\n }\n }\n\n private syncPositionsFromCanvas(): void {\n this.syncPositionsToEntities();\n }\n\n /** Write current FlowNode positions back to the underlying step entities.\n * Called on every node move so that rebuildFlowModel() never loses drag changes. */\n private syncPositionsToEntities(): void {\n for (const node of this.nodes) {\n const step = this.steps.find(s => UUIDsEqual(s.ID, node.ID));\n if (step) {\n this.transformer.ApplyNodePosition(step, node);\n }\n }\n }\n\n private async deleteRemovedEntities(): Promise<void> {\n const md = new Metadata();\n\n for (const pathId of this.deletedPathIDs) {\n const pathEntity = await md.GetEntityObject<MJAIAgentStepPathEntity>('MJ: AI Agent Step Paths');\n await pathEntity.InnerLoad(CompositeKey.FromID(pathId));\n await pathEntity.Delete();\n }\n\n for (const stepId of this.deletedStepIDs) {\n const stepEntity = await md.GetEntityObject<MJAIAgentStepEntity>('MJ: AI Agent Steps');\n await stepEntity.InnerLoad(CompositeKey.FromID(stepId));\n await stepEntity.Delete();\n }\n\n this.deletedPathIDs = [];\n this.deletedStepIDs = [];\n }\n\n // ── Flow Editor Event Handlers ──────────────────────────────\n\n protected async onNodeAdded(event: FlowNodeAddedEvent): Promise<void> {\n if (!this.AgentID) return;\n\n const md = new Metadata();\n const step = await md.GetEntityObject<MJAIAgentStepEntity>('MJ: AI Agent Steps');\n step.NewRecord(); // This generates a UUID immediately - available before Save()\n step.AgentID = this.AgentID;\n step.Name = event.Node.Label;\n step.StepType = event.Node.Type as 'Action' | 'Prompt' | 'Sub-Agent' | 'ForEach' | 'While';\n step.Status = 'Active';\n step.StartingStep = this.steps.length === 0; // First step is starting step\n step.PositionX = Math.round(event.DropPosition.X);\n step.PositionY = Math.round(event.DropPosition.Y);\n step.OnErrorBehavior = 'fail';\n step.RetryCount = 0;\n step.TimeoutSeconds = 600;\n\n // Add the unsaved step to the array - it already has a UUID from NewRecord()\n // This allows connections to be drawn immediately without waiting for a database save\n this.steps.push(step);\n\n // Build a FlowNode using the entity's pre-generated ID so Foblex can track it\n const newNode = this.transformer.StepToNode(step, this.availableActions, this.availableAgents);\n this.nodes.push(newNode);\n this.markDirty();\n\n // Select the new node\n setTimeout(() => {\n this.flowEditor?.SelectNode(step.ID);\n this.onNodeSelected(newNode);\n }, 100);\n\n this.cdr.detectChanges();\n }\n\n protected async onConnectionCreated(event: FlowConnectionCreatedEvent): Promise<void> {\n if (!this.AgentID) return;\n\n // Prevent duplicate\n const exists = this.paths.some(\n p => UUIDsEqual(p.OriginStepID, event.SourceNodeID) && UUIDsEqual(p.DestinationStepID, event.TargetNodeID)\n );\n if (exists) return;\n\n const md = new Metadata();\n const path = await md.GetEntityObject<MJAIAgentStepPathEntity>('MJ: AI Agent Step Paths');\n path.NewRecord(); // Generates UUID immediately - available before Save()\n path.OriginStepID = event.SourceNodeID;\n path.DestinationStepID = event.TargetNodeID;\n path.Priority = 0;\n\n // Add unsaved path to the array - save will happen on main Save() button\n this.paths.push(path);\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onNodeSelected(node: FlowNode | null): void {\n if (node) {\n this.selectedStep = this.steps.find(s => UUIDsEqual(s.ID, node.ID)) ?? null;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.showPropertiesPanel = true;\n this.StepSelected.emit(this.selectedStep);\n } else {\n this.selectedStep = null;\n // Only hide the panel if no connection is currently selected.\n // When the user clicks a connection, Foblex fires NodeSelected(null) AND\n // ConnectionSelected(conn) — we must not let the null-node event hide\n // the panel that the connection event just opened.\n if (!this.selectedConnection) {\n this.showPropertiesPanel = false;\n }\n this.StepSelected.emit(null);\n }\n this.cdr.detectChanges();\n }\n\n protected onConnectionSelected(conn: FlowConnection | null): void {\n if (conn) {\n this.selectedConnection = conn;\n this.selectedPathEntity = this.paths.find(p => UUIDsEqual(p.ID, conn.ID)) ?? null;\n this.selectedStep = null;\n this.showPropertiesPanel = true;\n } else {\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n }\n this.cdr.detectChanges();\n }\n\n protected onNodeRemoved(node: FlowNode): void {\n const step = this.steps.find(s => UUIDsEqual(s.ID, node.ID));\n if (step) {\n // Track for deletion on save (only if it was previously saved)\n if (step.IsSaved) {\n this.deletedStepIDs.push(step.ID);\n // Also mark paths connected to this step for deletion\n const connectedPaths = this.paths.filter(\n p => UUIDsEqual(p.OriginStepID, step.ID) || UUIDsEqual(p.DestinationStepID, step.ID)\n );\n for (const path of connectedPaths) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n }\n }\n this.steps = this.steps.filter(s => !UUIDsEqual(s.ID, node.ID));\n this.paths = this.paths.filter(\n p => !UUIDsEqual(p.OriginStepID, node.ID) && !UUIDsEqual(p.DestinationStepID, node.ID)\n );\n this.markDirty();\n }\n }\n\n protected onConnectionRemoved(conn: FlowConnection): void {\n const path = this.paths.find(p => UUIDsEqual(p.ID, conn.ID));\n if (path) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n this.paths = this.paths.filter(p => !UUIDsEqual(p.ID, conn.ID));\n this.markDirty();\n }\n }\n\n protected onConnectionReassigned(event: FlowConnectionReassignedEvent): void {\n const path = this.paths.find(p => UUIDsEqual(p.ID, event.ConnectionID));\n if (!path) return;\n\n // Update the entity's origin/destination to match the new visual endpoints\n path.OriginStepID = event.NewSourceNodeID;\n path.DestinationStepID = event.NewTargetNodeID;\n\n // Rebuild all connections so sibling-based visual logic recalculates\n // (e.g., Default vs Duplicate Default labels depend on sibling analysis)\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onNodesChanged(nodes: FlowNode[]): void {\n this.nodes = nodes;\n // Sync canvas positions back to entities immediately so that\n // any subsequent rebuildFlowModel() preserves drag changes.\n this.syncPositionsToEntities();\n this.markDirty(); \n }\n\n protected onConnectionsChanged(connections: FlowConnection[]): void {\n this.connections = connections;\n this.markDirty();\n }\n\n // ── Properties Panel Events ─────────────────────────────────\n\n protected onStepChanged(step: MJAIAgentStepEntity): void {\n // Update the corresponding flow node in-place and push to generic editor\n const node = this.nodes.find(n => UUIDsEqual(n.ID, step.ID));\n if (node) {\n const newLabel = step.Name;\n const newSubtitle = this.transformer.BuildStepSubtitle(step);\n const baseStatus = this.transformer.MapStepStatus(step.Status);\n const warningMessage = (baseStatus !== 'disabled') ? this.transformer.BuildConfigWarningMessage(step) : null;\n const newStatus = warningMessage ? 'warning' : baseStatus;\n const newIsStart = step.StartingStep === true;\n\n node.Label = newLabel;\n node.Subtitle = newSubtitle;\n node.Status = newStatus;\n node.StatusMessage = warningMessage ?? undefined;\n node.IsStartNode = newIsStart;\n\n // Update input port disabled state for starting steps\n const inputPort = node.Ports.find(p => p.Direction === 'input');\n if (inputPort) {\n inputPort.Disabled = newIsStart;\n }\n\n // Re-resolve icon from picker data (handles action/agent assignment changes)\n const resolved = this.transformer.ResolveStepIcon(step, this.availableActions, this.availableAgents);\n node.Icon = resolved.Icon;\n if (!node.Data) node.Data = {};\n node.Data['LogoURL'] = resolved.LogoURL ?? null;\n\n // For loop nodes, rebuild the loop-specific Data properties so the\n // inner body card updates immediately when the user changes body type / config\n if (step.StepType === 'ForEach' || step.StepType === 'While') {\n this.updateLoopNodeData(step, node);\n }\n\n // Push visual update to the generic flow editor (creates new object ref for OnPush)\n this.flowEditor?.UpdateNode(step.ID, {\n Label: newLabel,\n Subtitle: newSubtitle,\n Status: newStatus,\n StatusMessage: warningMessage ?? undefined,\n IsStartNode: newIsStart,\n Icon: resolved.Icon,\n Data: node.Data\n });\n }\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n /** Update loop-specific data fields on a FlowNode from the step entity */\n private updateLoopNodeData(step: MJAIAgentStepEntity, node: FlowNode): void {\n if (!node.Data) node.Data = {};\n // Delegate to the transformer's public methods for consistency\n const bodyType = step.LoopBodyType;\n node.Data['LoopBodyType'] = bodyType ?? null;\n node.Data['LoopBodyName'] = this.resolveLoopBodyNameFromStep(step);\n node.Data['LoopBodyIcon'] = this.getBodyTypeIcon(bodyType);\n node.Data['LoopBodyColor'] = this.getBodyTypeColor(bodyType);\n node.Data['LoopIterationSummary'] = this.transformer.BuildLoopIterationSummary(step);\n }\n\n private resolveLoopBodyNameFromStep(step: MJAIAgentStepEntity): string | null {\n switch (step.LoopBodyType) {\n case 'Action': return step.Action ?? null;\n case 'Prompt': return step.Prompt ?? null;\n case 'Sub-Agent': return step.SubAgent ?? null;\n default: return null;\n }\n }\n\n private getBodyTypeIcon(bodyType: string | null): string {\n switch (bodyType) {\n case 'Action': return 'fa-bolt';\n case 'Prompt': return 'fa-comment-dots';\n case 'Sub-Agent': return 'fa-robot';\n default: return 'fa-circle-nodes';\n }\n }\n\n private getBodyTypeColor(bodyType: string | null): string {\n switch (bodyType) {\n case 'Action': return '#3B82F6';\n case 'Prompt': return '#8B5CF6';\n case 'Sub-Agent': return '#10B981';\n default: return '#6B7280';\n }\n }\n\n protected onPathChanged(path: MJAIAgentStepPathEntity): void {\n // Rebuild all connections from the same origin since always/conditional logic\n // depends on sibling paths (e.g., \"Default\" label only appears when siblings exist)\n this.rebuildFlowModel();\n this.markDirty();\n this.cdr.detectChanges();\n }\n\n protected onDeleteStepRequested(step: MJAIAgentStepEntity): void {\n const node = this.nodes.find(n => UUIDsEqual(n.ID, step.ID));\n if (node) {\n this.flowEditor?.SelectNode(step.ID);\n this.flowEditor?.DeleteSelected();\n }\n this.showPropertiesPanel = false;\n this.selectedStep = null;\n this.cdr.detectChanges();\n }\n\n protected onDeletePathRequested(path: MJAIAgentStepPathEntity): void {\n const conn = this.connections.find(c => UUIDsEqual(c.ID, path.ID));\n if (conn) {\n if (path.IsSaved) {\n this.deletedPathIDs.push(path.ID);\n }\n this.paths = this.paths.filter(p => !UUIDsEqual(p.ID, path.ID));\n this.rebuildFlowModel();\n this.markDirty();\n }\n this.showPropertiesPanel = false;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.cdr.detectChanges();\n }\n\n protected onCloseProperties(): void {\n this.showPropertiesPanel = false;\n this.flowEditor?.ClearSelection();\n }\n\n // ── View & UI Controls ──────────────────────────────────────\n\n protected toggleViewMode(): void {\n this.viewMode = this.viewMode === 'diagram' ? 'list' : 'diagram';\n this.cdr.detectChanges();\n }\n\n /** Whether editing is currently allowed — combines parent EditMode + fullscreen self-contained edit */\n get isEditingActive(): boolean {\n return this.EditMode || this.fullscreenEditMode;\n }\n\n protected toggleFullscreenEditMode(): void {\n this.fullscreenEditMode = !this.fullscreenEditMode;\n this.cdr.detectChanges();\n }\n\n protected cancelFullscreenEdit(): void {\n if (this.hasUnsavedChanges) {\n // Reload to discard changes\n this.fullscreenEditMode = false;\n this.hasUnsavedChanges = false;\n this.loadAll();\n } else {\n this.fullscreenEditMode = false;\n this.cdr.detectChanges();\n }\n }\n\n protected toggleFullScreen(): void {\n if (this.FullScreen && this.hasUnsavedChanges) {\n this.showUnsavedDialog = true;\n this.cdr.detectChanges();\n return;\n }\n this.performFullscreenToggle();\n }\n\n protected onUnsavedDialogSave(): void {\n this.showUnsavedDialog = false;\n this.Save().then(() => this.performFullscreenToggle());\n }\n\n protected onUnsavedDialogDiscard(): void {\n this.showUnsavedDialog = false;\n this.hasUnsavedChanges = false;\n this.fullscreenEditMode = false;\n this.performFullscreenToggle();\n // Reload original data\n this.loadAll();\n }\n\n protected onUnsavedDialogCancel(): void {\n this.showUnsavedDialog = false;\n this.cdr.detectChanges();\n }\n\n private performFullscreenToggle(): void {\n this.FullScreen = !this.FullScreen;\n\n if (this.FullScreen) {\n this.moveToBodyForFullscreen();\n } else {\n this.fullscreenEditMode = false;\n this.restoreFromFullscreen();\n }\n\n this.FullScreenToggled.emit(this.FullScreen);\n this.cdr.detectChanges();\n // Re-fit after layout change\n setTimeout(() => this.flowEditor?.ZoomToFit(), 200);\n }\n\n private moveToBodyForFullscreen(): void {\n const hostEl = this.elRef.nativeElement;\n this.originalParent = hostEl.parentElement;\n this.originalNextSibling = hostEl.nextSibling;\n\n // Create backdrop as a separate body-level element so it covers everything\n this.backdropElement = this.renderer.createElement('div');\n this.renderer.addClass(this.backdropElement, 'mj-agent-editor-backdrop');\n this.renderer.listen(this.backdropElement, 'click', () => this.toggleFullScreen());\n this.renderer.appendChild(document.body, this.backdropElement);\n\n // Move the host element to body — @HostBinding applies the fixed-position class\n this.renderer.appendChild(document.body, hostEl);\n }\n\n private restoreFromFullscreen(): void {\n // Remove backdrop\n if (this.backdropElement) {\n this.renderer.removeChild(document.body, this.backdropElement);\n this.backdropElement = null;\n }\n\n // Restore host element to original position\n if (!this.originalParent) return;\n const hostEl = this.elRef.nativeElement;\n if (this.originalNextSibling) {\n this.renderer.insertBefore(this.originalParent, hostEl, this.originalNextSibling);\n } else {\n this.renderer.appendChild(this.originalParent, hostEl);\n }\n this.originalParent = null;\n this.originalNextSibling = null;\n }\n\n protected onStepClickedInList(step: MJAIAgentStepEntity): void {\n this.selectedStep = step;\n this.selectedConnection = null;\n this.selectedPathEntity = null;\n this.showPropertiesPanel = true;\n this.StepSelected.emit(step);\n this.cdr.detectChanges();\n }\n\n // ── Keyboard Shortcuts ─────────────────────────────────────\n\n @HostListener('document:keydown.escape')\n protected onEscapeKey(): void {\n if (this.showUnsavedDialog) {\n this.onUnsavedDialogCancel();\n } else if (this.FullScreen) {\n this.toggleFullScreen();\n }\n }\n\n // ── Permission Check ────────────────────────────────────────\n\n private checkUpdatePermission(): void {\n const md = new Metadata();\n const entity = md.EntityByName('MJ: AI Agents');\n if (entity) {\n const perms = entity.GetUserPermisions(md.CurrentUser);\n this.userCanUpdate = perms?.CanUpdate === true;\n }\n }\n\n // ── View Preference Persistence ─────────────────────────────\n\n private loadViewPreferences(): void {\n const raw = UserInfoEngine.Instance.GetSetting(FlowAgentEditorComponent.PREF_KEY);\n if (raw) {\n try {\n const prefs = JSON.parse(raw) as { grid?: boolean; minimap?: boolean; legend?: boolean };\n if (prefs.grid != null) this.prefShowGrid = prefs.grid;\n if (prefs.minimap != null) this.prefShowMinimap = prefs.minimap;\n if (prefs.legend != null) this.prefShowLegend = prefs.legend;\n } catch {\n // Ignore malformed preference data\n }\n }\n }\n\n private saveViewPreferences(): void {\n const prefs = JSON.stringify({\n grid: this.prefShowGrid,\n minimap: this.prefShowMinimap,\n legend: this.prefShowLegend\n });\n // Fire-and-forget — preference save errors are non-critical\n UserInfoEngine.Instance.SetSetting(FlowAgentEditorComponent.PREF_KEY, prefs);\n }\n\n protected onGridPrefChanged(show: boolean): void {\n this.prefShowGrid = show;\n this.saveViewPreferences();\n }\n\n protected onMinimapPrefChanged(show: boolean): void {\n this.prefShowMinimap = show;\n this.saveViewPreferences();\n }\n\n protected onLegendPrefChanged(show: boolean): void {\n this.prefShowLegend = show;\n this.saveViewPreferences();\n }\n\n // ── Helpers ─────────────────────────────────────────────────\n\n private markDirty(): void {\n if (!this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n this.FlowChanged.emit(true);\n }\n }\n}\n","<div class=\"mj-agent-editor\">\n\n <!-- ── Toolbar ─────────────────────────────────────────────── -->\n <div class=\"mj-agent-editor-toolbar\" [class.mj-agent-editor-toolbar--editing]=\"isEditingActive\">\n <div class=\"mj-agent-editor-toolbar-left\">\n <!-- Undo / Redo (edit mode only) -->\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn\"\n [disabled]=\"!flowEditor?.CanUndo\" (click)=\"flowEditor?.Undo()\" title=\"Undo (Ctrl+Z)\">\n <i class=\"fa-solid fa-rotate-left\"></i>\n </button>\n }\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn\"\n [disabled]=\"!flowEditor?.CanRedo\" (click)=\"flowEditor?.Redo()\" title=\"Redo (Ctrl+Y)\">\n <i class=\"fa-solid fa-rotate-right\"></i>\n </button>\n }\n </div>\n\n <div class=\"mj-agent-editor-toolbar-center\">\n <!-- Fullscreen title -->\n <span class=\"mj-agent-editor-title\">\n <i class=\"fa-solid fa-diagram-project\"></i> Flow Configuration\n </span>\n\n <!-- View Mode Toggle -->\n <div class=\"mj-agent-editor-view-toggle\">\n <button class=\"mj-agent-editor-view-btn\"\n [class.mj-agent-editor-view-btn--active]=\"viewMode === 'diagram'\"\n (click)=\"viewMode = 'diagram'\">\n <i class=\"fa-solid fa-diagram-project\"></i> Diagram\n </button>\n <button class=\"mj-agent-editor-view-btn\"\n [class.mj-agent-editor-view-btn--active]=\"viewMode === 'list'\"\n (click)=\"viewMode = 'list'\">\n <i class=\"fa-solid fa-list\"></i> List\n </button>\n </div>\n\n <!-- Mode indicator badge -->\n @if (isEditingActive) {\n <span class=\"mj-agent-editor-mode-badge mj-agent-editor-mode-badge--editing\">\n <i class=\"fa-solid fa-pen\"></i> Editing\n </span>\n }\n @if (!isEditingActive) {\n <span class=\"mj-agent-editor-mode-badge mj-agent-editor-mode-badge--readonly\">\n <i class=\"fa-solid fa-lock\"></i> Read Only\n </span>\n }\n </div>\n\n <div class=\"mj-agent-editor-toolbar-right\">\n <!-- Status indicators -->\n @if (hasUnsavedChanges) {\n <span class=\"mj-agent-editor-status mj-agent-editor-status--unsaved\">\n <i class=\"fa-solid fa-circle\"></i> Unsaved\n </span>\n }\n @if (lastSaved) {\n <span class=\"mj-agent-editor-status\">\n Saved {{ lastSaved | date:'shortTime' }}\n </span>\n }\n\n <!-- Save + Cancel (when editing) -->\n @if (isEditingActive) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--primary\"\n [disabled]=\"isSaving || !hasUnsavedChanges\" (click)=\"Save()\">\n <i class=\"fa-solid\" [ngClass]=\"isSaving ? 'fa-spinner fa-spin' : 'fa-floppy-disk'\"></i>\n {{ isSaving ? 'Saving...' : 'Save' }}\n </button>\n }\n @if (fullscreenEditMode && !EditMode) {\n <button\n class=\"mj-agent-editor-btn\"\n (click)=\"cancelFullscreenEdit()\" title=\"Cancel editing\">\n <i class=\"fa-solid fa-xmark\"></i> Cancel\n </button>\n }\n\n @if (isEditingActive) {\n <div class=\"mj-agent-editor-btn-divider\"></div>\n }\n\n <!-- Fullscreen edit toggle (only when parent is NOT in edit mode) -->\n @if (!EditMode && !fullscreenEditMode && userCanUpdate) {\n <button\n class=\"mj-agent-editor-btn mj-agent-editor-btn--edit\"\n (click)=\"toggleFullscreenEditMode()\" title=\"Edit flow\">\n <i class=\"fa-solid fa-pen-to-square\"></i> Edit\n </button>\n }\n\n <!-- Expand / Close fullscreen -->\n @if (!FullScreen) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--expand\"\n (click)=\"toggleFullScreen()\" title=\"Expand to full screen\">\n <i class=\"fa-solid fa-up-right-and-down-left-from-center\"></i> Expand\n </button>\n }\n @if (FullScreen) {\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--close\"\n (click)=\"toggleFullScreen()\" title=\"Close full screen (Esc)\">\n <i class=\"fa-solid fa-xmark\"></i> Close\n </button>\n }\n </div>\n </div>\n\n <!-- ── Loading State ─────────────────────────────────────── -->\n @if (isLoading) {\n <div class=\"mj-agent-editor-loading\">\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n <span>Loading flow...</span>\n </div>\n }\n\n <!-- ── Main Content ──────────────────────────────────────── -->\n @if (!isLoading) {\n <div class=\"mj-agent-editor-body\">\n <!-- Diagram View -->\n @if (viewMode === 'diagram') {\n <div class=\"mj-agent-editor-diagram\">\n <mj-flow-editor #flowEditor\n [Nodes]=\"nodes\"\n [Connections]=\"connections\"\n [NodeTypes]=\"nodeTypes\"\n [ReadOnly]=\"!isEditingActive\"\n [ShowMinimap]=\"prefShowMinimap\"\n [ShowPalette]=\"isEditingActive\"\n [ShowGrid]=\"prefShowGrid\"\n [ShowLegend]=\"prefShowLegend\"\n [ShowStatusBar]=\"true\"\n [ShowToolbar]=\"true\"\n [AutoLayoutDirection]=\"'vertical'\"\n (NodeSelected)=\"onNodeSelected($event)\"\n (NodeAdded)=\"onNodeAdded($event)\"\n (NodeRemoved)=\"onNodeRemoved($event)\"\n (ConnectionCreated)=\"onConnectionCreated($event)\"\n (ConnectionRemoved)=\"onConnectionRemoved($event)\"\n (ConnectionReassigned)=\"onConnectionReassigned($event)\"\n (ConnectionSelected)=\"onConnectionSelected($event)\"\n (NodesChanged)=\"onNodesChanged($event)\"\n (ConnectionsChanged)=\"onConnectionsChanged($event)\"\n (GridToggled)=\"onGridPrefChanged($event)\"\n (MinimapToggled)=\"onMinimapPrefChanged($event)\"\n (LegendToggled)=\"onLegendPrefChanged($event)\">\n </mj-flow-editor>\n <!-- Properties Panel -->\n <div class=\"mj-agent-editor-properties\"\n [class.mj-agent-editor-properties--visible]=\"showPropertiesPanel\">\n <mj-agent-properties-panel\n [Step]=\"selectedStep\"\n [SelectedConnection]=\"selectedConnection\"\n [PathEntity]=\"selectedPathEntity\"\n [ReadOnly]=\"!isEditingActive\"\n [Actions]=\"availableActions\"\n [Prompts]=\"availablePrompts\"\n [Agents]=\"availableAgents\"\n [AllSteps]=\"steps\"\n (StepChanged)=\"onStepChanged($event)\"\n (PathChanged)=\"onPathChanged($event)\"\n (DeleteStepRequested)=\"onDeleteStepRequested($event)\"\n (DeletePathRequested)=\"onDeletePathRequested($event)\"\n (CloseRequested)=\"onCloseProperties()\">\n </mj-agent-properties-panel>\n </div>\n </div>\n }\n <!-- List View -->\n @if (viewMode === 'list') {\n <div class=\"mj-agent-editor-list\">\n <mj-agent-step-list\n [Steps]=\"steps\"\n [Paths]=\"paths\"\n [SelectedStepID]=\"selectedStep?.ID || null\"\n (StepClicked)=\"onStepClickedInList($event)\">\n </mj-agent-step-list>\n <!-- Properties Panel in list mode too -->\n <div class=\"mj-agent-editor-properties\"\n [class.mj-agent-editor-properties--visible]=\"showPropertiesPanel\">\n <mj-agent-properties-panel\n [Step]=\"selectedStep\"\n [SelectedConnection]=\"selectedConnection\"\n [PathEntity]=\"selectedPathEntity\"\n [ReadOnly]=\"!isEditingActive\"\n [Actions]=\"availableActions\"\n [Prompts]=\"availablePrompts\"\n [Agents]=\"availableAgents\"\n [AllSteps]=\"steps\"\n (StepChanged)=\"onStepChanged($event)\"\n (PathChanged)=\"onPathChanged($event)\"\n (DeleteStepRequested)=\"onDeleteStepRequested($event)\"\n (DeletePathRequested)=\"onDeletePathRequested($event)\"\n (CloseRequested)=\"onCloseProperties()\">\n </mj-agent-properties-panel>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- ── Unsaved Changes Dialog ──────────────────────────── -->\n @if (showUnsavedDialog) {\n <div class=\"mj-agent-editor-dialog-overlay\">\n <div class=\"mj-agent-editor-dialog\">\n <div class=\"mj-agent-editor-dialog-icon\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </div>\n <h3 class=\"mj-agent-editor-dialog-title\">Unsaved Changes</h3>\n <p class=\"mj-agent-editor-dialog-message\">\n You have unsaved changes to this flow. What would you like to do?\n </p>\n <div class=\"mj-agent-editor-dialog-actions\">\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--primary\" (click)=\"onUnsavedDialogSave()\">\n <i class=\"fa-solid fa-floppy-disk\"></i> Save & Close\n </button>\n <button class=\"mj-agent-editor-btn mj-agent-editor-btn--danger-outline\" (click)=\"onUnsavedDialogDiscard()\">\n Discard Changes\n </button>\n <button class=\"mj-agent-editor-btn\" (click)=\"onUnsavedDialogCancel()\">\n Cancel\n </button>\n </div>\n </div>\n </div>\n }\n</div>\n"]}
|