@memberjunction/ng-flow-editor 6.1.0-edge.1 → 6.1.0-edge.2
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 +31 -0
- package/dist/lib/agent-editor/agent-flow-transformer.service.d.ts.map +1 -1
- package/dist/lib/agent-editor/agent-flow-transformer.service.js +85 -22
- package/dist/lib/agent-editor/agent-flow-transformer.service.js.map +1 -1
- package/dist/lib/agent-editor/flow-agent-editor.component.d.ts +46 -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 +160 -97
- package/dist/lib/agent-editor/flow-agent-editor.component.js.map +1 -1
- package/dist/lib/components/flow-editor.component.d.ts +26 -1
- package/dist/lib/components/flow-editor.component.d.ts.map +1 -1
- package/dist/lib/components/flow-editor.component.js +202 -149
- package/dist/lib/components/flow-editor.component.js.map +1 -1
- package/dist/lib/components/flow-palette.component.d.ts +22 -3
- package/dist/lib/components/flow-palette.component.d.ts.map +1 -1
- package/dist/lib/components/flow-palette.component.js +48 -23
- package/dist/lib/components/flow-palette.component.js.map +1 -1
- package/dist/lib/flow-editor.module.d.ts +7 -6
- package/dist/lib/flow-editor.module.d.ts.map +1 -1
- package/dist/lib/flow-editor.module.js +6 -2
- package/dist/lib/flow-editor.module.js.map +1 -1
- package/package.json +9 -8
|
@@ -59,7 +59,38 @@ export declare class AgentFlowTransformerService {
|
|
|
59
59
|
/** Convert a single MJ step entity to a FlowNode (public for direct use when adding nodes) */
|
|
60
60
|
StepToNode(step: MJAIAgentStepEntity, actions?: ActionPickerItem[], agents?: AgentPickerItem[]): FlowNode;
|
|
61
61
|
private pathToConnection;
|
|
62
|
+
/**
|
|
63
|
+
* What an edge says on the canvas, and what it says on inspection.
|
|
64
|
+
*
|
|
65
|
+
* **An edge label answers one question: WHEN is this path taken?** That is the condition. The
|
|
66
|
+
* `Description` is the author's rationale — genuinely useful, and inspection-time content: it is
|
|
67
|
+
* prose, it is arbitrarily long, and rendering it always turned the least important element on the
|
|
68
|
+
* canvas into the most visually dominant one, overlapping nodes and other labels.
|
|
69
|
+
*
|
|
70
|
+
* So the condition is the LABEL (truncated), the description is the DETAIL (the hover tooltip),
|
|
71
|
+
* and an unconditional edge says nothing at all — a plain line already means "then". That last
|
|
72
|
+
* rule removes most of the clutter on a real graph, because most edges are unconditional.
|
|
73
|
+
*/
|
|
62
74
|
private buildPathVisuals;
|
|
75
|
+
/**
|
|
76
|
+
* This path's position among its conditional siblings, in the order the dispatcher checks them.
|
|
77
|
+
*
|
|
78
|
+
* Mirrors the COMPILER, which is where the order is actually decided: `buildDependencies` sorts a
|
|
79
|
+
* fan-out by `Priority` descending, then path ID ascending, and writes that ordinal into
|
|
80
|
+
* `TaskDependency.Sequence` — which is what `ResolveExclusiveGroups` then reads at runtime. A path
|
|
81
|
+
* row has no `Sequence` of its own and deliberately never has: a compiled edge gets a fresh UUID
|
|
82
|
+
* and needs a stored ordinal to stay deterministic across machines, while a design-time path still
|
|
83
|
+
* has its own stable ID to break the tie with. Ranking here by anything else would disagree with
|
|
84
|
+
* the engine precisely on ties — and `Priority` defaults to 0, so ties are the common case.
|
|
85
|
+
*/
|
|
86
|
+
private rankWithinGroup;
|
|
87
|
+
/**
|
|
88
|
+
* Trims a condition to what fits on an edge without covering its neighbours.
|
|
89
|
+
*
|
|
90
|
+
* Breaks on a word boundary when there is one near the limit, so the visible part stays readable
|
|
91
|
+
* rather than ending mid-identifier. The full text is always in `labelDetail`.
|
|
92
|
+
*/
|
|
93
|
+
private truncateLabel;
|
|
63
94
|
/** Populate loop-specific display data on the node's Data payload */
|
|
64
95
|
private populateLoopData;
|
|
65
96
|
/** Resolve the best icon for a loop body, checking picker data first */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-flow-transformer.service.d.ts","sourceRoot":"","sources":["../../../src/lib/agent-editor/agent-flow-transformer.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAuB,kBAAkB,EAAgB,MAAM,0BAA0B,CAAC;;AAG3H,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAAE;AAE1F,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAAE;AAElH,gDAAgD;AAChD,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,EAwDvD,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-flow-transformer.service.d.ts","sourceRoot":"","sources":["../../../src/lib/agent-editor/agent-flow-transformer.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAuB,kBAAkB,EAAgB,MAAM,0BAA0B,CAAC;;AAG3H,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAAE;AAE1F,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAAG,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAAE;AAElH,gDAAgD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AO,CAAC,gBAAgB;IAuDxB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,eAAe;IAavB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IASrB,qEAAqE;IACrE,OAAO,CAAC,gBAAgB;IA4BxB,wEAAwE;IACxE,OAAO,CAAC,2BAA2B;IAmBnC,oCAAoC;IACpC,OAAO,CAAC,eAAe;IASvB,qCAAqC;IACrC,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,iBAAiB;IAOzB,2DAA2D;IAC3D,OAAO,CAAC,mBAAmB;IAS3B,8DAA8D;IAC9D,OAAO,CAAC,eAAe;IASvB,gEAAgE;IAChE,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM;IAa5D,OAAO,CAAC,iBAAiB;yCA3fd,2BAA2B;6CAA3B,2BAA2B;CAggBvC"}
|
|
@@ -59,6 +59,12 @@ export const AGENT_STEP_TYPE_CONFIGS = [
|
|
|
59
59
|
]
|
|
60
60
|
}
|
|
61
61
|
];
|
|
62
|
+
/** "1st", "2nd", "3rd", … for the precedence note on an exclusive branch. */
|
|
63
|
+
function ordinal(n) {
|
|
64
|
+
const suffix = n % 100 >= 11 && n % 100 <= 13 ? 'th'
|
|
65
|
+
: ['th', 'st', 'nd', 'rd'][n % 10] ?? 'th';
|
|
66
|
+
return `${n}${suffix}`;
|
|
67
|
+
}
|
|
62
68
|
/**
|
|
63
69
|
* Transforms MJ AIAgentStep/Path entities to/from generic FlowNode/FlowConnection models.
|
|
64
70
|
*/
|
|
@@ -274,8 +280,15 @@ export class AgentFlowTransformerService {
|
|
|
274
280
|
// Multiple unconditional paths are always ambiguous because only the
|
|
275
281
|
// highest-priority one will execute — regardless of whether they have descriptions.
|
|
276
282
|
const hasAmbiguousAlways = isAlwaysPath && unconditionalSiblings.length > 1;
|
|
283
|
+
// Where this path sits in its exclusive group, when it is IN one. Highest Priority wins, ties
|
|
284
|
+
// broken by path ID — and none of that precedence is visible on the canvas today, so someone
|
|
285
|
+
// debugging a fork cannot tell which branch takes it when two conditions are both true.
|
|
286
|
+
const conditionalSiblings = siblingPaths.filter(p => p.Condition && p.Condition.trim().length > 0);
|
|
287
|
+
const rank = hasCondition && conditionalSiblings.length > 1
|
|
288
|
+
? this.rankWithinGroup(path, conditionalSiblings)
|
|
289
|
+
: null;
|
|
277
290
|
// Build label, icon, and visual style
|
|
278
|
-
const visual = this.buildPathVisuals(path, hasCondition, isOnlyPath, hasAmbiguousAlways);
|
|
291
|
+
const visual = this.buildPathVisuals(path, hasCondition, isOnlyPath, hasAmbiguousAlways, rank);
|
|
279
292
|
return {
|
|
280
293
|
ID: path.ID,
|
|
281
294
|
SourceNodeID: path.OriginStepID,
|
|
@@ -297,45 +310,95 @@ export class AgentFlowTransformerService {
|
|
|
297
310
|
}
|
|
298
311
|
};
|
|
299
312
|
}
|
|
300
|
-
|
|
301
|
-
|
|
313
|
+
/**
|
|
314
|
+
* What an edge says on the canvas, and what it says on inspection.
|
|
315
|
+
*
|
|
316
|
+
* **An edge label answers one question: WHEN is this path taken?** That is the condition. The
|
|
317
|
+
* `Description` is the author's rationale — genuinely useful, and inspection-time content: it is
|
|
318
|
+
* prose, it is arbitrarily long, and rendering it always turned the least important element on the
|
|
319
|
+
* canvas into the most visually dominant one, overlapping nodes and other labels.
|
|
320
|
+
*
|
|
321
|
+
* So the condition is the LABEL (truncated), the description is the DETAIL (the hover tooltip),
|
|
322
|
+
* and an unconditional edge says nothing at all — a plain line already means "then". That last
|
|
323
|
+
* rule removes most of the clutter on a real graph, because most edges are unconditional.
|
|
324
|
+
*/
|
|
325
|
+
buildPathVisuals(path, hasCondition, isOnlyPath, hasAmbiguousAlways, rank = null) {
|
|
326
|
+
const rationale = path.Description?.trim();
|
|
327
|
+
// Conditional path — amber dashed, labelled with the RULE.
|
|
302
328
|
if (hasCondition) {
|
|
329
|
+
const condition = path.Condition.trim();
|
|
330
|
+
// The rank prefix is tiny and always fits, so it survives truncation — which matters, because
|
|
331
|
+
// precedence is exactly what a truncated condition would otherwise hide.
|
|
332
|
+
const prefix = rank ? `${rank.position}/${rank.total} ` : '';
|
|
333
|
+
const precedence = rank
|
|
334
|
+
? `\n\nChecked ${ordinal(rank.position)} of ${rank.total}: highest priority wins, ties by path ID.`
|
|
335
|
+
: '';
|
|
303
336
|
return {
|
|
304
|
-
label:
|
|
337
|
+
label: prefix + this.truncateLabel(condition, rank ? 28 : 32),
|
|
338
|
+
labelIcon: 'fa-code-branch',
|
|
339
|
+
labelIconColor: '#f59e0b',
|
|
340
|
+
// Full condition first — a truncated label is only safe if the whole thing is one hover
|
|
341
|
+
// away — then the rationale, then how this branch is chosen against its siblings.
|
|
342
|
+
labelDetail: (rationale ? `${condition}\n\n${rationale}` : condition) + precedence,
|
|
305
343
|
color: '#f59e0b',
|
|
306
344
|
style: 'dashed'
|
|
307
345
|
};
|
|
308
346
|
}
|
|
309
|
-
//
|
|
310
|
-
|
|
311
|
-
return {
|
|
312
|
-
label: path.Description || 'Default',
|
|
313
|
-
labelIcon: 'fa-circle-check',
|
|
314
|
-
labelIconColor: '#16a34a',
|
|
315
|
-
color: '#64748b',
|
|
316
|
-
style: 'solid'
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
// Ambiguous: multiple unconditional paths from the same step
|
|
347
|
+
// Ambiguous: multiple unconditional paths from the same step. This one KEEPS its label, because
|
|
348
|
+
// it is a defect the author needs to see without hovering anything.
|
|
320
349
|
if (hasAmbiguousAlways) {
|
|
321
350
|
return {
|
|
322
|
-
label:
|
|
351
|
+
label: 'Duplicate default',
|
|
323
352
|
labelIcon: 'fa-triangle-exclamation',
|
|
324
353
|
labelIconColor: '#ef4444',
|
|
325
|
-
labelDetail:
|
|
354
|
+
labelDetail: rationale
|
|
355
|
+
? `Duplicate default paths: only the highest-priority one will execute.\n\n${rationale}`
|
|
356
|
+
: 'Duplicate default paths: only the highest-priority one will execute',
|
|
326
357
|
color: '#ef4444',
|
|
327
358
|
style: 'solid'
|
|
328
359
|
};
|
|
329
360
|
}
|
|
330
|
-
//
|
|
361
|
+
// Every other unconditional path — NO LABEL. The line already means "then", and "Default" on
|
|
362
|
+
// every edge of a linear flow is a caption on each arrow of a diagram saying "arrow".
|
|
363
|
+
// The rationale stays reachable on hover.
|
|
331
364
|
return {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
labelIconColor: '#16a34a',
|
|
335
|
-
color: '#16a34a',
|
|
365
|
+
labelDetail: rationale || undefined,
|
|
366
|
+
color: isOnlyPath ? '#64748b' : '#16a34a',
|
|
336
367
|
style: 'solid'
|
|
337
368
|
};
|
|
338
369
|
}
|
|
370
|
+
/**
|
|
371
|
+
* This path's position among its conditional siblings, in the order the dispatcher checks them.
|
|
372
|
+
*
|
|
373
|
+
* Mirrors the COMPILER, which is where the order is actually decided: `buildDependencies` sorts a
|
|
374
|
+
* fan-out by `Priority` descending, then path ID ascending, and writes that ordinal into
|
|
375
|
+
* `TaskDependency.Sequence` — which is what `ResolveExclusiveGroups` then reads at runtime. A path
|
|
376
|
+
* row has no `Sequence` of its own and deliberately never has: a compiled edge gets a fresh UUID
|
|
377
|
+
* and needs a stored ordinal to stay deterministic across machines, while a design-time path still
|
|
378
|
+
* has its own stable ID to break the tie with. Ranking here by anything else would disagree with
|
|
379
|
+
* the engine precisely on ties — and `Priority` defaults to 0, so ties are the common case.
|
|
380
|
+
*/
|
|
381
|
+
rankWithinGroup(path, siblings) {
|
|
382
|
+
const ordered = [...siblings].sort((a, b) => (b.Priority ?? 0) - (a.Priority ?? 0) || a.ID.localeCompare(b.ID));
|
|
383
|
+
return {
|
|
384
|
+
position: ordered.findIndex(p => UUIDsEqual(p.ID, path.ID)) + 1,
|
|
385
|
+
total: ordered.length
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Trims a condition to what fits on an edge without covering its neighbours.
|
|
390
|
+
*
|
|
391
|
+
* Breaks on a word boundary when there is one near the limit, so the visible part stays readable
|
|
392
|
+
* rather than ending mid-identifier. The full text is always in `labelDetail`.
|
|
393
|
+
*/
|
|
394
|
+
truncateLabel(text, limit = 32) {
|
|
395
|
+
const flat = text.replace(/\s+/g, ' ').trim();
|
|
396
|
+
if (flat.length <= limit)
|
|
397
|
+
return flat;
|
|
398
|
+
const cut = flat.slice(0, limit);
|
|
399
|
+
const lastSpace = cut.lastIndexOf(' ');
|
|
400
|
+
return `${(lastSpace > limit * 0.6 ? cut.slice(0, lastSpace) : cut).trimEnd()}…`;
|
|
401
|
+
}
|
|
339
402
|
/** Populate loop-specific display data on the node's Data payload */
|
|
340
403
|
populateLoopData(step, data, actions, agents) {
|
|
341
404
|
const bodyType = step.LoopBodyType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-flow-transformer.service.js","sourceRoot":"","sources":["../../../src/lib/agent-editor/agent-flow-transformer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;AAQpD,gDAAgD;AAChD,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,OAAO;QACjB,YAAY,EAAE;YACZ,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE;YAChE,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;SACtE;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,OAAO;QACjB,YAA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GAAG,MAAM,EAAE,CAAC,gBAAgB,CAAuB,CAAC;YACpE,OAAO,UAAU,CAAC,CAAC,CAAC,QAAQ,UAAU,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAC/D,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YAC9B,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC,WAAW,CAAuB,CAAC;YAC9D,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;QACtF,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAEO,iBAAiB,CAAC,SAAiB;QACzC,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,IAAI,SAAS,CAAC,MAAM,IAAI,MAAM;YAAE,OAAO,SAAS,CAAC;QACjD,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC;IAChD,CAAC;qHA7bU,2BAA2B;gEAA3B,2BAA2B,WAA3B,2BAA2B;;iFAA3B,2BAA2B;cADvC,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\nimport { MJAIAgentStepEntity, MJAIAgentStepPathEntity } from '@memberjunction/core-entities';\nimport { FlowNode, FlowConnection, FlowConnectionStyle, FlowNodeTypeConfig, FlowNodePort } from '../interfaces/flow-types';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/** Picker item shape for Actions with optional icon */\nexport interface ActionPickerItem { ID: string; Name: string; IconClass?: string | null; }\n\n/** Picker item shape for Agents with optional icon and logo */\nexport interface AgentPickerItem { ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null; }\n\n/** Step types mapped to visual configuration */\nexport const AGENT_STEP_TYPE_CONFIGS: FlowNodeTypeConfig[] = [\n {\n Type: 'Action',\n Label: 'Action',\n Icon: 'fa-bolt',\n Color: '#3B82F6',\n Category: 'Steps',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n },\n {\n Type: 'Prompt',\n Label: 'Prompt',\n Icon: 'fa-comment-dots',\n Color: '#8B5CF6',\n Category: 'Steps',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n },\n {\n Type: 'Sub-Agent',\n Label: 'Sub-Agent',\n Icon: 'fa-robot',\n Color: '#10B981',\n Category: 'Steps',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n },\n {\n Type: 'ForEach',\n Label: 'For Each',\n Icon: 'fa-arrows-repeat',\n Color: '#F59E0B',\n Category: 'Loops',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n },\n {\n Type: 'While',\n Label: 'While',\n Icon: 'fa-rotate',\n Color: '#F97316',\n Category: 'Loops',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n }\n];\n\n/**\n * Transforms MJ AIAgentStep/Path entities to/from generic FlowNode/FlowConnection models.\n */\n@Injectable()\nexport class AgentFlowTransformerService {\n\n /** Convert MJ step entities to generic FlowNodes */\n StepsToNodes(\n steps: MJAIAgentStepEntity[],\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): FlowNode[] {\n return steps.map(step => this.StepToNode(step, actions, agents));\n }\n\n /** Convert MJ path entities to generic FlowConnections */\n PathsToConnections(paths: MJAIAgentStepPathEntity[]): FlowConnection[] {\n return paths.map(path => this.pathToConnection(path, paths));\n }\n\n /** Build the subtitle for a step based on its configured action/prompt/agent */\n BuildStepSubtitle(step: MJAIAgentStepEntity): string {\n switch (step.StepType) {\n case 'Action':\n return step.Action ? `Action: ${step.Action}` : 'No action selected';\n case 'Prompt':\n return step.Prompt ? `Prompt: ${step.Prompt}` : 'No prompt selected';\n case 'Sub-Agent':\n return step.SubAgent ? `Agent: ${step.SubAgent}` : 'No sub-agent selected';\n case 'ForEach':\n return this.buildLoopSubtitle(step, 'For Each');\n case 'While':\n return this.buildLoopSubtitle(step, 'While');\n default:\n return step.StepType;\n }\n }\n\n /** Apply FlowNode position changes back to a step entity */\n ApplyNodePosition(step: MJAIAgentStepEntity, node: FlowNode): void {\n step.PositionX = Math.round(node.Position.X);\n step.PositionY = Math.round(node.Position.Y);\n if (node.Size) {\n step.Width = Math.round(node.Size.Width);\n step.Height = Math.round(node.Size.Height);\n }\n }\n\n /** Map FlowNode status from step entity status */\n MapStepStatus(stepStatus: string): FlowNode['Status'] {\n switch (stepStatus) {\n case 'Active': return 'default';\n case 'Disabled': return 'disabled';\n case 'Pending': return 'pending';\n default: return 'default';\n }\n }\n\n /**\n * Returns a short human-readable message describing what's missing,\n * or null if the step is fully configured.\n */\n BuildConfigWarningMessage(step: MJAIAgentStepEntity): string | null {\n switch (step.StepType) {\n case 'Action':\n return !step.ActionID ? 'No action selected' : null;\n case 'Prompt':\n return !step.PromptID ? 'No prompt selected' : null;\n case 'Sub-Agent':\n return !step.SubAgentID ? 'No sub-agent selected' : null;\n case 'ForEach':\n case 'While':\n return this.buildLoopWarningMessage(step);\n default:\n return null;\n }\n }\n\n private buildLoopWarningMessage(step: MJAIAgentStepEntity): string | null {\n const bodyType = step.LoopBodyType;\n if (!bodyType) return 'No loop body type selected';\n switch (bodyType) {\n case 'Action': return !step.ActionID ? 'No action selected for loop body' : null;\n case 'Prompt': return !step.PromptID ? 'No prompt selected for loop body' : null;\n case 'Sub-Agent': return !step.SubAgentID ? 'No sub-agent selected for loop body' : null;\n default: return null;\n }\n }\n\n /**\n * Returns true when a step is missing its required configuration reference\n * (e.g., an Action step with no ActionID, a Prompt step with no PromptID).\n */\n IsStepMissingConfiguration(step: MJAIAgentStepEntity): boolean {\n switch (step.StepType) {\n case 'Action':\n return !step.ActionID;\n case 'Prompt':\n return !step.PromptID;\n case 'Sub-Agent':\n return !step.SubAgentID;\n case 'ForEach':\n case 'While':\n return this.isLoopBodyMissingReference(step);\n default:\n return false;\n }\n }\n\n private isLoopBodyMissingReference(step: MJAIAgentStepEntity): boolean {\n const bodyType = step.LoopBodyType;\n if (!bodyType) return true; // No body type selected at all\n switch (bodyType) {\n case 'Action': return !step.ActionID;\n case 'Prompt': return !step.PromptID;\n case 'Sub-Agent': return !step.SubAgentID;\n default: return false;\n }\n }\n\n /**\n * Resolve the best icon and optional logo URL for a step based on its\n * configured action/agent and available picker data.\n *\n * Resolution chain:\n * - Action step: action's IconClass -> step-type fallback\n * - Sub-Agent step: agent's LogoURL (stored in Data) -> agent's IconClass -> step-type fallback\n * - Other steps: step-type icon\n */\n ResolveStepIcon(\n step: MJAIAgentStepEntity,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): { Icon: string; LogoURL?: string | null } {\n const fallbackIcon = this.getIconForType(step.StepType);\n\n if (step.StepType === 'Action' && step.ActionID && actions) {\n const action = actions.find(a => UUIDsEqual(a.ID, step.ActionID));\n return { Icon: action?.IconClass || fallbackIcon };\n }\n\n if (step.StepType === 'Sub-Agent' && step.SubAgentID && agents) {\n const agent = agents.find(a => UUIDsEqual(a.ID, step.SubAgentID));\n if (agent?.LogoURL) {\n return { Icon: agent.IconClass || fallbackIcon, LogoURL: agent.LogoURL };\n }\n return { Icon: agent?.IconClass || fallbackIcon };\n }\n\n // For loop steps, resolve based on loop body type\n if ((step.StepType === 'ForEach' || step.StepType === 'While') && step.LoopBodyType) {\n return this.resolveLoopBodyIcon(step, actions, agents);\n }\n\n return { Icon: fallbackIcon };\n }\n\n private resolveLoopBodyIcon(\n step: MJAIAgentStepEntity,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): { Icon: string; LogoURL?: string | null } {\n const fallbackIcon = this.getIconForType(step.StepType);\n\n if (step.LoopBodyType === 'Action' && step.ActionID && actions) {\n const action = actions.find(a => UUIDsEqual(a.ID, step.ActionID));\n if (action?.IconClass) return { Icon: fallbackIcon }; // Loop keeps its own icon; body icon handled separately\n }\n\n if (step.LoopBodyType === 'Sub-Agent' && step.SubAgentID && agents) {\n const agent = agents.find(a => UUIDsEqual(a.ID, step.SubAgentID));\n if (agent?.LogoURL) return { Icon: fallbackIcon, LogoURL: agent.LogoURL };\n }\n\n return { Icon: fallbackIcon };\n }\n\n // ── Public Conversion Methods ───────────────────────────────\n\n /** Convert a single MJ step entity to a FlowNode (public for direct use when adding nodes) */\n StepToNode(\n step: MJAIAgentStepEntity,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): FlowNode {\n const stepId = step.ID;\n const ports: FlowNodePort[] = [\n {\n ID: `${stepId}-input`,\n Direction: 'input',\n Side: 'top',\n Multiple: true,\n Disabled: step.StartingStep === true\n },\n {\n ID: `${stepId}-output`,\n Direction: 'output',\n Side: 'bottom',\n Multiple: true\n }\n ];\n\n // Show warning status when the step is missing its required configuration,\n // unless the step is explicitly disabled (respect the user's intent).\n const baseStatus = this.MapStepStatus(step.Status);\n const warningMessage = (baseStatus !== 'disabled') ? this.BuildConfigWarningMessage(step) : null;\n const effectiveStatus = warningMessage ? 'warning' : baseStatus;\n\n // Build loop-specific data for ForEach/While nodes\n const data: Record<string, unknown> = { StepEntityID: stepId };\n if (step.StepType === 'ForEach' || step.StepType === 'While') {\n this.populateLoopData(step, data, actions, agents);\n }\n\n // Resolve icon (and optional logo URL) from picker data\n const resolved = this.ResolveStepIcon(step, actions, agents);\n if (resolved.LogoURL) {\n data['LogoURL'] = resolved.LogoURL;\n }\n\n return {\n ID: stepId,\n Type: step.StepType,\n Label: step.Name,\n Subtitle: this.BuildStepSubtitle(step),\n Icon: resolved.Icon,\n Status: effectiveStatus,\n StatusMessage: warningMessage ?? undefined,\n IsStartNode: step.StartingStep === true,\n Position: {\n X: step.PositionX ?? 0,\n Y: step.PositionY ?? 0\n },\n Size: {\n Width: step.Width ?? 220,\n Height: step.Height ?? 100\n },\n Ports: ports,\n Data: data\n };\n }\n\n private pathToConnection(path: MJAIAgentStepPathEntity, allPaths: MJAIAgentStepPathEntity[]): FlowConnection {\n const hasCondition = path.Condition != null && path.Condition.trim().length > 0;\n const isAlwaysPath = !hasCondition;\n\n // Analyze sibling paths from the same origin step\n const siblingPaths = allPaths.filter(p => UUIDsEqual(p.OriginStepID, path.OriginStepID));\n const isOnlyPath = siblingPaths.length === 1;\n const unconditionalSiblings = siblingPaths.filter(\n p => !p.Condition || p.Condition.trim().length === 0\n );\n // Flag as ambiguous when 2+ unconditional paths exist from the same source.\n // Multiple unconditional paths are always ambiguous because only the\n // highest-priority one will execute — regardless of whether they have descriptions.\n const hasAmbiguousAlways = isAlwaysPath && unconditionalSiblings.length > 1;\n\n // Build label, icon, and visual style\n const visual = this.buildPathVisuals(path, hasCondition, isOnlyPath, hasAmbiguousAlways);\n\n return {\n ID: path.ID,\n SourceNodeID: path.OriginStepID,\n SourcePortID: `${path.OriginStepID}-output`,\n TargetNodeID: path.DestinationStepID,\n TargetPortID: `${path.DestinationStepID}-input`,\n Label: visual.label,\n LabelIcon: visual.labelIcon,\n LabelIconColor: visual.labelIconColor,\n LabelDetail: visual.labelDetail,\n Condition: path.Condition ?? undefined,\n Priority: path.Priority,\n Style: visual.style,\n Color: visual.color,\n Data: {\n PathEntityID: path.ID,\n IsAlwaysPath: !hasCondition,\n HasAmbiguousAlways: hasAmbiguousAlways\n }\n };\n }\n\n private buildPathVisuals(\n path: MJAIAgentStepPathEntity,\n hasCondition: boolean,\n isOnlyPath: boolean,\n hasAmbiguousAlways: boolean\n ): { label?: string; labelIcon?: string; labelIconColor?: string; labelDetail?: string; color: string; style: FlowConnectionStyle } {\n // Conditional path — amber dashed with condition text\n if (hasCondition) {\n return {\n label: path.Description || path.Condition!,\n color: '#f59e0b',\n style: 'dashed'\n };\n }\n\n // Sole unconditional (only exit path) — neutral dark slate with Default indicator\n if (isOnlyPath) {\n return {\n label: path.Description || 'Default',\n labelIcon: 'fa-circle-check',\n labelIconColor: '#16a34a',\n color: '#64748b',\n style: 'solid'\n };\n }\n\n // Ambiguous: multiple unconditional paths from the same step\n if (hasAmbiguousAlways) {\n return {\n label: path.Description || 'Default',\n labelIcon: 'fa-triangle-exclamation',\n labelIconColor: '#ef4444',\n labelDetail: 'Duplicate default paths: only the highest-priority one will execute',\n color: '#ef4444',\n style: 'solid'\n };\n }\n\n // Valid default path (unconditional among conditional siblings) — forest green with checkmark\n return {\n label: path.Description || 'Default',\n labelIcon: 'fa-circle-check',\n labelIconColor: '#16a34a',\n color: '#16a34a',\n style: 'solid'\n };\n }\n\n /** Populate loop-specific display data on the node's Data payload */\n private populateLoopData(\n step: MJAIAgentStepEntity,\n data: Record<string, unknown>,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): void {\n const bodyType = step.LoopBodyType;\n data['LoopBodyType'] = bodyType ?? null;\n data['LoopBodyName'] = bodyType ? this.resolveLoopBodyName(step) : null;\n data['LoopBodyIcon'] = bodyType ? this.resolveLoopBodySpecificIcon(step, actions, agents) : null;\n data['LoopBodyColor'] = bodyType ? this.getBodyTypeColor(bodyType) : null;\n data['LoopIterationSummary'] = this.BuildLoopIterationSummary(step);\n\n // Store logo URL for loop body sub-agents\n if (bodyType === 'Sub-Agent' && step.SubAgentID && agents) {\n const agent = agents.find(a => UUIDsEqual(a.ID, step.SubAgentID));\n if (agent?.LogoURL) {\n data['LoopBodyLogoURL'] = agent.LogoURL;\n }\n }\n\n const config = this.parseLoopConfig(step);\n if (config) {\n data['MaxIterations'] = config['maxIterations'] ?? null;\n data['LoopItemVariable'] = config['itemVariable'] ?? null;\n }\n }\n\n /** Resolve the best icon for a loop body, checking picker data first */\n private resolveLoopBodySpecificIcon(\n step: MJAIAgentStepEntity,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): string {\n const bodyType = step.LoopBodyType;\n const fallback = this.getBodyTypeIcon(bodyType ?? '');\n\n if (bodyType === 'Action' && step.ActionID && actions) {\n const action = actions.find(a => UUIDsEqual(a.ID, step.ActionID));\n return action?.IconClass || fallback;\n }\n if (bodyType === 'Sub-Agent' && step.SubAgentID && agents) {\n const agent = agents.find(a => UUIDsEqual(a.ID, step.SubAgentID));\n return agent?.IconClass || fallback;\n }\n return fallback;\n }\n\n /** Get icon for a loop body type */\n private getBodyTypeIcon(bodyType: string): 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 /** Get color for a loop body type */\n private getBodyTypeColor(bodyType: string): 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 private getIconForType(stepType: string): string {\n const config = AGENT_STEP_TYPE_CONFIGS.find(c => c.Type === stepType);\n return config?.Icon ?? 'fa-circle-nodes';\n }\n\n private buildLoopSubtitle(step: MJAIAgentStepEntity, prefix: string): string {\n const bodyType = step.LoopBodyType;\n if (!bodyType) return `${prefix} (no body type)`;\n const bodyName = this.resolveLoopBodyName(step);\n return bodyName ? `${prefix} → ${bodyName}` : `${prefix} → ${bodyType}`;\n }\n\n /** Resolve the display name for the loop body operation */\n private resolveLoopBodyName(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 /** Parse the Configuration JSON, returning null on failure */\n private parseLoopConfig(step: MJAIAgentStepEntity): Record<string, unknown> | null {\n if (!step.Configuration) return null;\n try {\n return JSON.parse(step.Configuration) as Record<string, unknown>;\n } catch {\n return null;\n }\n }\n\n /** Build a short iteration summary for display on loop nodes */\n BuildLoopIterationSummary(step: MJAIAgentStepEntity): string {\n const config = this.parseLoopConfig(step);\n if (step.StepType === 'ForEach') {\n const collection = config?.['collectionPath'] as string | undefined;\n return collection ? `over ${collection}` : 'over collection';\n }\n if (step.StepType === 'While') {\n const condition = config?.['condition'] as string | undefined;\n return condition ? `while ${this.truncateCondition(condition)}` : 'while condition';\n }\n return '';\n }\n\n private truncateCondition(condition: string): string {\n const maxLen = 30;\n if (condition.length <= maxLen) return condition;\n return condition.substring(0, maxLen) + '...';\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"agent-flow-transformer.service.js","sourceRoot":"","sources":["../../../src/lib/agent-editor/agent-flow-transformer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;AAQpD,gDAAgD;AAChD,MAAM,CAAC,MAAM,uBAAuB,GAAyB;IAC3D;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,OAAO;QACjB,YAAY,EAAE;YACZ,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE;YAChE,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;SACtE;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,OAAO;QACjB,YAAY,EAAE;YACZ,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,I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E,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAC/D,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YAC9B,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC,WAAW,CAAuB,CAAC;YAC9D,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;QACtF,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAEO,iBAAiB,CAAC,SAAiB;QACzC,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,IAAI,SAAS,CAAC,MAAM,IAAI,MAAM;YAAE,OAAO,SAAS,CAAC;QACjD,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC;IAChD,CAAC;qHA/fU,2BAA2B;gEAA3B,2BAA2B,WAA3B,2BAA2B;;iFAA3B,2BAA2B;cADvC,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\nimport { MJAIAgentStepEntity, MJAIAgentStepPathEntity } from '@memberjunction/core-entities';\nimport { FlowNode, FlowConnection, FlowConnectionStyle, FlowNodeTypeConfig, FlowNodePort } from '../interfaces/flow-types';\nimport { UUIDsEqual } from '@memberjunction/global';\n\n/** Picker item shape for Actions with optional icon */\nexport interface ActionPickerItem { ID: string; Name: string; IconClass?: string | null; }\n\n/** Picker item shape for Agents with optional icon and logo */\nexport interface AgentPickerItem { ID: string; Name: string; IconClass?: string | null; LogoURL?: string | null; }\n\n/** Step types mapped to visual configuration */\nexport const AGENT_STEP_TYPE_CONFIGS: FlowNodeTypeConfig[] = [\n {\n Type: 'Action',\n Label: 'Action',\n Icon: 'fa-bolt',\n Color: '#3B82F6',\n Category: 'Steps',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n },\n {\n Type: 'Prompt',\n Label: 'Prompt',\n Icon: 'fa-comment-dots',\n Color: '#8B5CF6',\n Category: 'Steps',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n },\n {\n Type: 'Sub-Agent',\n Label: 'Sub-Agent',\n Icon: 'fa-robot',\n Color: '#10B981',\n Category: 'Steps',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n },\n {\n Type: 'ForEach',\n Label: 'For Each',\n Icon: 'fa-arrows-repeat',\n Color: '#F59E0B',\n Category: 'Loops',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n },\n {\n Type: 'While',\n Label: 'While',\n Icon: 'fa-rotate',\n Color: '#F97316',\n Category: 'Loops',\n DefaultPorts: [\n { ID: 'input', Direction: 'input', Side: 'top', Multiple: true },\n { ID: 'output', Direction: 'output', Side: 'bottom', Multiple: true }\n ]\n }\n];\n\n/** \"1st\", \"2nd\", \"3rd\", … for the precedence note on an exclusive branch. */\nfunction ordinal(n: number): string {\n const suffix = n % 100 >= 11 && n % 100 <= 13 ? 'th'\n : ['th', 'st', 'nd', 'rd'][n % 10] ?? 'th';\n return `${n}${suffix}`;\n}\n\n/**\n * Transforms MJ AIAgentStep/Path entities to/from generic FlowNode/FlowConnection models.\n */\n@Injectable()\nexport class AgentFlowTransformerService {\n\n /** Convert MJ step entities to generic FlowNodes */\n StepsToNodes(\n steps: MJAIAgentStepEntity[],\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): FlowNode[] {\n return steps.map(step => this.StepToNode(step, actions, agents));\n }\n\n /** Convert MJ path entities to generic FlowConnections */\n PathsToConnections(paths: MJAIAgentStepPathEntity[]): FlowConnection[] {\n return paths.map(path => this.pathToConnection(path, paths));\n }\n\n /** Build the subtitle for a step based on its configured action/prompt/agent */\n BuildStepSubtitle(step: MJAIAgentStepEntity): string {\n switch (step.StepType) {\n case 'Action':\n return step.Action ? `Action: ${step.Action}` : 'No action selected';\n case 'Prompt':\n return step.Prompt ? `Prompt: ${step.Prompt}` : 'No prompt selected';\n case 'Sub-Agent':\n return step.SubAgent ? `Agent: ${step.SubAgent}` : 'No sub-agent selected';\n case 'ForEach':\n return this.buildLoopSubtitle(step, 'For Each');\n case 'While':\n return this.buildLoopSubtitle(step, 'While');\n default:\n return step.StepType;\n }\n }\n\n /** Apply FlowNode position changes back to a step entity */\n ApplyNodePosition(step: MJAIAgentStepEntity, node: FlowNode): void {\n step.PositionX = Math.round(node.Position.X);\n step.PositionY = Math.round(node.Position.Y);\n if (node.Size) {\n step.Width = Math.round(node.Size.Width);\n step.Height = Math.round(node.Size.Height);\n }\n }\n\n /** Map FlowNode status from step entity status */\n MapStepStatus(stepStatus: string): FlowNode['Status'] {\n switch (stepStatus) {\n case 'Active': return 'default';\n case 'Disabled': return 'disabled';\n case 'Pending': return 'pending';\n default: return 'default';\n }\n }\n\n /**\n * Returns a short human-readable message describing what's missing,\n * or null if the step is fully configured.\n */\n BuildConfigWarningMessage(step: MJAIAgentStepEntity): string | null {\n switch (step.StepType) {\n case 'Action':\n return !step.ActionID ? 'No action selected' : null;\n case 'Prompt':\n return !step.PromptID ? 'No prompt selected' : null;\n case 'Sub-Agent':\n return !step.SubAgentID ? 'No sub-agent selected' : null;\n case 'ForEach':\n case 'While':\n return this.buildLoopWarningMessage(step);\n default:\n return null;\n }\n }\n\n private buildLoopWarningMessage(step: MJAIAgentStepEntity): string | null {\n const bodyType = step.LoopBodyType;\n if (!bodyType) return 'No loop body type selected';\n switch (bodyType) {\n case 'Action': return !step.ActionID ? 'No action selected for loop body' : null;\n case 'Prompt': return !step.PromptID ? 'No prompt selected for loop body' : null;\n case 'Sub-Agent': return !step.SubAgentID ? 'No sub-agent selected for loop body' : null;\n default: return null;\n }\n }\n\n /**\n * Returns true when a step is missing its required configuration reference\n * (e.g., an Action step with no ActionID, a Prompt step with no PromptID).\n */\n IsStepMissingConfiguration(step: MJAIAgentStepEntity): boolean {\n switch (step.StepType) {\n case 'Action':\n return !step.ActionID;\n case 'Prompt':\n return !step.PromptID;\n case 'Sub-Agent':\n return !step.SubAgentID;\n case 'ForEach':\n case 'While':\n return this.isLoopBodyMissingReference(step);\n default:\n return false;\n }\n }\n\n private isLoopBodyMissingReference(step: MJAIAgentStepEntity): boolean {\n const bodyType = step.LoopBodyType;\n if (!bodyType) return true; // No body type selected at all\n switch (bodyType) {\n case 'Action': return !step.ActionID;\n case 'Prompt': return !step.PromptID;\n case 'Sub-Agent': return !step.SubAgentID;\n default: return false;\n }\n }\n\n /**\n * Resolve the best icon and optional logo URL for a step based on its\n * configured action/agent and available picker data.\n *\n * Resolution chain:\n * - Action step: action's IconClass -> step-type fallback\n * - Sub-Agent step: agent's LogoURL (stored in Data) -> agent's IconClass -> step-type fallback\n * - Other steps: step-type icon\n */\n ResolveStepIcon(\n step: MJAIAgentStepEntity,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): { Icon: string; LogoURL?: string | null } {\n const fallbackIcon = this.getIconForType(step.StepType);\n\n if (step.StepType === 'Action' && step.ActionID && actions) {\n const action = actions.find(a => UUIDsEqual(a.ID, step.ActionID));\n return { Icon: action?.IconClass || fallbackIcon };\n }\n\n if (step.StepType === 'Sub-Agent' && step.SubAgentID && agents) {\n const agent = agents.find(a => UUIDsEqual(a.ID, step.SubAgentID));\n if (agent?.LogoURL) {\n return { Icon: agent.IconClass || fallbackIcon, LogoURL: agent.LogoURL };\n }\n return { Icon: agent?.IconClass || fallbackIcon };\n }\n\n // For loop steps, resolve based on loop body type\n if ((step.StepType === 'ForEach' || step.StepType === 'While') && step.LoopBodyType) {\n return this.resolveLoopBodyIcon(step, actions, agents);\n }\n\n return { Icon: fallbackIcon };\n }\n\n private resolveLoopBodyIcon(\n step: MJAIAgentStepEntity,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): { Icon: string; LogoURL?: string | null } {\n const fallbackIcon = this.getIconForType(step.StepType);\n\n if (step.LoopBodyType === 'Action' && step.ActionID && actions) {\n const action = actions.find(a => UUIDsEqual(a.ID, step.ActionID));\n if (action?.IconClass) return { Icon: fallbackIcon }; // Loop keeps its own icon; body icon handled separately\n }\n\n if (step.LoopBodyType === 'Sub-Agent' && step.SubAgentID && agents) {\n const agent = agents.find(a => UUIDsEqual(a.ID, step.SubAgentID));\n if (agent?.LogoURL) return { Icon: fallbackIcon, LogoURL: agent.LogoURL };\n }\n\n return { Icon: fallbackIcon };\n }\n\n // ── Public Conversion Methods ───────────────────────────────\n\n /** Convert a single MJ step entity to a FlowNode (public for direct use when adding nodes) */\n StepToNode(\n step: MJAIAgentStepEntity,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): FlowNode {\n const stepId = step.ID;\n const ports: FlowNodePort[] = [\n {\n ID: `${stepId}-input`,\n Direction: 'input',\n Side: 'top',\n Multiple: true,\n Disabled: step.StartingStep === true\n },\n {\n ID: `${stepId}-output`,\n Direction: 'output',\n Side: 'bottom',\n Multiple: true\n }\n ];\n\n // Show warning status when the step is missing its required configuration,\n // unless the step is explicitly disabled (respect the user's intent).\n const baseStatus = this.MapStepStatus(step.Status);\n const warningMessage = (baseStatus !== 'disabled') ? this.BuildConfigWarningMessage(step) : null;\n const effectiveStatus = warningMessage ? 'warning' : baseStatus;\n\n // Build loop-specific data for ForEach/While nodes\n const data: Record<string, unknown> = { StepEntityID: stepId };\n if (step.StepType === 'ForEach' || step.StepType === 'While') {\n this.populateLoopData(step, data, actions, agents);\n }\n\n // Resolve icon (and optional logo URL) from picker data\n const resolved = this.ResolveStepIcon(step, actions, agents);\n if (resolved.LogoURL) {\n data['LogoURL'] = resolved.LogoURL;\n }\n\n return {\n ID: stepId,\n Type: step.StepType,\n Label: step.Name,\n Subtitle: this.BuildStepSubtitle(step),\n Icon: resolved.Icon,\n Status: effectiveStatus,\n StatusMessage: warningMessage ?? undefined,\n IsStartNode: step.StartingStep === true,\n Position: {\n X: step.PositionX ?? 0,\n Y: step.PositionY ?? 0\n },\n Size: {\n Width: step.Width ?? 220,\n Height: step.Height ?? 100\n },\n Ports: ports,\n Data: data\n };\n }\n\n private pathToConnection(path: MJAIAgentStepPathEntity, allPaths: MJAIAgentStepPathEntity[]): FlowConnection {\n const hasCondition = path.Condition != null && path.Condition.trim().length > 0;\n const isAlwaysPath = !hasCondition;\n\n // Analyze sibling paths from the same origin step\n const siblingPaths = allPaths.filter(p => UUIDsEqual(p.OriginStepID, path.OriginStepID));\n const isOnlyPath = siblingPaths.length === 1;\n const unconditionalSiblings = siblingPaths.filter(\n p => !p.Condition || p.Condition.trim().length === 0\n );\n // Flag as ambiguous when 2+ unconditional paths exist from the same source.\n // Multiple unconditional paths are always ambiguous because only the\n // highest-priority one will execute — regardless of whether they have descriptions.\n const hasAmbiguousAlways = isAlwaysPath && unconditionalSiblings.length > 1;\n\n // Where this path sits in its exclusive group, when it is IN one. Highest Priority wins, ties\n // broken by path ID — and none of that precedence is visible on the canvas today, so someone\n // debugging a fork cannot tell which branch takes it when two conditions are both true.\n const conditionalSiblings = siblingPaths.filter(p => p.Condition && p.Condition.trim().length > 0);\n const rank = hasCondition && conditionalSiblings.length > 1\n ? this.rankWithinGroup(path, conditionalSiblings)\n : null;\n\n // Build label, icon, and visual style\n const visual = this.buildPathVisuals(path, hasCondition, isOnlyPath, hasAmbiguousAlways, rank);\n\n return {\n ID: path.ID,\n SourceNodeID: path.OriginStepID,\n SourcePortID: `${path.OriginStepID}-output`,\n TargetNodeID: path.DestinationStepID,\n TargetPortID: `${path.DestinationStepID}-input`,\n Label: visual.label,\n LabelIcon: visual.labelIcon,\n LabelIconColor: visual.labelIconColor,\n LabelDetail: visual.labelDetail,\n Condition: path.Condition ?? undefined,\n Priority: path.Priority,\n Style: visual.style,\n Color: visual.color,\n Data: {\n PathEntityID: path.ID,\n IsAlwaysPath: !hasCondition,\n HasAmbiguousAlways: hasAmbiguousAlways\n }\n };\n }\n\n /**\n * What an edge says on the canvas, and what it says on inspection.\n *\n * **An edge label answers one question: WHEN is this path taken?** That is the condition. The\n * `Description` is the author's rationale — genuinely useful, and inspection-time content: it is\n * prose, it is arbitrarily long, and rendering it always turned the least important element on the\n * canvas into the most visually dominant one, overlapping nodes and other labels.\n *\n * So the condition is the LABEL (truncated), the description is the DETAIL (the hover tooltip),\n * and an unconditional edge says nothing at all — a plain line already means \"then\". That last\n * rule removes most of the clutter on a real graph, because most edges are unconditional.\n */\n private buildPathVisuals(\n path: MJAIAgentStepPathEntity,\n hasCondition: boolean,\n isOnlyPath: boolean,\n hasAmbiguousAlways: boolean,\n rank: { position: number; total: number } | null = null\n ): { label?: string; labelIcon?: string; labelIconColor?: string; labelDetail?: string; color: string; style: FlowConnectionStyle } {\n const rationale = path.Description?.trim();\n\n // Conditional path — amber dashed, labelled with the RULE.\n if (hasCondition) {\n const condition = path.Condition!.trim();\n // The rank prefix is tiny and always fits, so it survives truncation — which matters, because\n // precedence is exactly what a truncated condition would otherwise hide.\n const prefix = rank ? `${rank.position}/${rank.total} ` : '';\n const precedence = rank\n ? `\\n\\nChecked ${ordinal(rank.position)} of ${rank.total}: highest priority wins, ties by path ID.`\n : '';\n return {\n label: prefix + this.truncateLabel(condition, rank ? 28 : 32),\n labelIcon: 'fa-code-branch',\n labelIconColor: '#f59e0b',\n // Full condition first — a truncated label is only safe if the whole thing is one hover\n // away — then the rationale, then how this branch is chosen against its siblings.\n labelDetail: (rationale ? `${condition}\\n\\n${rationale}` : condition) + precedence,\n color: '#f59e0b',\n style: 'dashed'\n };\n }\n\n // Ambiguous: multiple unconditional paths from the same step. This one KEEPS its label, because\n // it is a defect the author needs to see without hovering anything.\n if (hasAmbiguousAlways) {\n return {\n label: 'Duplicate default',\n labelIcon: 'fa-triangle-exclamation',\n labelIconColor: '#ef4444',\n labelDetail: rationale\n ? `Duplicate default paths: only the highest-priority one will execute.\\n\\n${rationale}`\n : 'Duplicate default paths: only the highest-priority one will execute',\n color: '#ef4444',\n style: 'solid'\n };\n }\n\n // Every other unconditional path — NO LABEL. The line already means \"then\", and \"Default\" on\n // every edge of a linear flow is a caption on each arrow of a diagram saying \"arrow\".\n // The rationale stays reachable on hover.\n return {\n labelDetail: rationale || undefined,\n color: isOnlyPath ? '#64748b' : '#16a34a',\n style: 'solid'\n };\n }\n\n /**\n * This path's position among its conditional siblings, in the order the dispatcher checks them.\n *\n * Mirrors the COMPILER, which is where the order is actually decided: `buildDependencies` sorts a\n * fan-out by `Priority` descending, then path ID ascending, and writes that ordinal into\n * `TaskDependency.Sequence` — which is what `ResolveExclusiveGroups` then reads at runtime. A path\n * row has no `Sequence` of its own and deliberately never has: a compiled edge gets a fresh UUID\n * and needs a stored ordinal to stay deterministic across machines, while a design-time path still\n * has its own stable ID to break the tie with. Ranking here by anything else would disagree with\n * the engine precisely on ties — and `Priority` defaults to 0, so ties are the common case.\n */\n private rankWithinGroup(\n path: MJAIAgentStepPathEntity,\n siblings: MJAIAgentStepPathEntity[]\n ): { position: number; total: number } {\n const ordered = [...siblings].sort((a, b) =>\n (b.Priority ?? 0) - (a.Priority ?? 0) || a.ID.localeCompare(b.ID)\n );\n return {\n position: ordered.findIndex(p => UUIDsEqual(p.ID, path.ID)) + 1,\n total: ordered.length\n };\n }\n\n /**\n * Trims a condition to what fits on an edge without covering its neighbours.\n *\n * Breaks on a word boundary when there is one near the limit, so the visible part stays readable\n * rather than ending mid-identifier. The full text is always in `labelDetail`.\n */\n private truncateLabel(text: string, limit = 32): string {\n const flat = text.replace(/\\s+/g, ' ').trim();\n if (flat.length <= limit) return flat;\n\n const cut = flat.slice(0, limit);\n const lastSpace = cut.lastIndexOf(' ');\n return `${(lastSpace > limit * 0.6 ? cut.slice(0, lastSpace) : cut).trimEnd()}…`;\n }\n\n /** Populate loop-specific display data on the node's Data payload */\n private populateLoopData(\n step: MJAIAgentStepEntity,\n data: Record<string, unknown>,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): void {\n const bodyType = step.LoopBodyType;\n data['LoopBodyType'] = bodyType ?? null;\n data['LoopBodyName'] = bodyType ? this.resolveLoopBodyName(step) : null;\n data['LoopBodyIcon'] = bodyType ? this.resolveLoopBodySpecificIcon(step, actions, agents) : null;\n data['LoopBodyColor'] = bodyType ? this.getBodyTypeColor(bodyType) : null;\n data['LoopIterationSummary'] = this.BuildLoopIterationSummary(step);\n\n // Store logo URL for loop body sub-agents\n if (bodyType === 'Sub-Agent' && step.SubAgentID && agents) {\n const agent = agents.find(a => UUIDsEqual(a.ID, step.SubAgentID));\n if (agent?.LogoURL) {\n data['LoopBodyLogoURL'] = agent.LogoURL;\n }\n }\n\n const config = this.parseLoopConfig(step);\n if (config) {\n data['MaxIterations'] = config['maxIterations'] ?? null;\n data['LoopItemVariable'] = config['itemVariable'] ?? null;\n }\n }\n\n /** Resolve the best icon for a loop body, checking picker data first */\n private resolveLoopBodySpecificIcon(\n step: MJAIAgentStepEntity,\n actions?: ActionPickerItem[],\n agents?: AgentPickerItem[]\n ): string {\n const bodyType = step.LoopBodyType;\n const fallback = this.getBodyTypeIcon(bodyType ?? '');\n\n if (bodyType === 'Action' && step.ActionID && actions) {\n const action = actions.find(a => UUIDsEqual(a.ID, step.ActionID));\n return action?.IconClass || fallback;\n }\n if (bodyType === 'Sub-Agent' && step.SubAgentID && agents) {\n const agent = agents.find(a => UUIDsEqual(a.ID, step.SubAgentID));\n return agent?.IconClass || fallback;\n }\n return fallback;\n }\n\n /** Get icon for a loop body type */\n private getBodyTypeIcon(bodyType: string): 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 /** Get color for a loop body type */\n private getBodyTypeColor(bodyType: string): 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 private getIconForType(stepType: string): string {\n const config = AGENT_STEP_TYPE_CONFIGS.find(c => c.Type === stepType);\n return config?.Icon ?? 'fa-circle-nodes';\n }\n\n private buildLoopSubtitle(step: MJAIAgentStepEntity, prefix: string): string {\n const bodyType = step.LoopBodyType;\n if (!bodyType) return `${prefix} (no body type)`;\n const bodyName = this.resolveLoopBodyName(step);\n return bodyName ? `${prefix} → ${bodyName}` : `${prefix} → ${bodyType}`;\n }\n\n /** Resolve the display name for the loop body operation */\n private resolveLoopBodyName(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 /** Parse the Configuration JSON, returning null on failure */\n private parseLoopConfig(step: MJAIAgentStepEntity): Record<string, unknown> | null {\n if (!step.Configuration) return null;\n try {\n return JSON.parse(step.Configuration) as Record<string, unknown>;\n } catch {\n return null;\n }\n }\n\n /** Build a short iteration summary for display on loop nodes */\n BuildLoopIterationSummary(step: MJAIAgentStepEntity): string {\n const config = this.parseLoopConfig(step);\n if (step.StepType === 'ForEach') {\n const collection = config?.['collectionPath'] as string | undefined;\n return collection ? `over ${collection}` : 'over collection';\n }\n if (step.StepType === 'While') {\n const condition = config?.['condition'] as string | undefined;\n return condition ? `while ${this.truncateCondition(condition)}` : 'while condition';\n }\n return '';\n }\n\n private truncateCondition(condition: string): string {\n const maxLen = 30;\n if (condition.length <= maxLen) return condition;\n return condition.substring(0, maxLen) + '...';\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter, OnInit, OnChanges, OnDestroy, SimpleChanges, ChangeDetectorRef, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
import { TransactionGroupBase } from '@memberjunction/core';
|
|
2
3
|
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
4
|
import { MJAIAgentStepEntity, MJAIAgentStepPathEntity } from '@memberjunction/core-entities';
|
|
4
5
|
import { FlowNode, FlowConnection, FlowNodeAddedEvent, FlowConnectionCreatedEvent, FlowConnectionReassignedEvent, FlowNodeTypeConfig } from '../interfaces/flow-types';
|
|
@@ -20,6 +21,27 @@ export declare class FlowAgentEditorComponent extends BaseAngularComponent imple
|
|
|
20
21
|
AgentID: string | null;
|
|
21
22
|
EditMode: boolean;
|
|
22
23
|
FullScreen: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether this editor shows its own Save / Edit / Cancel controls.
|
|
26
|
+
*
|
|
27
|
+
* **Off by default, and that default is the safe one.** When a host form owns the record's save —
|
|
28
|
+
* which is the normal case, since the flow is one part of an agent — a Save button here is a
|
|
29
|
+
* second save button for the same record. The user then has two, they disagree about what "saved"
|
|
30
|
+
* means, and the unsaved indicator on one says nothing about the other.
|
|
31
|
+
*
|
|
32
|
+
* A host that turns this ON is declaring that this editor owns its own persistence (the standalone
|
|
33
|
+
* or fullscreen self-contained case). A host that leaves it off MUST call
|
|
34
|
+
* {@link FlowAgentEditorComponent.QueueSaveInto} from its own save, or flow edits will have no way
|
|
35
|
+
* to reach the database at all.
|
|
36
|
+
*/
|
|
37
|
+
ShowSaveControls: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The title shown in the centre of the toolbar. `null` hides it.
|
|
40
|
+
*
|
|
41
|
+
* Hidden by hosts whose own page chrome already names the record — repeating it inside the canvas
|
|
42
|
+
* is a second, smaller title competing with the real one.
|
|
43
|
+
*/
|
|
44
|
+
CanvasTitle: string | null;
|
|
23
45
|
FlowSaved: EventEmitter<void>;
|
|
24
46
|
FlowChanged: EventEmitter<boolean>;
|
|
25
47
|
FullScreenToggled: EventEmitter<boolean>;
|
|
@@ -83,7 +105,30 @@ export declare class FlowAgentEditorComponent extends BaseAngularComponent imple
|
|
|
83
105
|
private setupInitialZoomObserver;
|
|
84
106
|
private applyInitialZoom;
|
|
85
107
|
private teardownResizeObserver;
|
|
108
|
+
/**
|
|
109
|
+
* Saves the flow on its own — creates a transaction, queues everything into it, submits.
|
|
110
|
+
*
|
|
111
|
+
* Used when this editor owns the save (the standalone / fullscreen self-contained mode). A host
|
|
112
|
+
* that owns the record's save should call {@link QueueSaveInto} instead so the flow lands in the
|
|
113
|
+
* same transaction as the rest of the record.
|
|
114
|
+
*/
|
|
86
115
|
Save(): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Queues every step and path change onto a transaction the CALLER owns and will submit.
|
|
118
|
+
*
|
|
119
|
+
* Split out of {@link Save} so a host form can make the flow part of the record's own atomic save
|
|
120
|
+
* rather than a second, separate one. Two independent saves is how a record ends up looking saved
|
|
121
|
+
* while the user's step edits are gone — the form succeeds, the flow fails, and nothing says so.
|
|
122
|
+
*
|
|
123
|
+
* Deliberately does NOT submit and does NOT clear dirty state: the caller decides whether the
|
|
124
|
+
* transaction commits, and only the caller knows whether it did. Call {@link MarkSaved} after a
|
|
125
|
+
* successful submit.
|
|
126
|
+
*/
|
|
127
|
+
QueueSaveInto(tg: TransactionGroupBase): Promise<void>;
|
|
128
|
+
/** Clears dirty state after the owning transaction actually committed. */
|
|
129
|
+
MarkSaved(): void;
|
|
130
|
+
/** Whether the flow holds edits that have not been written yet. Read by a host that owns the save. */
|
|
131
|
+
get HasUnsavedChanges(): boolean;
|
|
87
132
|
private syncPositionsFromCanvas;
|
|
88
133
|
/** Write current FlowNode positions back to the underlying step entities.
|
|
89
134
|
* Called on every node move so that rebuildFlowModel() never loses drag changes. */
|
|
@@ -130,6 +175,6 @@ export declare class FlowAgentEditorComponent extends BaseAngularComponent imple
|
|
|
130
175
|
protected onLegendPrefChanged(show: boolean): void;
|
|
131
176
|
private markDirty;
|
|
132
177
|
static ɵfac: i0.ɵɵFactoryDeclaration<FlowAgentEditorComponent, never>;
|
|
133
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FlowAgentEditorComponent, "mj-flow-agent-editor", never, { "AgentID": { "alias": "AgentID"; "required": false; }; "EditMode": { "alias": "EditMode"; "required": false; }; "FullScreen": { "alias": "FullScreen"; "required": false; }; }, { "FlowSaved": "FlowSaved"; "FlowChanged": "FlowChanged"; "FullScreenToggled": "FullScreenToggled"; "StepSelected": "StepSelected"; }, never, never, false, never>;
|
|
178
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FlowAgentEditorComponent, "mj-flow-agent-editor", never, { "AgentID": { "alias": "AgentID"; "required": false; }; "EditMode": { "alias": "EditMode"; "required": false; }; "FullScreen": { "alias": "FullScreen"; "required": false; }; "ShowSaveControls": { "alias": "ShowSaveControls"; "required": false; }; "CanvasTitle": { "alias": "CanvasTitle"; "required": false; }; }, { "FlowSaved": "FlowSaved"; "FlowChanged": "FlowChanged"; "FullScreenToggled": "FullScreenToggled"; "StepSelected": "StepSelected"; }, never, never, false, never>;
|
|
134
179
|
}
|
|
135
180
|
//# sourceMappingURL=flow-agent-editor.component.d.ts.map
|
|
@@ -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;
|
|
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;AACvB,OAAO,EAAyB,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CA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