@memberjunction/ng-dashboards 2.42.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/AI/ai-dashboard.component.d.ts +54 -0
- package/dist/AI/ai-dashboard.component.d.ts.map +1 -0
- package/dist/AI/ai-dashboard.component.js +248 -0
- package/dist/AI/ai-dashboard.component.js.map +1 -0
- package/dist/AI/components/agents/agent-configuration.component.d.ts +41 -0
- package/dist/AI/components/agents/agent-configuration.component.d.ts.map +1 -0
- package/dist/AI/components/agents/agent-configuration.component.js +325 -0
- package/dist/AI/components/agents/agent-configuration.component.js.map +1 -0
- package/dist/AI/components/agents/agent-editor.component.d.ts +77 -0
- package/dist/AI/components/agents/agent-editor.component.d.ts.map +1 -0
- package/dist/AI/components/agents/agent-editor.component.js +869 -0
- package/dist/AI/components/agents/agent-editor.component.js.map +1 -0
- package/dist/AI/components/agents/agent-filter-panel.component.d.ts +33 -0
- package/dist/AI/components/agents/agent-filter-panel.component.d.ts.map +1 -0
- package/dist/AI/components/agents/agent-filter-panel.component.js +144 -0
- package/dist/AI/components/agents/agent-filter-panel.component.js.map +1 -0
- package/dist/AI/components/execution-monitoring.component.d.ts +13 -0
- package/dist/AI/components/execution-monitoring.component.d.ts.map +1 -0
- package/dist/AI/components/execution-monitoring.component.js +30 -0
- package/dist/AI/components/execution-monitoring.component.js.map +1 -0
- package/dist/AI/components/models/model-management.component.d.ts +73 -0
- package/dist/AI/components/models/model-management.component.d.ts.map +1 -0
- package/dist/AI/components/models/model-management.component.js +669 -0
- package/dist/AI/components/models/model-management.component.js.map +1 -0
- package/dist/AI/components/prompts/prompt-filter-panel.component.d.ts +49 -0
- package/dist/AI/components/prompts/prompt-filter-panel.component.d.ts.map +1 -0
- package/dist/AI/components/prompts/prompt-filter-panel.component.js +186 -0
- package/dist/AI/components/prompts/prompt-filter-panel.component.js.map +1 -0
- package/dist/AI/components/prompts/prompt-management.component.d.ts +113 -0
- package/dist/AI/components/prompts/prompt-management.component.d.ts.map +1 -0
- package/dist/AI/components/prompts/prompt-management.component.js +1316 -0
- package/dist/AI/components/prompts/prompt-management.component.js.map +1 -0
- package/dist/AI/components/system/system-config-filter-panel.component.d.ts +33 -0
- package/dist/AI/components/system/system-config-filter-panel.component.d.ts.map +1 -0
- package/dist/AI/components/system/system-config-filter-panel.component.js +146 -0
- package/dist/AI/components/system/system-config-filter-panel.component.js.map +1 -0
- package/dist/AI/components/system/system-configuration.component.d.ts +37 -0
- package/dist/AI/components/system/system-configuration.component.d.ts.map +1 -0
- package/dist/AI/components/system/system-configuration.component.js +311 -0
- package/dist/AI/components/system/system-configuration.component.js.map +1 -0
- package/dist/Actions/actions-management-dashboard.component.d.ts +50 -0
- package/dist/Actions/actions-management-dashboard.component.d.ts.map +1 -0
- package/dist/Actions/actions-management-dashboard.component.js +282 -0
- package/dist/Actions/actions-management-dashboard.component.js.map +1 -0
- package/dist/Actions/components/actions-list-view.component.d.ts +52 -0
- package/dist/Actions/components/actions-list-view.component.d.ts.map +1 -0
- package/dist/Actions/components/actions-list-view.component.js +366 -0
- package/dist/Actions/components/actions-list-view.component.js.map +1 -0
- package/dist/Actions/components/actions-overview.component.d.ts +71 -0
- package/dist/Actions/components/actions-overview.component.d.ts.map +1 -0
- package/dist/Actions/components/actions-overview.component.js +605 -0
- package/dist/Actions/components/actions-overview.component.js.map +1 -0
- package/dist/Actions/components/categories-list-view.component.d.ts +11 -0
- package/dist/Actions/components/categories-list-view.component.d.ts.map +1 -0
- package/dist/Actions/components/categories-list-view.component.js +35 -0
- package/dist/Actions/components/categories-list-view.component.js.map +1 -0
- package/dist/Actions/components/code-management.component.d.ts +11 -0
- package/dist/Actions/components/code-management.component.d.ts.map +1 -0
- package/dist/Actions/components/code-management.component.js +35 -0
- package/dist/Actions/components/code-management.component.js.map +1 -0
- package/dist/Actions/components/entity-integration.component.d.ts +11 -0
- package/dist/Actions/components/entity-integration.component.d.ts.map +1 -0
- package/dist/Actions/components/entity-integration.component.js +35 -0
- package/dist/Actions/components/entity-integration.component.js.map +1 -0
- package/dist/Actions/components/execution-monitoring.component.d.ts +83 -0
- package/dist/Actions/components/execution-monitoring.component.d.ts.map +1 -0
- package/dist/Actions/components/execution-monitoring.component.js +629 -0
- package/dist/Actions/components/execution-monitoring.component.js.map +1 -0
- package/dist/Actions/components/executions-list-view.component.d.ts +11 -0
- package/dist/Actions/components/executions-list-view.component.d.ts.map +1 -0
- package/dist/Actions/components/executions-list-view.component.js +35 -0
- package/dist/Actions/components/executions-list-view.component.js.map +1 -0
- package/dist/Actions/components/scheduled-actions.component.d.ts +11 -0
- package/dist/Actions/components/scheduled-actions.component.d.ts.map +1 -0
- package/dist/Actions/components/scheduled-actions.component.js +35 -0
- package/dist/Actions/components/scheduled-actions.component.js.map +1 -0
- package/dist/Actions/components/security-permissions.component.d.ts +11 -0
- package/dist/Actions/components/security-permissions.component.d.ts.map +1 -0
- package/dist/Actions/components/security-permissions.component.js +35 -0
- package/dist/Actions/components/security-permissions.component.js.map +1 -0
- package/dist/Actions/index.d.ts +11 -0
- package/dist/Actions/index.d.ts.map +1 -0
- package/dist/Actions/index.js +11 -0
- package/dist/Actions/index.js.map +1 -0
- package/dist/EntityAdmin/components/entity-details.component.d.ts +50 -0
- package/dist/EntityAdmin/components/entity-details.component.d.ts.map +1 -0
- package/dist/EntityAdmin/components/entity-details.component.js +684 -0
- package/dist/EntityAdmin/components/entity-details.component.js.map +1 -0
- package/dist/EntityAdmin/components/entity-filter-panel.component.d.ts +31 -0
- package/dist/EntityAdmin/components/entity-filter-panel.component.d.ts.map +1 -0
- package/dist/EntityAdmin/components/entity-filter-panel.component.js +162 -0
- package/dist/EntityAdmin/components/entity-filter-panel.component.js.map +1 -0
- package/dist/EntityAdmin/components/erd-composite.component.d.ts +73 -0
- package/dist/EntityAdmin/components/erd-composite.component.d.ts.map +1 -0
- package/dist/EntityAdmin/components/erd-composite.component.js +288 -0
- package/dist/EntityAdmin/components/erd-composite.component.js.map +1 -0
- package/dist/EntityAdmin/components/erd-diagram.component.d.ts +47 -0
- package/dist/EntityAdmin/components/erd-diagram.component.d.ts.map +1 -0
- package/dist/EntityAdmin/components/erd-diagram.component.js +618 -0
- package/dist/EntityAdmin/components/erd-diagram.component.js.map +1 -0
- package/dist/EntityAdmin/entity-admin-dashboard.component.d.ts +50 -0
- package/dist/EntityAdmin/entity-admin-dashboard.component.d.ts.map +1 -0
- package/dist/EntityAdmin/entity-admin-dashboard.component.js +190 -0
- package/dist/EntityAdmin/entity-admin-dashboard.component.js.map +1 -0
- package/dist/generic/base-dashboard.d.ts +65 -0
- package/dist/generic/base-dashboard.d.ts.map +1 -0
- package/dist/generic/base-dashboard.js +86 -0
- package/dist/generic/base-dashboard.js.map +1 -0
- package/dist/module.d.ts +43 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +141 -0
- package/dist/module.js.map +1 -0
- package/dist/public-api.d.ts +6 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +18 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,869 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
|
11
|
+
import { RunView, Metadata, LogError, LogStatus } from '@memberjunction/core';
|
|
12
|
+
import * as d3 from 'd3';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "@angular/forms";
|
|
15
|
+
import * as i2 from "@memberjunction/ng-container-directives";
|
|
16
|
+
const _c0 = ["hierarchyChart"];
|
|
17
|
+
const _forTrack0 = ($index, $item) => $item.id;
|
|
18
|
+
function AgentEditorComponent_Conditional_6_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
19
|
+
i0.ɵɵelementStart(0, "span", 12);
|
|
20
|
+
i0.ɵɵelement(1, "i", 13);
|
|
21
|
+
i0.ɵɵtext(2);
|
|
22
|
+
i0.ɵɵelementEnd();
|
|
23
|
+
} if (rf & 2) {
|
|
24
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
25
|
+
i0.ɵɵadvance(2);
|
|
26
|
+
i0.ɵɵtextInterpolate1(" Child of ", ctx_r0.currentAgent.Parent, " ");
|
|
27
|
+
} }
|
|
28
|
+
function AgentEditorComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
29
|
+
i0.ɵɵelementStart(0, "div", 6)(1, "h2");
|
|
30
|
+
i0.ɵɵtext(2);
|
|
31
|
+
i0.ɵɵelementEnd();
|
|
32
|
+
i0.ɵɵtemplate(3, AgentEditorComponent_Conditional_6_Conditional_3_Template, 3, 1, "span", 12);
|
|
33
|
+
i0.ɵɵelementEnd();
|
|
34
|
+
} if (rf & 2) {
|
|
35
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
36
|
+
i0.ɵɵadvance(2);
|
|
37
|
+
i0.ɵɵtextInterpolate(ctx_r0.currentAgent.Name);
|
|
38
|
+
i0.ɵɵadvance();
|
|
39
|
+
i0.ɵɵconditional(ctx_r0.currentAgent.Parent ? 3 : -1);
|
|
40
|
+
} }
|
|
41
|
+
function AgentEditorComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
42
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
43
|
+
i0.ɵɵelementStart(0, "div", 7)(1, "button", 14);
|
|
44
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_7_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.setActiveTab("hierarchy")); });
|
|
45
|
+
i0.ɵɵelement(2, "i", 15);
|
|
46
|
+
i0.ɵɵtext(3, " Hierarchy ");
|
|
47
|
+
i0.ɵɵelementEnd();
|
|
48
|
+
i0.ɵɵelementStart(4, "button", 14);
|
|
49
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_7_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.setActiveTab("prompts")); });
|
|
50
|
+
i0.ɵɵelement(5, "i", 16);
|
|
51
|
+
i0.ɵɵtext(6, " Prompts ");
|
|
52
|
+
i0.ɵɵelementEnd();
|
|
53
|
+
i0.ɵɵelementStart(7, "button", 14);
|
|
54
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_7_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.setActiveTab("properties")); });
|
|
55
|
+
i0.ɵɵelement(8, "i", 17);
|
|
56
|
+
i0.ɵɵtext(9, " Properties ");
|
|
57
|
+
i0.ɵɵelementEnd()();
|
|
58
|
+
} if (rf & 2) {
|
|
59
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
60
|
+
i0.ɵɵadvance();
|
|
61
|
+
i0.ɵɵclassProp("active", ctx_r0.activeTab === "hierarchy");
|
|
62
|
+
i0.ɵɵadvance(3);
|
|
63
|
+
i0.ɵɵclassProp("active", ctx_r0.activeTab === "prompts");
|
|
64
|
+
i0.ɵɵadvance(3);
|
|
65
|
+
i0.ɵɵclassProp("active", ctx_r0.activeTab === "properties");
|
|
66
|
+
} }
|
|
67
|
+
function AgentEditorComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
68
|
+
i0.ɵɵelementStart(0, "div", 8)(1, "div", 18)(2, "div", 19);
|
|
69
|
+
i0.ɵɵelement(3, "div", 20)(4, "div", 20)(5, "div", 20);
|
|
70
|
+
i0.ɵɵelementEnd();
|
|
71
|
+
i0.ɵɵelementStart(6, "div", 21);
|
|
72
|
+
i0.ɵɵtext(7, "Loading agent data...");
|
|
73
|
+
i0.ɵɵelementEnd()()();
|
|
74
|
+
} }
|
|
75
|
+
function AgentEditorComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
76
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
77
|
+
i0.ɵɵelementStart(0, "div", 9)(1, "div", 22);
|
|
78
|
+
i0.ɵɵelement(2, "i", 23);
|
|
79
|
+
i0.ɵɵelementStart(3, "h3");
|
|
80
|
+
i0.ɵɵtext(4, "Error Loading Agent");
|
|
81
|
+
i0.ɵɵelementEnd();
|
|
82
|
+
i0.ɵɵelementStart(5, "p");
|
|
83
|
+
i0.ɵɵtext(6);
|
|
84
|
+
i0.ɵɵelementEnd();
|
|
85
|
+
i0.ɵɵelementStart(7, "button", 24);
|
|
86
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_9_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.loadAgentData()); });
|
|
87
|
+
i0.ɵɵelement(8, "i", 25);
|
|
88
|
+
i0.ɵɵtext(9, " Retry ");
|
|
89
|
+
i0.ɵɵelementEnd()()();
|
|
90
|
+
} if (rf & 2) {
|
|
91
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
92
|
+
i0.ɵɵadvance(6);
|
|
93
|
+
i0.ɵɵtextInterpolate(ctx_r0.error);
|
|
94
|
+
} }
|
|
95
|
+
function AgentEditorComponent_Conditional_10_Conditional_1_Conditional_28_Template(rf, ctx) { if (rf & 1) {
|
|
96
|
+
i0.ɵɵelementStart(0, "div", 44)(1, "small");
|
|
97
|
+
i0.ɵɵelement(2, "i", 46);
|
|
98
|
+
i0.ɵɵtext(3, " Drag to pan \u2022 Use zoom controls or scroll to zoom \u2022 Click nodes to navigate ");
|
|
99
|
+
i0.ɵɵelementEnd()();
|
|
100
|
+
} }
|
|
101
|
+
function AgentEditorComponent_Conditional_10_Conditional_1_Conditional_29_Template(rf, ctx) { if (rf & 1) {
|
|
102
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
103
|
+
i0.ɵɵelementStart(0, "div", 45);
|
|
104
|
+
i0.ɵɵelement(1, "i", 15);
|
|
105
|
+
i0.ɵɵelementStart(2, "h4");
|
|
106
|
+
i0.ɵɵtext(3, "No Agent Hierarchy");
|
|
107
|
+
i0.ɵɵelementEnd();
|
|
108
|
+
i0.ɵɵelementStart(4, "p");
|
|
109
|
+
i0.ɵɵtext(5, "This agent doesn't have any parent or child agents yet.");
|
|
110
|
+
i0.ɵɵelementEnd();
|
|
111
|
+
i0.ɵɵelementStart(6, "button", 47);
|
|
112
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_10_Conditional_1_Conditional_29_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.openCreateSubAgent()); });
|
|
113
|
+
i0.ɵɵelement(7, "i", 33);
|
|
114
|
+
i0.ɵɵtext(8, " Create Sub-Agent ");
|
|
115
|
+
i0.ɵɵelementEnd()();
|
|
116
|
+
} }
|
|
117
|
+
function AgentEditorComponent_Conditional_10_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
118
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
119
|
+
i0.ɵɵelementStart(0, "div", 26)(1, "div", 29)(2, "h3");
|
|
120
|
+
i0.ɵɵelement(3, "i", 15);
|
|
121
|
+
i0.ɵɵtext(4, " Agent Hierarchy ");
|
|
122
|
+
i0.ɵɵelementEnd();
|
|
123
|
+
i0.ɵɵelementStart(5, "div", 30)(6, "div", 31)(7, "button", 32);
|
|
124
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_10_Conditional_1_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.zoomIn()); });
|
|
125
|
+
i0.ɵɵelement(8, "i", 33);
|
|
126
|
+
i0.ɵɵelementEnd();
|
|
127
|
+
i0.ɵɵelementStart(9, "button", 34);
|
|
128
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_10_Conditional_1_Template_button_click_9_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.zoomOut()); });
|
|
129
|
+
i0.ɵɵelement(10, "i", 35);
|
|
130
|
+
i0.ɵɵelementEnd();
|
|
131
|
+
i0.ɵɵelementStart(11, "button", 36);
|
|
132
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_10_Conditional_1_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.resetZoom()); });
|
|
133
|
+
i0.ɵɵelement(12, "i", 37);
|
|
134
|
+
i0.ɵɵelementEnd()();
|
|
135
|
+
i0.ɵɵelementStart(13, "div", 38)(14, "div", 39);
|
|
136
|
+
i0.ɵɵelement(15, "div", 40);
|
|
137
|
+
i0.ɵɵelementStart(16, "span");
|
|
138
|
+
i0.ɵɵtext(17, "Root");
|
|
139
|
+
i0.ɵɵelementEnd()();
|
|
140
|
+
i0.ɵɵelementStart(18, "div", 39);
|
|
141
|
+
i0.ɵɵelement(19, "div", 41);
|
|
142
|
+
i0.ɵɵelementStart(20, "span");
|
|
143
|
+
i0.ɵɵtext(21, "Level 1");
|
|
144
|
+
i0.ɵɵelementEnd()();
|
|
145
|
+
i0.ɵɵelementStart(22, "div", 39);
|
|
146
|
+
i0.ɵɵelement(23, "div", 42);
|
|
147
|
+
i0.ɵɵelementStart(24, "span");
|
|
148
|
+
i0.ɵɵtext(25, "Level 2+");
|
|
149
|
+
i0.ɵɵelementEnd()()()()();
|
|
150
|
+
i0.ɵɵelementStart(26, "div", 43, 0);
|
|
151
|
+
i0.ɵɵtemplate(28, AgentEditorComponent_Conditional_10_Conditional_1_Conditional_28_Template, 4, 0, "div", 44)(29, AgentEditorComponent_Conditional_10_Conditional_1_Conditional_29_Template, 9, 0, "div", 45);
|
|
152
|
+
i0.ɵɵelementEnd()();
|
|
153
|
+
} if (rf & 2) {
|
|
154
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
155
|
+
i0.ɵɵadvance(28);
|
|
156
|
+
i0.ɵɵconditional(ctx_r0.hierarchyData && (ctx_r0.hasChildren() || ctx_r0.hasParent()) ? 28 : -1);
|
|
157
|
+
i0.ɵɵadvance();
|
|
158
|
+
i0.ɵɵconditional(!ctx_r0.hierarchyData || !ctx_r0.hasChildren() && !ctx_r0.hasParent() ? 29 : -1);
|
|
159
|
+
} }
|
|
160
|
+
function AgentEditorComponent_Conditional_10_Conditional_2_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
161
|
+
i0.ɵɵelementStart(0, "div", 50);
|
|
162
|
+
i0.ɵɵelement(1, "i", 16);
|
|
163
|
+
i0.ɵɵelementStart(2, "p");
|
|
164
|
+
i0.ɵɵtext(3, "No prompts configured for this agent");
|
|
165
|
+
i0.ɵɵelementEnd();
|
|
166
|
+
i0.ɵɵelementStart(4, "button", 51);
|
|
167
|
+
i0.ɵɵelement(5, "i", 33);
|
|
168
|
+
i0.ɵɵtext(6, " Add First Prompt ");
|
|
169
|
+
i0.ɵɵelementEnd()();
|
|
170
|
+
} }
|
|
171
|
+
function AgentEditorComponent_Conditional_10_Conditional_2_Conditional_10_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
172
|
+
i0.ɵɵelementStart(0, "div", 52)(1, "div", 53)(2, "div", 54)(3, "h4");
|
|
173
|
+
i0.ɵɵtext(4);
|
|
174
|
+
i0.ɵɵelementEnd();
|
|
175
|
+
i0.ɵɵelementStart(5, "span", 55);
|
|
176
|
+
i0.ɵɵtext(6);
|
|
177
|
+
i0.ɵɵelementEnd()();
|
|
178
|
+
i0.ɵɵelementStart(7, "div", 56)(8, "button", 57);
|
|
179
|
+
i0.ɵɵelement(9, "i", 58);
|
|
180
|
+
i0.ɵɵelementEnd();
|
|
181
|
+
i0.ɵɵelementStart(10, "button", 59);
|
|
182
|
+
i0.ɵɵelement(11, "i", 60);
|
|
183
|
+
i0.ɵɵelementEnd()()();
|
|
184
|
+
i0.ɵɵelementStart(12, "div", 61)(13, "p");
|
|
185
|
+
i0.ɵɵtext(14);
|
|
186
|
+
i0.ɵɵelementEnd()()();
|
|
187
|
+
} if (rf & 2) {
|
|
188
|
+
const prompt_r6 = ctx.$implicit;
|
|
189
|
+
i0.ɵɵadvance(4);
|
|
190
|
+
i0.ɵɵtextInterpolate(prompt_r6.name);
|
|
191
|
+
i0.ɵɵadvance(2);
|
|
192
|
+
i0.ɵɵtextInterpolate(prompt_r6.type);
|
|
193
|
+
i0.ɵɵadvance(8);
|
|
194
|
+
i0.ɵɵtextInterpolate(prompt_r6.content);
|
|
195
|
+
} }
|
|
196
|
+
function AgentEditorComponent_Conditional_10_Conditional_2_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
197
|
+
i0.ɵɵrepeaterCreate(0, AgentEditorComponent_Conditional_10_Conditional_2_Conditional_10_For_1_Template, 15, 3, "div", 52, _forTrack0);
|
|
198
|
+
} if (rf & 2) {
|
|
199
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
200
|
+
i0.ɵɵrepeater(ctx_r0.agentPrompts);
|
|
201
|
+
} }
|
|
202
|
+
function AgentEditorComponent_Conditional_10_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
203
|
+
i0.ɵɵelementStart(0, "div", 27)(1, "div", 29)(2, "h3");
|
|
204
|
+
i0.ɵɵelement(3, "i", 16);
|
|
205
|
+
i0.ɵɵtext(4, " Agent Prompts ");
|
|
206
|
+
i0.ɵɵelementEnd();
|
|
207
|
+
i0.ɵɵelementStart(5, "button", 48);
|
|
208
|
+
i0.ɵɵelement(6, "i", 33);
|
|
209
|
+
i0.ɵɵtext(7, " Add Prompt ");
|
|
210
|
+
i0.ɵɵelementEnd()();
|
|
211
|
+
i0.ɵɵelementStart(8, "div", 49);
|
|
212
|
+
i0.ɵɵtemplate(9, AgentEditorComponent_Conditional_10_Conditional_2_Conditional_9_Template, 7, 0, "div", 50)(10, AgentEditorComponent_Conditional_10_Conditional_2_Conditional_10_Template, 2, 0);
|
|
213
|
+
i0.ɵɵelementEnd()();
|
|
214
|
+
} if (rf & 2) {
|
|
215
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
216
|
+
i0.ɵɵadvance(9);
|
|
217
|
+
i0.ɵɵconditional(ctx_r0.agentPrompts.length === 0 ? 9 : 10);
|
|
218
|
+
} }
|
|
219
|
+
function AgentEditorComponent_Conditional_10_Conditional_3_Conditional_44_Template(rf, ctx) { if (rf & 1) {
|
|
220
|
+
i0.ɵɵelementStart(0, "div", 68)(1, "div", 65)(2, "label");
|
|
221
|
+
i0.ɵɵtext(3, "Message Threshold");
|
|
222
|
+
i0.ɵɵelementEnd();
|
|
223
|
+
i0.ɵɵelement(4, "input", 77);
|
|
224
|
+
i0.ɵɵelementEnd();
|
|
225
|
+
i0.ɵɵelementStart(5, "div", 65)(6, "label");
|
|
226
|
+
i0.ɵɵtext(7, "Retention Count");
|
|
227
|
+
i0.ɵɵelementEnd();
|
|
228
|
+
i0.ɵɵelement(8, "input", 78);
|
|
229
|
+
i0.ɵɵelementEnd()();
|
|
230
|
+
} if (rf & 2) {
|
|
231
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
232
|
+
i0.ɵɵadvance(4);
|
|
233
|
+
i0.ɵɵproperty("value", ctx_r0.currentAgent.ContextCompressionMessageThreshold);
|
|
234
|
+
i0.ɵɵadvance(4);
|
|
235
|
+
i0.ɵɵproperty("value", ctx_r0.currentAgent.ContextCompressionMessageRetentionCount);
|
|
236
|
+
} }
|
|
237
|
+
function AgentEditorComponent_Conditional_10_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
238
|
+
i0.ɵɵelementStart(0, "div", 28)(1, "div", 29)(2, "h3");
|
|
239
|
+
i0.ɵɵelement(3, "i", 17);
|
|
240
|
+
i0.ɵɵtext(4, " Agent Properties ");
|
|
241
|
+
i0.ɵɵelementEnd();
|
|
242
|
+
i0.ɵɵelementStart(5, "button", 62);
|
|
243
|
+
i0.ɵɵelement(6, "i", 63);
|
|
244
|
+
i0.ɵɵtext(7, " Save ");
|
|
245
|
+
i0.ɵɵelementEnd()();
|
|
246
|
+
i0.ɵɵelementStart(8, "div", 64)(9, "div", 65)(10, "label");
|
|
247
|
+
i0.ɵɵtext(11, "Name");
|
|
248
|
+
i0.ɵɵelementEnd();
|
|
249
|
+
i0.ɵɵelement(12, "input", 66);
|
|
250
|
+
i0.ɵɵelementEnd();
|
|
251
|
+
i0.ɵɵelementStart(13, "div", 65)(14, "label");
|
|
252
|
+
i0.ɵɵtext(15, "Description");
|
|
253
|
+
i0.ɵɵelementEnd();
|
|
254
|
+
i0.ɵɵelement(16, "textarea", 67);
|
|
255
|
+
i0.ɵɵelementEnd();
|
|
256
|
+
i0.ɵɵelementStart(17, "div", 68)(18, "div", 65)(19, "label");
|
|
257
|
+
i0.ɵɵtext(20, "Execution Mode");
|
|
258
|
+
i0.ɵɵelementEnd();
|
|
259
|
+
i0.ɵɵelementStart(21, "select", 69)(22, "option", 70);
|
|
260
|
+
i0.ɵɵtext(23, "Sequential");
|
|
261
|
+
i0.ɵɵelementEnd();
|
|
262
|
+
i0.ɵɵelementStart(24, "option", 71);
|
|
263
|
+
i0.ɵɵtext(25, "Parallel");
|
|
264
|
+
i0.ɵɵelementEnd()()();
|
|
265
|
+
i0.ɵɵelementStart(26, "div", 65)(27, "label");
|
|
266
|
+
i0.ɵɵtext(28, "Execution Order");
|
|
267
|
+
i0.ɵɵelementEnd();
|
|
268
|
+
i0.ɵɵelement(29, "input", 72);
|
|
269
|
+
i0.ɵɵelementEnd()();
|
|
270
|
+
i0.ɵɵelementStart(30, "div", 73)(31, "label", 74);
|
|
271
|
+
i0.ɵɵelement(32, "input", 75)(33, "span", 76);
|
|
272
|
+
i0.ɵɵtext(34, " Expose as Action ");
|
|
273
|
+
i0.ɵɵelementEnd();
|
|
274
|
+
i0.ɵɵelementStart(35, "small");
|
|
275
|
+
i0.ɵɵtext(36, "Allow this agent to be used as an action by other agents");
|
|
276
|
+
i0.ɵɵelementEnd()();
|
|
277
|
+
i0.ɵɵelementStart(37, "div", 73)(38, "label", 74);
|
|
278
|
+
i0.ɵɵelement(39, "input", 75)(40, "span", 76);
|
|
279
|
+
i0.ɵɵtext(41, " Enable Context Compression ");
|
|
280
|
+
i0.ɵɵelementEnd();
|
|
281
|
+
i0.ɵɵelementStart(42, "small");
|
|
282
|
+
i0.ɵɵtext(43, "Automatically compress conversation context when threshold is reached");
|
|
283
|
+
i0.ɵɵelementEnd()();
|
|
284
|
+
i0.ɵɵtemplate(44, AgentEditorComponent_Conditional_10_Conditional_3_Conditional_44_Template, 9, 2, "div", 68);
|
|
285
|
+
i0.ɵɵelementEnd()();
|
|
286
|
+
} if (rf & 2) {
|
|
287
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
288
|
+
i0.ɵɵadvance(12);
|
|
289
|
+
i0.ɵɵproperty("value", ctx_r0.currentAgent.Name);
|
|
290
|
+
i0.ɵɵadvance(4);
|
|
291
|
+
i0.ɵɵproperty("value", ctx_r0.currentAgent.Description);
|
|
292
|
+
i0.ɵɵadvance(5);
|
|
293
|
+
i0.ɵɵproperty("value", ctx_r0.currentAgent.ExecutionMode);
|
|
294
|
+
i0.ɵɵadvance(8);
|
|
295
|
+
i0.ɵɵproperty("value", ctx_r0.currentAgent.ExecutionOrder);
|
|
296
|
+
i0.ɵɵadvance(3);
|
|
297
|
+
i0.ɵɵproperty("checked", ctx_r0.currentAgent.ExposeAsAction);
|
|
298
|
+
i0.ɵɵadvance(7);
|
|
299
|
+
i0.ɵɵproperty("checked", ctx_r0.currentAgent.EnableContextCompression);
|
|
300
|
+
i0.ɵɵadvance(5);
|
|
301
|
+
i0.ɵɵconditional(ctx_r0.currentAgent.EnableContextCompression ? 44 : -1);
|
|
302
|
+
} }
|
|
303
|
+
function AgentEditorComponent_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
304
|
+
i0.ɵɵelementStart(0, "div", 10);
|
|
305
|
+
i0.ɵɵtemplate(1, AgentEditorComponent_Conditional_10_Conditional_1_Template, 30, 2, "div", 26)(2, AgentEditorComponent_Conditional_10_Conditional_2_Template, 11, 1, "div", 27)(3, AgentEditorComponent_Conditional_10_Conditional_3_Template, 45, 7, "div", 28);
|
|
306
|
+
i0.ɵɵelementEnd();
|
|
307
|
+
} if (rf & 2) {
|
|
308
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
309
|
+
i0.ɵɵadvance();
|
|
310
|
+
i0.ɵɵconditional(ctx_r0.activeTab === "hierarchy" ? 1 : -1);
|
|
311
|
+
i0.ɵɵadvance();
|
|
312
|
+
i0.ɵɵconditional(ctx_r0.activeTab === "prompts" ? 2 : -1);
|
|
313
|
+
i0.ɵɵadvance();
|
|
314
|
+
i0.ɵɵconditional(ctx_r0.activeTab === "properties" ? 3 : -1);
|
|
315
|
+
} }
|
|
316
|
+
function AgentEditorComponent_Conditional_11_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
317
|
+
i0.ɵɵelementStart(0, "div", 85);
|
|
318
|
+
i0.ɵɵelement(1, "i", 23);
|
|
319
|
+
i0.ɵɵtext(2);
|
|
320
|
+
i0.ɵɵelementEnd();
|
|
321
|
+
} if (rf & 2) {
|
|
322
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
323
|
+
i0.ɵɵadvance(2);
|
|
324
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.error, " ");
|
|
325
|
+
} }
|
|
326
|
+
function AgentEditorComponent_Conditional_11_Conditional_26_Template(rf, ctx) { if (rf & 1) {
|
|
327
|
+
i0.ɵɵelement(0, "span", 92);
|
|
328
|
+
i0.ɵɵtext(1, " Creating... ");
|
|
329
|
+
} }
|
|
330
|
+
function AgentEditorComponent_Conditional_11_Conditional_27_Template(rf, ctx) { if (rf & 1) {
|
|
331
|
+
i0.ɵɵelement(0, "i", 33);
|
|
332
|
+
i0.ɵɵtext(1, " Create Sub-Agent ");
|
|
333
|
+
} }
|
|
334
|
+
function AgentEditorComponent_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
335
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
336
|
+
i0.ɵɵelementStart(0, "div", 79);
|
|
337
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_11_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.closeCreateSubAgent()); });
|
|
338
|
+
i0.ɵɵelementStart(1, "div", 80);
|
|
339
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_11_Template_div_click_1_listener($event) { i0.ɵɵrestoreView(_r7); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
340
|
+
i0.ɵɵelementStart(2, "div", 81)(3, "h3");
|
|
341
|
+
i0.ɵɵelement(4, "i", 33);
|
|
342
|
+
i0.ɵɵtext(5, " Create Sub-Agent ");
|
|
343
|
+
i0.ɵɵelementEnd();
|
|
344
|
+
i0.ɵɵelementStart(6, "button", 82);
|
|
345
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_11_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.closeCreateSubAgent()); });
|
|
346
|
+
i0.ɵɵelement(7, "i", 83);
|
|
347
|
+
i0.ɵɵelementEnd()();
|
|
348
|
+
i0.ɵɵelementStart(8, "div", 84);
|
|
349
|
+
i0.ɵɵtemplate(9, AgentEditorComponent_Conditional_11_Conditional_9_Template, 3, 1, "div", 85);
|
|
350
|
+
i0.ɵɵelementStart(10, "div", 65)(11, "label");
|
|
351
|
+
i0.ɵɵtext(12, "Agent Name *");
|
|
352
|
+
i0.ɵɵelementEnd();
|
|
353
|
+
i0.ɵɵelementStart(13, "input", 86);
|
|
354
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AgentEditorComponent_Conditional_11_Template_input_ngModelChange_13_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.newSubAgentName, $event) || (ctx_r0.newSubAgentName = $event); return i0.ɵɵresetView($event); });
|
|
355
|
+
i0.ɵɵelementEnd()();
|
|
356
|
+
i0.ɵɵelementStart(14, "div", 65)(15, "label");
|
|
357
|
+
i0.ɵɵtext(16, "Description");
|
|
358
|
+
i0.ɵɵelementEnd();
|
|
359
|
+
i0.ɵɵelementStart(17, "textarea", 87);
|
|
360
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AgentEditorComponent_Conditional_11_Template_textarea_ngModelChange_17_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.newSubAgentDescription, $event) || (ctx_r0.newSubAgentDescription = $event); return i0.ɵɵresetView($event); });
|
|
361
|
+
i0.ɵɵelementEnd()();
|
|
362
|
+
i0.ɵɵelementStart(18, "div", 88)(19, "strong");
|
|
363
|
+
i0.ɵɵtext(20, "Parent Agent:");
|
|
364
|
+
i0.ɵɵelementEnd();
|
|
365
|
+
i0.ɵɵtext(21);
|
|
366
|
+
i0.ɵɵelementEnd()();
|
|
367
|
+
i0.ɵɵelementStart(22, "div", 89)(23, "button", 90);
|
|
368
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_11_Template_button_click_23_listener() { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.closeCreateSubAgent()); });
|
|
369
|
+
i0.ɵɵtext(24, " Cancel ");
|
|
370
|
+
i0.ɵɵelementEnd();
|
|
371
|
+
i0.ɵɵelementStart(25, "button", 91);
|
|
372
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Conditional_11_Template_button_click_25_listener() { i0.ɵɵrestoreView(_r7); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.createSubAgent()); });
|
|
373
|
+
i0.ɵɵtemplate(26, AgentEditorComponent_Conditional_11_Conditional_26_Template, 2, 0)(27, AgentEditorComponent_Conditional_11_Conditional_27_Template, 2, 0);
|
|
374
|
+
i0.ɵɵelementEnd()()()();
|
|
375
|
+
} if (rf & 2) {
|
|
376
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
377
|
+
i0.ɵɵadvance(9);
|
|
378
|
+
i0.ɵɵconditional(ctx_r0.error ? 9 : -1);
|
|
379
|
+
i0.ɵɵadvance(4);
|
|
380
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.newSubAgentName);
|
|
381
|
+
i0.ɵɵproperty("disabled", ctx_r0.isLoading);
|
|
382
|
+
i0.ɵɵadvance(4);
|
|
383
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.newSubAgentDescription);
|
|
384
|
+
i0.ɵɵproperty("disabled", ctx_r0.isLoading);
|
|
385
|
+
i0.ɵɵadvance(4);
|
|
386
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.currentAgent == null ? null : ctx_r0.currentAgent.Name, " ");
|
|
387
|
+
i0.ɵɵadvance(2);
|
|
388
|
+
i0.ɵɵproperty("disabled", ctx_r0.isLoading);
|
|
389
|
+
i0.ɵɵadvance(2);
|
|
390
|
+
i0.ɵɵproperty("disabled", !ctx_r0.newSubAgentName.trim() || ctx_r0.isLoading);
|
|
391
|
+
i0.ɵɵadvance();
|
|
392
|
+
i0.ɵɵconditional(ctx_r0.isLoading ? 26 : 27);
|
|
393
|
+
} }
|
|
394
|
+
export class AgentEditorComponent {
|
|
395
|
+
constructor() {
|
|
396
|
+
this.agentId = null;
|
|
397
|
+
this.close = new EventEmitter();
|
|
398
|
+
this.openAgent = new EventEmitter();
|
|
399
|
+
this.isLoading = false;
|
|
400
|
+
this.error = null;
|
|
401
|
+
this.currentAgent = null;
|
|
402
|
+
this.allAgents = [];
|
|
403
|
+
this.hierarchyData = null;
|
|
404
|
+
this.selectedNode = null;
|
|
405
|
+
this.agentPrompts = [];
|
|
406
|
+
// Tab settings
|
|
407
|
+
this.activeTab = 'hierarchy';
|
|
408
|
+
// Legacy layout settings (keeping for compatibility)
|
|
409
|
+
this.showHierarchy = true;
|
|
410
|
+
this.showPrompts = true;
|
|
411
|
+
this.showProperties = true;
|
|
412
|
+
// Sub-agent creation
|
|
413
|
+
this.showCreateSubAgent = false;
|
|
414
|
+
this.newSubAgentName = '';
|
|
415
|
+
this.newSubAgentDescription = '';
|
|
416
|
+
}
|
|
417
|
+
ngOnInit() {
|
|
418
|
+
if (this.agentId) {
|
|
419
|
+
this.loadAgentData();
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
ngAfterViewInit() {
|
|
423
|
+
// Chart initialization now happens after data loading in loadAgentData()
|
|
424
|
+
}
|
|
425
|
+
ngOnDestroy() {
|
|
426
|
+
// Cleanup D3
|
|
427
|
+
if (this.svg) {
|
|
428
|
+
this.svg.remove();
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
loadAgentData() {
|
|
432
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
433
|
+
try {
|
|
434
|
+
this.isLoading = true;
|
|
435
|
+
this.error = null;
|
|
436
|
+
// Load all agents to build hierarchy
|
|
437
|
+
const rv = new RunView();
|
|
438
|
+
const result = yield rv.RunView({
|
|
439
|
+
EntityName: 'AI Agents',
|
|
440
|
+
ExtraFilter: '',
|
|
441
|
+
OrderBy: 'Name',
|
|
442
|
+
MaxRows: 1000
|
|
443
|
+
});
|
|
444
|
+
this.allAgents = result.Results;
|
|
445
|
+
this.currentAgent = this.allAgents.find(a => a.ID === this.agentId) || null;
|
|
446
|
+
if (this.currentAgent) {
|
|
447
|
+
this.buildHierarchy();
|
|
448
|
+
this.loadAgentPrompts();
|
|
449
|
+
// Initialize chart after data is loaded
|
|
450
|
+
setTimeout(() => {
|
|
451
|
+
if (this.hierarchyChartRef) {
|
|
452
|
+
this.initializeChart();
|
|
453
|
+
}
|
|
454
|
+
}, 100);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
catch (error) {
|
|
458
|
+
console.error('Error loading agent data:', error);
|
|
459
|
+
this.error = 'Failed to load agent data';
|
|
460
|
+
}
|
|
461
|
+
finally {
|
|
462
|
+
this.isLoading = false;
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
buildHierarchy() {
|
|
467
|
+
if (!this.currentAgent)
|
|
468
|
+
return;
|
|
469
|
+
console.log('Building hierarchy for agent:', this.currentAgent.Name, 'ID:', this.currentAgent.ID);
|
|
470
|
+
console.log('All agents:', this.allAgents.length);
|
|
471
|
+
// Find the root of the hierarchy that contains our current agent
|
|
472
|
+
const rootAgent = this.findRootAgent(this.currentAgent);
|
|
473
|
+
console.log('Root agent found:', rootAgent.Name);
|
|
474
|
+
this.hierarchyData = this.buildHierarchyTree(rootAgent);
|
|
475
|
+
this.selectedNode = this.findNodeInHierarchy(this.hierarchyData, this.currentAgent.ID);
|
|
476
|
+
console.log('Hierarchy data:', this.hierarchyData);
|
|
477
|
+
console.log('Selected node:', this.selectedNode);
|
|
478
|
+
}
|
|
479
|
+
findRootAgent(agent) {
|
|
480
|
+
let current = agent;
|
|
481
|
+
while (current.ParentID) {
|
|
482
|
+
const parent = this.allAgents.find(a => a.ID === current.ParentID);
|
|
483
|
+
if (!parent)
|
|
484
|
+
break;
|
|
485
|
+
current = parent;
|
|
486
|
+
}
|
|
487
|
+
return current;
|
|
488
|
+
}
|
|
489
|
+
buildHierarchyTree(agent) {
|
|
490
|
+
const children = this.allAgents
|
|
491
|
+
.filter(a => a.ParentID === agent.ID)
|
|
492
|
+
.map(child => this.buildHierarchyTree(child));
|
|
493
|
+
const node = {
|
|
494
|
+
id: agent.ID,
|
|
495
|
+
name: agent.Name || 'Unnamed Agent',
|
|
496
|
+
agent: agent,
|
|
497
|
+
children: children
|
|
498
|
+
};
|
|
499
|
+
// Set parent references
|
|
500
|
+
if (node.children) {
|
|
501
|
+
node.children.forEach(child => child.parent = node);
|
|
502
|
+
}
|
|
503
|
+
return node;
|
|
504
|
+
}
|
|
505
|
+
findNodeInHierarchy(node, agentId) {
|
|
506
|
+
if (node.id === agentId)
|
|
507
|
+
return node;
|
|
508
|
+
if (node.children) {
|
|
509
|
+
for (const child of node.children) {
|
|
510
|
+
const found = this.findNodeInHierarchy(child, agentId);
|
|
511
|
+
if (found)
|
|
512
|
+
return found;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
return null;
|
|
516
|
+
}
|
|
517
|
+
loadAgentPrompts() {
|
|
518
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
519
|
+
if (!this.currentAgent)
|
|
520
|
+
return;
|
|
521
|
+
try {
|
|
522
|
+
// This would load prompts associated with the agent
|
|
523
|
+
// For now, using mock data structure
|
|
524
|
+
this.agentPrompts = [
|
|
525
|
+
{ id: '1', name: 'System Prompt', content: 'Default system instructions...', type: 'system' },
|
|
526
|
+
{ id: '2', name: 'User Prompt', content: 'User interaction template...', type: 'user' }
|
|
527
|
+
];
|
|
528
|
+
}
|
|
529
|
+
catch (error) {
|
|
530
|
+
console.error('Error loading agent prompts:', error);
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
initializeChart() {
|
|
535
|
+
var _a;
|
|
536
|
+
if (!((_a = this.hierarchyChartRef) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
const container = this.hierarchyChartRef.nativeElement;
|
|
540
|
+
const width = container.clientWidth || 800;
|
|
541
|
+
const height = container.clientHeight || 600;
|
|
542
|
+
// Clear any existing SVG
|
|
543
|
+
d3.select(container).selectAll('*').remove();
|
|
544
|
+
// Create SVG with zoom/pan functionality
|
|
545
|
+
this.svg = d3.select(container)
|
|
546
|
+
.append('svg')
|
|
547
|
+
.attr('width', width)
|
|
548
|
+
.attr('height', height)
|
|
549
|
+
.style('background', '#fafafa')
|
|
550
|
+
.style('border', '1px solid #e0e0e0');
|
|
551
|
+
// Create zoom behavior with wheel support
|
|
552
|
+
this.zoom = d3.zoom()
|
|
553
|
+
.scaleExtent([0.1, 3])
|
|
554
|
+
.wheelDelta((event) => -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * (event.ctrlKey ? 10 : 1))
|
|
555
|
+
.on('zoom', (event) => {
|
|
556
|
+
this.g.attr('transform', event.transform);
|
|
557
|
+
});
|
|
558
|
+
// Apply zoom to SVG
|
|
559
|
+
this.svg.call(this.zoom);
|
|
560
|
+
// Create main group for chart content
|
|
561
|
+
this.g = this.svg.append('g');
|
|
562
|
+
// Create tree layout with proper spacing - use nodeSize for fixed spacing
|
|
563
|
+
this.tree = d3.tree()
|
|
564
|
+
.nodeSize([150, 100]) // Fixed node spacing: 150px horizontal, 100px vertical
|
|
565
|
+
.separation((a, b) => a.parent === b.parent ? 1 : 1.5);
|
|
566
|
+
this.renderHierarchy();
|
|
567
|
+
}
|
|
568
|
+
renderHierarchy() {
|
|
569
|
+
if (!this.hierarchyData || !this.g || !this.tree) {
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
// Create hierarchy
|
|
573
|
+
this.root = d3.hierarchy(this.hierarchyData);
|
|
574
|
+
this.tree(this.root);
|
|
575
|
+
// Clear previous render
|
|
576
|
+
this.g.selectAll('*').remove();
|
|
577
|
+
// Get container dimensions
|
|
578
|
+
const container = this.hierarchyChartRef.nativeElement;
|
|
579
|
+
const containerWidth = container.clientWidth || 800;
|
|
580
|
+
// Calculate the tree bounds after layout
|
|
581
|
+
const treeBounds = this.getTreeBounds(this.root);
|
|
582
|
+
// Calculate centering offsets
|
|
583
|
+
const offsetX = (containerWidth - treeBounds.width) / 2 - treeBounds.minX;
|
|
584
|
+
const offsetY = 150; // Top margin for the tree
|
|
585
|
+
// Apply transform to center the tree properly
|
|
586
|
+
this.g.attr('transform', `translate(${offsetX}, ${offsetY})`);
|
|
587
|
+
// Draw links
|
|
588
|
+
this.g.selectAll('.link')
|
|
589
|
+
.data(this.root.links())
|
|
590
|
+
.enter().append('path')
|
|
591
|
+
.attr('class', 'link')
|
|
592
|
+
.attr('d', d3.linkVertical()
|
|
593
|
+
.x((d) => d.x)
|
|
594
|
+
.y((d) => d.y))
|
|
595
|
+
.style('fill', 'none')
|
|
596
|
+
.style('stroke', '#999')
|
|
597
|
+
.style('stroke-width', '2px')
|
|
598
|
+
.style('stroke-opacity', 0.6);
|
|
599
|
+
// Draw nodes
|
|
600
|
+
const nodes = this.g.selectAll('.node')
|
|
601
|
+
.data(this.root.descendants())
|
|
602
|
+
.enter().append('g')
|
|
603
|
+
.attr('class', 'node')
|
|
604
|
+
.attr('transform', (d) => `translate(${d.x}, ${d.y})`)
|
|
605
|
+
.style('cursor', 'pointer')
|
|
606
|
+
.on('click', (_event, d) => this.onNodeClick(d.data));
|
|
607
|
+
// Add rectangles for nodes
|
|
608
|
+
const nodeWidth = 120;
|
|
609
|
+
const nodeHeight = 40;
|
|
610
|
+
nodes.append('rect')
|
|
611
|
+
.attr('x', -nodeWidth / 2)
|
|
612
|
+
.attr('y', -nodeHeight / 2)
|
|
613
|
+
.attr('width', nodeWidth)
|
|
614
|
+
.attr('height', nodeHeight)
|
|
615
|
+
.attr('rx', 6)
|
|
616
|
+
.attr('ry', 6)
|
|
617
|
+
.style('fill', (d) => this.getNodeColor(d))
|
|
618
|
+
.style('stroke', (d) => this.getNodeStrokeColor(d))
|
|
619
|
+
.style('stroke-width', (d) => { var _a; return d.data.id === ((_a = this.currentAgent) === null || _a === void 0 ? void 0 : _a.ID) ? '3px' : '2px'; })
|
|
620
|
+
.style('opacity', 0.9);
|
|
621
|
+
// Add node labels (agent names)
|
|
622
|
+
nodes.append('text')
|
|
623
|
+
.attr('dy', -2)
|
|
624
|
+
.attr('text-anchor', 'middle')
|
|
625
|
+
.style('font-size', '11px')
|
|
626
|
+
.style('font-weight', (d) => { var _a; return d.data.id === ((_a = this.currentAgent) === null || _a === void 0 ? void 0 : _a.ID) ? 'bold' : '500'; })
|
|
627
|
+
.style('fill', '#333')
|
|
628
|
+
.style('pointer-events', 'none')
|
|
629
|
+
.text((d) => {
|
|
630
|
+
const name = d.data.name;
|
|
631
|
+
return name.length > 14 ? name.substring(0, 11) + '...' : name;
|
|
632
|
+
});
|
|
633
|
+
// Add execution mode labels
|
|
634
|
+
nodes.append('text')
|
|
635
|
+
.attr('dy', 12)
|
|
636
|
+
.attr('text-anchor', 'middle')
|
|
637
|
+
.style('font-size', '9px')
|
|
638
|
+
.style('fill', '#666')
|
|
639
|
+
.style('pointer-events', 'none')
|
|
640
|
+
.text((d) => d.data.agent.ExecutionMode);
|
|
641
|
+
// Add level indicators
|
|
642
|
+
nodes.append('text')
|
|
643
|
+
.attr('x', nodeWidth / 2 - 8)
|
|
644
|
+
.attr('y', -nodeHeight / 2 + 12)
|
|
645
|
+
.attr('text-anchor', 'middle')
|
|
646
|
+
.style('font-size', '8px')
|
|
647
|
+
.style('font-weight', 'bold')
|
|
648
|
+
.style('fill', '#fff')
|
|
649
|
+
.style('pointer-events', 'none')
|
|
650
|
+
.text((d) => `L${d.depth}`);
|
|
651
|
+
}
|
|
652
|
+
getTreeBounds(root) {
|
|
653
|
+
let minX = Infinity, maxX = -Infinity;
|
|
654
|
+
let minY = Infinity, maxY = -Infinity;
|
|
655
|
+
root.descendants().forEach((d) => {
|
|
656
|
+
minX = Math.min(minX, d.x);
|
|
657
|
+
maxX = Math.max(maxX, d.x);
|
|
658
|
+
minY = Math.min(minY, d.y);
|
|
659
|
+
maxY = Math.max(maxY, d.y);
|
|
660
|
+
});
|
|
661
|
+
return {
|
|
662
|
+
width: maxX - minX,
|
|
663
|
+
height: maxY - minY,
|
|
664
|
+
minX,
|
|
665
|
+
maxX,
|
|
666
|
+
minY,
|
|
667
|
+
maxY
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
getNodeColor(d) {
|
|
671
|
+
var _a;
|
|
672
|
+
const level = d.depth;
|
|
673
|
+
const isCurrentAgent = d.data.id === ((_a = this.currentAgent) === null || _a === void 0 ? void 0 : _a.ID);
|
|
674
|
+
// Level-based color scheme
|
|
675
|
+
const levelColors = [
|
|
676
|
+
'#1976d2', // Level 0 (root) - Blue
|
|
677
|
+
'#388e3c', // Level 1 - Green
|
|
678
|
+
'#f57c00', // Level 2 - Orange
|
|
679
|
+
'#7b1fa2', // Level 3 - Purple
|
|
680
|
+
'#c2185b', // Level 4 - Pink
|
|
681
|
+
'#5d4037' // Level 5+ - Brown
|
|
682
|
+
];
|
|
683
|
+
const baseColor = levelColors[Math.min(level, levelColors.length - 1)];
|
|
684
|
+
// Highlight current agent with brighter color
|
|
685
|
+
if (isCurrentAgent) {
|
|
686
|
+
return baseColor;
|
|
687
|
+
}
|
|
688
|
+
// Make non-current agents slightly lighter
|
|
689
|
+
return this.lightenColor(baseColor, 0.3);
|
|
690
|
+
}
|
|
691
|
+
getNodeStrokeColor(d) {
|
|
692
|
+
var _a;
|
|
693
|
+
const isCurrentAgent = d.data.id === ((_a = this.currentAgent) === null || _a === void 0 ? void 0 : _a.ID);
|
|
694
|
+
if (isCurrentAgent) {
|
|
695
|
+
return '#000';
|
|
696
|
+
}
|
|
697
|
+
return '#666';
|
|
698
|
+
}
|
|
699
|
+
lightenColor(color, factor) {
|
|
700
|
+
// Simple color lightening function
|
|
701
|
+
const hex = color.replace('#', '');
|
|
702
|
+
const r = parseInt(hex.slice(0, 2), 16);
|
|
703
|
+
const g = parseInt(hex.slice(2, 4), 16);
|
|
704
|
+
const b = parseInt(hex.slice(4, 6), 16);
|
|
705
|
+
const newR = Math.min(255, Math.floor(r + (255 - r) * factor));
|
|
706
|
+
const newG = Math.min(255, Math.floor(g + (255 - g) * factor));
|
|
707
|
+
const newB = Math.min(255, Math.floor(b + (255 - b) * factor));
|
|
708
|
+
return `rgb(${newR}, ${newG}, ${newB})`;
|
|
709
|
+
}
|
|
710
|
+
onNodeClick(node) {
|
|
711
|
+
var _a;
|
|
712
|
+
if (node.id !== ((_a = this.currentAgent) === null || _a === void 0 ? void 0 : _a.ID)) {
|
|
713
|
+
this.openAgent.emit(node.id);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
zoomIn() {
|
|
717
|
+
if (this.svg && this.zoom) {
|
|
718
|
+
this.svg.transition().call(this.zoom.scaleBy, 1.5);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
zoomOut() {
|
|
722
|
+
if (this.svg && this.zoom) {
|
|
723
|
+
this.svg.transition().call(this.zoom.scaleBy, 1 / 1.5);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
resetZoom() {
|
|
727
|
+
if (this.svg && this.zoom) {
|
|
728
|
+
// Reset to initial centered position
|
|
729
|
+
this.svg.transition().call(this.zoom.transform, d3.zoomIdentity);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
navigateToAgent(agentId) {
|
|
733
|
+
this.openAgent.emit(agentId);
|
|
734
|
+
}
|
|
735
|
+
closeEditor() {
|
|
736
|
+
this.close.emit();
|
|
737
|
+
}
|
|
738
|
+
setActiveTab(tab) {
|
|
739
|
+
this.activeTab = tab;
|
|
740
|
+
}
|
|
741
|
+
getExecutionModeColor(mode) {
|
|
742
|
+
return mode === 'Sequential' ? '#2196f3' : '#4caf50';
|
|
743
|
+
}
|
|
744
|
+
getExecutionModeIcon(mode) {
|
|
745
|
+
return mode === 'Sequential' ? 'fa-solid fa-list-ol' : 'fa-solid fa-layer-group';
|
|
746
|
+
}
|
|
747
|
+
openCreateSubAgent() {
|
|
748
|
+
this.showCreateSubAgent = true;
|
|
749
|
+
this.newSubAgentName = '';
|
|
750
|
+
this.newSubAgentDescription = '';
|
|
751
|
+
this.error = null;
|
|
752
|
+
}
|
|
753
|
+
closeCreateSubAgent() {
|
|
754
|
+
this.showCreateSubAgent = false;
|
|
755
|
+
this.newSubAgentName = '';
|
|
756
|
+
this.newSubAgentDescription = '';
|
|
757
|
+
}
|
|
758
|
+
createSubAgent() {
|
|
759
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
760
|
+
var _a;
|
|
761
|
+
if (!this.currentAgent || !this.newSubAgentName.trim())
|
|
762
|
+
return;
|
|
763
|
+
try {
|
|
764
|
+
this.isLoading = true;
|
|
765
|
+
this.error = null;
|
|
766
|
+
const md = Metadata.Provider;
|
|
767
|
+
if (!md) {
|
|
768
|
+
throw new Error('Metadata provider not available');
|
|
769
|
+
}
|
|
770
|
+
// Create new AI Agent entity
|
|
771
|
+
const newAgent = yield md.GetEntityObject('AI Agents', md.CurrentUser);
|
|
772
|
+
// Set agent properties
|
|
773
|
+
newAgent.Name = this.newSubAgentName.trim();
|
|
774
|
+
newAgent.Description = this.newSubAgentDescription.trim() || '';
|
|
775
|
+
newAgent.ParentID = this.currentAgent.ID;
|
|
776
|
+
// Set default values based on parent agent
|
|
777
|
+
newAgent.ExecutionMode = this.currentAgent.ExecutionMode || 'Sequential';
|
|
778
|
+
newAgent.ExecutionOrder = 1; // Default to 1, could be made configurable
|
|
779
|
+
newAgent.ExposeAsAction = false; // Default to false for sub-agents
|
|
780
|
+
newAgent.EnableContextCompression = this.currentAgent.EnableContextCompression || false;
|
|
781
|
+
newAgent.ContextCompressionMessageThreshold = this.currentAgent.ContextCompressionMessageThreshold || 10;
|
|
782
|
+
newAgent.ContextCompressionMessageRetentionCount = this.currentAgent.ContextCompressionMessageRetentionCount || 5;
|
|
783
|
+
// Save the new agent
|
|
784
|
+
const result = yield newAgent.Save();
|
|
785
|
+
if (result) {
|
|
786
|
+
LogStatus('Sub-agent created successfully');
|
|
787
|
+
// Close the dialog
|
|
788
|
+
this.closeCreateSubAgent();
|
|
789
|
+
// Reload agent data to show the new hierarchy
|
|
790
|
+
yield this.loadAgentData();
|
|
791
|
+
// Navigate to the newly created agent
|
|
792
|
+
this.openAgent.emit(newAgent.ID);
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
// Handle save failure
|
|
796
|
+
const errorMessage = ((_a = newAgent.LatestResult) === null || _a === void 0 ? void 0 : _a.Message) || 'Unknown error occurred while creating sub-agent';
|
|
797
|
+
this.error = `Failed to create sub-agent: ${errorMessage}`;
|
|
798
|
+
LogError('Sub-agent creation failed', undefined, errorMessage);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
catch (error) {
|
|
802
|
+
const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
|
|
803
|
+
this.error = `Failed to create sub-agent: ${errorMessage}`;
|
|
804
|
+
LogError('Error creating sub-agent', undefined, error);
|
|
805
|
+
}
|
|
806
|
+
finally {
|
|
807
|
+
this.isLoading = false;
|
|
808
|
+
}
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
hasChildren() {
|
|
812
|
+
var _a;
|
|
813
|
+
return ((_a = this.selectedNode) === null || _a === void 0 ? void 0 : _a.children) && this.selectedNode.children.length > 0 || false;
|
|
814
|
+
}
|
|
815
|
+
hasParent() {
|
|
816
|
+
var _a;
|
|
817
|
+
return ((_a = this.selectedNode) === null || _a === void 0 ? void 0 : _a.parent) !== undefined;
|
|
818
|
+
}
|
|
819
|
+
getChildCount() {
|
|
820
|
+
var _a, _b;
|
|
821
|
+
return ((_b = (_a = this.selectedNode) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length) || 0;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
AgentEditorComponent.ɵfac = function AgentEditorComponent_Factory(t) { return new (t || AgentEditorComponent)(); };
|
|
825
|
+
AgentEditorComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AgentEditorComponent, selectors: [["mj-agent-editor"]], viewQuery: function AgentEditorComponent_Query(rf, ctx) { if (rf & 1) {
|
|
826
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
827
|
+
} if (rf & 2) {
|
|
828
|
+
let _t;
|
|
829
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.hierarchyChartRef = _t.first);
|
|
830
|
+
} }, inputs: { agentId: "agentId" }, outputs: { close: "close", openAgent: "openAgent" }, decls: 12, vars: 8, consts: [["hierarchyChart", ""], ["mjFillContainer", "", 1, "agent-editor-container", 3, "rightMargin", "bottomMargin"], [1, "editor-header"], [1, "header-info"], ["type", "button", "title", "Back to Agent List", 1, "back-btn", 3, "click"], [1, "fa-solid", "fa-arrow-left"], [1, "agent-breadcrumb"], [1, "tab-navigation"], [1, "loading-container"], [1, "error-container"], ["mjFillContainer", "", 1, "tab-content"], [1, "modal-overlay"], [1, "breadcrumb-item"], [1, "fa-solid", "fa-chevron-right"], ["type", "button", 1, "tab-btn", 3, "click"], [1, "fa-solid", "fa-sitemap"], [1, "fa-solid", "fa-comment-dots"], [1, "fa-solid", "fa-cog"], [1, "loading-content"], [1, "loading-spinner"], [1, "spinner-ring"], [1, "loading-text"], [1, "error-content"], [1, "fa-solid", "fa-exclamation-triangle"], [1, "retry-btn", 3, "click"], [1, "fa-solid", "fa-retry"], ["mjFillContainer", "", 1, "hierarchy-section"], ["mjFillContainer", "", 1, "prompts-section"], ["mjFillContainer", "", 1, "properties-section"], [1, "section-header"], [1, "hierarchy-controls"], [1, "zoom-controls"], ["type", "button", "title", "Zoom In", 1, "zoom-btn", 3, "click"], [1, "fa-solid", "fa-plus"], ["type", "button", "title", "Zoom Out", 1, "zoom-btn", 3, "click"], [1, "fa-solid", "fa-minus"], ["type", "button", "title", "Reset Zoom", 1, "zoom-btn", 3, "click"], [1, "fa-solid", "fa-expand"], [1, "hierarchy-legend"], [1, "legend-item"], [1, "legend-rect", "level-0"], [1, "legend-rect", "level-1"], [1, "legend-rect", "level-2"], ["mjFillContainer", "", 1, "hierarchy-chart"], [1, "chart-help"], [1, "empty-hierarchy"], [1, "fa-solid", "fa-hand-pointer"], [1, "create-subagent-btn", 3, "click"], ["title", "Add New Prompt", 1, "add-prompt-btn"], [1, "prompts-list"], [1, "empty-prompts"], [1, "add-first-prompt-btn"], [1, "prompt-card"], [1, "prompt-header"], [1, "prompt-info"], [1, "prompt-type"], [1, "prompt-actions"], ["title", "Edit Prompt", 1, "action-btn"], [1, "fa-solid", "fa-edit"], ["title", "Delete Prompt", 1, "action-btn", "danger"], [1, "fa-solid", "fa-trash"], [1, "prompt-content"], ["title", "Save Changes", 1, "save-btn"], [1, "fa-solid", "fa-save"], [1, "properties-form"], [1, "form-group"], ["type", "text", "placeholder", "Agent name", 1, "form-input", 3, "value"], ["placeholder", "Agent description", "rows", "3", 1, "form-textarea", 3, "value"], [1, "form-row"], [1, "form-select", 3, "value"], ["value", "Sequential"], ["value", "Parallel"], ["type", "number", "min", "0", 1, "form-input", 3, "value"], [1, "form-group", "checkbox-group"], [1, "checkbox-label"], ["type", "checkbox", 3, "checked"], [1, "checkmark"], ["type", "number", "min", "1", "placeholder", "Number of messages", 1, "form-input", 3, "value"], ["type", "number", "min", "0", "placeholder", "Messages to keep", 1, "form-input", 3, "value"], [1, "modal-overlay", 3, "click"], [1, "create-subagent-modal", 3, "click"], [1, "modal-header"], [1, "close-btn", 3, "click"], [1, "fa-solid", "fa-times"], [1, "modal-body"], [1, "error-message"], ["type", "text", "placeholder", "Enter agent name...", "maxlength", "255", 1, "form-input", 3, "ngModelChange", "ngModel", "disabled"], ["placeholder", "Describe what this sub-agent will do...", "rows", "4", 1, "form-textarea", 3, "ngModelChange", "ngModel", "disabled"], [1, "parent-info"], [1, "modal-footer"], [1, "cancel-btn", 3, "click", "disabled"], [1, "create-btn", 3, "click", "disabled"], [1, "loading-spinner-sm"]], template: function AgentEditorComponent_Template(rf, ctx) { if (rf & 1) {
|
|
831
|
+
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "div", 3)(3, "button", 4);
|
|
832
|
+
i0.ɵɵlistener("click", function AgentEditorComponent_Template_button_click_3_listener() { return ctx.closeEditor(); });
|
|
833
|
+
i0.ɵɵelement(4, "i", 5);
|
|
834
|
+
i0.ɵɵtext(5, " Back to Agents ");
|
|
835
|
+
i0.ɵɵelementEnd();
|
|
836
|
+
i0.ɵɵtemplate(6, AgentEditorComponent_Conditional_6_Template, 4, 2, "div", 6);
|
|
837
|
+
i0.ɵɵelementEnd()();
|
|
838
|
+
i0.ɵɵtemplate(7, AgentEditorComponent_Conditional_7_Template, 10, 6, "div", 7)(8, AgentEditorComponent_Conditional_8_Template, 8, 0, "div", 8)(9, AgentEditorComponent_Conditional_9_Template, 10, 1, "div", 9)(10, AgentEditorComponent_Conditional_10_Template, 4, 3, "div", 10)(11, AgentEditorComponent_Conditional_11_Template, 28, 9, "div", 11);
|
|
839
|
+
i0.ɵɵelementEnd();
|
|
840
|
+
} if (rf & 2) {
|
|
841
|
+
i0.ɵɵproperty("rightMargin", 8)("bottomMargin", 8);
|
|
842
|
+
i0.ɵɵadvance(6);
|
|
843
|
+
i0.ɵɵconditional(ctx.currentAgent ? 6 : -1);
|
|
844
|
+
i0.ɵɵadvance();
|
|
845
|
+
i0.ɵɵconditional(!ctx.isLoading && !ctx.error && ctx.currentAgent ? 7 : -1);
|
|
846
|
+
i0.ɵɵadvance();
|
|
847
|
+
i0.ɵɵconditional(ctx.isLoading ? 8 : -1);
|
|
848
|
+
i0.ɵɵadvance();
|
|
849
|
+
i0.ɵɵconditional(ctx.error ? 9 : -1);
|
|
850
|
+
i0.ɵɵadvance();
|
|
851
|
+
i0.ɵɵconditional(!ctx.isLoading && !ctx.error && ctx.currentAgent ? 10 : -1);
|
|
852
|
+
i0.ɵɵadvance();
|
|
853
|
+
i0.ɵɵconditional(ctx.showCreateSubAgent ? 11 : -1);
|
|
854
|
+
} }, dependencies: [i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i1.DefaultValueAccessor, i1.NgControlStatus, i1.MaxLengthValidator, i1.NgModel, i2.FillContainer], styles: ["@use \"../../../../../../../dist/packages/Angular/Explorer/explorer-core/src/generic/generic-browse-list.component\";\n\n.agent-editor-container[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: #f8f9fa;\n}\n\n.editor-header[_ngcontent-%COMP%] {\n background: white;\n border-bottom: 1px solid #e0e0e0;\n padding: 16px 20px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n .header-info {\n display: flex;\n align-items: center;\n gap: 20px;\n \n .back-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n background: #f8f9fa;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n color: #666;\n text-decoration: none;\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s;\n \n &:hover {\n background: #e9ecef;\n border-color: #ccc;\n color: #333;\n }\n }\n \n .agent-breadcrumb {\n h2 {\n margin: 0;\n font-size: 24px;\n font-weight: 600;\n color: #333;\n }\n \n .breadcrumb-item {\n font-size: 14px;\n color: #666;\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 4px;\n }\n }\n }\n \n .header-controls {\n display: flex;\n gap: 8px;\n \n .control-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 12px;\n background: white;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n color: #666;\n font-size: 12px;\n cursor: pointer;\n transition: all 0.2s;\n \n &:hover {\n background: #f8f9fa;\n border-color: #2196f3;\n color: #2196f3;\n }\n \n &.active {\n background: #2196f3;\n border-color: #2196f3;\n color: white;\n }\n }\n }\n}\n\n//[_ngcontent-%COMP%] Tab[_ngcontent-%COMP%] Navigation\n.tab-navigation[_ngcontent-%COMP%] {\n background: white;\n border-bottom: 1px solid #e0e0e0;\n padding: 0 20px;\n display: flex;\n gap: 2px;\n flex-shrink: 0;\n \n .tab-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px;\n background: none;\n border: none;\n border-bottom: 3px solid transparent;\n color: #666;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n \n &:hover {\n color: #2196f3;\n background: #f8f9fa;\n }\n \n &.active {\n color: #2196f3;\n border-bottom-color: #2196f3;\n background: #f8f9fa;\n }\n \n i {\n font-size: 16px;\n }\n }\n}\n\n.tab-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow: hidden;\n}\n\n.loading-container[_ngcontent-%COMP%], .error-container[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n \n .loading-content, .error-content {\n text-align: center;\n \n .loading-spinner {\n position: relative;\n width: 60px;\n height: 60px;\n margin: 0 auto 20px;\n }\n \n .spinner-ring {\n position: absolute;\n width: 100%;\n height: 100%;\n border: 3px solid transparent;\n border-radius: 50%;\n animation: _ngcontent-%COMP%_spin 1.5s linear infinite;\n \n &:nth-child(1) {\n border-top-color: #2196f3;\n animation-delay: 0s;\n }\n \n &:nth-child(2) {\n border-top-color: #9c27b0;\n animation-delay: 0.3s;\n transform: scale(0.8);\n }\n \n &:nth-child(3) {\n border-top-color: #ff6b35;\n animation-delay: 0.6s;\n transform: scale(0.6);\n }\n }\n \n .loading-text {\n font-size: 16px;\n color: #666;\n }\n \n i {\n font-size: 48px;\n color: #dc3545;\n margin-bottom: 16px;\n }\n \n h3 {\n margin: 0 0 8px 0;\n color: #333;\n }\n \n p {\n margin: 0 0 16px 0;\n color: #666;\n }\n \n .retry-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n background: #dc3545;\n border: none;\n border-radius: 4px;\n color: white;\n cursor: pointer;\n \n &:hover {\n background: #c82333;\n }\n }\n }\n}\n\n.editor-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow: hidden;\n}\n\n.main-splitter[_ngcontent-%COMP%], .bottom-splitter[_ngcontent-%COMP%] {\n height: 100%;\n \n .k-pane {\n overflow: hidden;\n }\n}\n\n//[_ngcontent-%COMP%] Hierarchy[_ngcontent-%COMP%] Section\n.hierarchy-section[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: white;\n \n .section-header {\n padding: 16px 20px;\n border-bottom: 1px solid #f0f0f0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: #333;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n \n .hierarchy-controls {\n display: flex;\n align-items: center;\n gap: 20px;\n \n .zoom-controls {\n display: flex;\n gap: 4px;\n \n .zoom-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n background: white;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n color: #666;\n cursor: pointer;\n transition: all 0.2s;\n \n &:hover {\n background: #f8f9fa;\n border-color: #2196f3;\n color: #2196f3;\n }\n \n i {\n font-size: 12px;\n }\n }\n }\n \n .hierarchy-legend {\n display: flex;\n gap: 16px;\n \n .legend-item {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n color: #666;\n \n .legend-rect {\n width: 20px;\n height: 12px;\n border-radius: 2px;\n border: 1px solid;\n \n &.level-0 {\n background: #1976d2;\n border-color: #1565c0;\n }\n \n &.level-1 {\n background: #388e3c;\n border-color: #2e7d32;\n }\n \n &.level-2 {\n background: #f57c00;\n border-color: #ef6c00;\n }\n }\n }\n }\n }\n }\n \n .hierarchy-chart {\n flex: 1;\n min-height: 300px;\n overflow: hidden;\n position: relative;\n \n .chart-help {\n position: absolute;\n bottom: 10px;\n left: 10px;\n background: rgba(255, 255, 255, 0.9);\n padding: 6px 10px;\n border-radius: 4px;\n border: 1px solid #e0e0e0;\n z-index: 10;\n \n small {\n font-size: 11px;\n color: #666;\n display: flex;\n align-items: center;\n gap: 6px;\n \n i {\n color: #2196f3;\n }\n }\n }\n \n .empty-hierarchy {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 40px 20px;\n text-align: center;\n color: #666;\n \n i {\n font-size: 64px;\n margin-bottom: 20px;\n opacity: 0.5;\n }\n \n h4 {\n margin: 0 0 12px 0;\n font-size: 18px;\n color: #333;\n }\n \n p {\n margin: 0 0 24px 0;\n font-size: 14px;\n color: #666;\n line-height: 1.5;\n }\n \n .create-subagent-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 20px;\n background: #2196f3;\n border: none;\n border-radius: 6px;\n color: white;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n \n &:hover {\n background: #1976d2;\n }\n }\n }\n }\n \n}\n\n//[_ngcontent-%COMP%] Prompts[_ngcontent-%COMP%] Section\n.prompts-section[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: white;\n border-right: 1px solid #f0f0f0;\n \n .section-header {\n padding: 16px 20px;\n border-bottom: 1px solid #f0f0f0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: #333;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n \n .add-prompt-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n background: #2196f3;\n border: none;\n border-radius: 4px;\n color: white;\n font-size: 12px;\n cursor: pointer;\n \n &:hover {\n background: #1976d2;\n }\n }\n }\n \n .prompts-list {\n flex: 1;\n overflow-y: auto;\n padding: 16px 20px;\n \n .empty-prompts {\n text-align: center;\n padding: 40px 20px;\n color: #666;\n \n i {\n font-size: 48px;\n margin-bottom: 16px;\n }\n \n p {\n margin: 0 0 20px 0;\n font-size: 14px;\n }\n \n .add-first-prompt-btn {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n background: #2196f3;\n border: none;\n border-radius: 4px;\n color: white;\n cursor: pointer;\n \n &:hover {\n background: #1976d2;\n }\n }\n }\n \n .prompt-card {\n background: #f8f9fa;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n margin-bottom: 12px;\n \n .prompt-header {\n padding: 12px 16px;\n border-bottom: 1px solid #e9ecef;\n display: flex;\n justify-content: space-between;\n align-items: center;\n \n .prompt-info {\n h4 {\n margin: 0 0 4px 0;\n font-size: 14px;\n font-weight: 600;\n color: #333;\n }\n \n .prompt-type {\n font-size: 11px;\n padding: 2px 6px;\n background: #007bff;\n color: white;\n border-radius: 3px;\n text-transform: uppercase;\n }\n }\n \n .prompt-actions {\n display: flex;\n gap: 4px;\n \n .action-btn {\n padding: 4px 8px;\n background: none;\n border: 1px solid #e0e0e0;\n border-radius: 3px;\n color: #666;\n cursor: pointer;\n font-size: 12px;\n \n &:hover {\n background: #f0f0f0;\n border-color: #ccc;\n }\n \n &.danger:hover {\n background: #dc3545;\n border-color: #dc3545;\n color: white;\n }\n }\n }\n }\n \n .prompt-content {\n padding: 12px 16px;\n \n p {\n margin: 0;\n font-size: 12px;\n color: #666;\n line-height: 1.4;\n }\n }\n }\n }\n}\n\n//[_ngcontent-%COMP%] Properties[_ngcontent-%COMP%] Section\n.properties-section[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: white;\n \n .section-header {\n padding: 16px 20px;\n border-bottom: 1px solid #f0f0f0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: #333;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n \n .save-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n background: #28a745;\n border: none;\n border-radius: 4px;\n color: white;\n font-size: 12px;\n cursor: pointer;\n \n &:hover {\n background: #218838;\n }\n }\n }\n \n .properties-form {\n flex: 1;\n overflow-y: auto;\n padding: 20px;\n \n .form-group {\n margin-bottom: 16px;\n \n label {\n display: block;\n font-size: 12px;\n font-weight: 600;\n color: #333;\n margin-bottom: 4px;\n }\n \n .form-input, .form-select, .form-textarea {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #ddd;\n border-radius: 4px;\n font-size: 13px;\n background: white;\n box-sizing: border-box;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n }\n \n .form-textarea {\n resize: vertical;\n min-height: 60px;\n }\n \n &.checkbox-group {\n .checkbox-label {\n display: flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n \n input[type=\"checkbox\"] {\n width: auto;\n margin: 0;\n }\n }\n \n small {\n display: block;\n font-size: 11px;\n color: #666;\n margin-top: 4px;\n margin-left: 24px;\n }\n }\n }\n \n .form-row {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n }\n }\n}\n\n@keyframes _ngcontent-%COMP%_spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n//[_ngcontent-%COMP%] Sub-Agent[_ngcontent-%COMP%] Creation[_ngcontent-%COMP%] Modal\n.modal-overlay[_ngcontent-%COMP%] {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n padding: 20px;\n box-sizing: border-box;\n}\n\n.create-subagent-modal[_ngcontent-%COMP%] {\n background: white;\n border-radius: 8px;\n width: 100%;\n max-width: 500px;\n max-height: calc(100vh - 40px);\n min-height: 300px;\n display: flex;\n flex-direction: column;\n box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);\n position: relative;\n \n .modal-header {\n padding: 20px 24px;\n border-bottom: 1px solid #e9ecef;\n display: flex;\n justify-content: space-between;\n align-items: center;\n \n h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: #333;\n display: flex;\n align-items: center;\n gap: 10px;\n }\n \n .close-btn {\n background: none;\n border: none;\n padding: 8px;\n cursor: pointer;\n color: #666;\n border-radius: 4px;\n \n &:hover {\n background: #f8f9fa;\n color: #333;\n }\n }\n }\n \n .modal-body {\n padding: 24px;\n flex: 1;\n overflow-y: auto;\n \n .error-message {\n background: #f8d7da;\n border: 1px solid #f5c6cb;\n border-radius: 6px;\n padding: 12px;\n margin-bottom: 20px;\n color: #721c24;\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 8px;\n \n i {\n color: #dc3545;\n }\n }\n \n .form-group {\n margin-bottom: 20px;\n \n label {\n display: block;\n font-size: 14px;\n font-weight: 600;\n color: #333;\n margin-bottom: 8px;\n }\n \n .form-input, .form-textarea {\n width: 100%;\n padding: 12px;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n background: white;\n box-sizing: border-box;\n transition: border-color 0.2s;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n \n &::placeholder {\n color: #999;\n }\n }\n \n .form-textarea {\n resize: vertical;\n min-height: 80px;\n font-family: inherit;\n }\n }\n \n .parent-info {\n background: #f8f9fa;\n border: 1px solid #e9ecef;\n border-radius: 6px;\n padding: 12px;\n font-size: 14px;\n color: #666;\n \n strong {\n color: #333;\n }\n }\n }\n \n .modal-footer {\n padding: 20px 24px;\n border-top: 1px solid #e9ecef;\n display: flex;\n justify-content: flex-end;\n gap: 12px;\n \n .cancel-btn, .create-btn {\n padding: 10px 20px;\n border: 1px solid;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n \n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n }\n \n .cancel-btn {\n background: white;\n border-color: #ddd;\n color: #666;\n \n &:hover:not(:disabled) {\n background: #f8f9fa;\n border-color: #ccc;\n }\n }\n \n .create-btn {\n background: #2196f3;\n border-color: #2196f3;\n color: white;\n display: flex;\n align-items: center;\n gap: 8px;\n \n &:hover:not(:disabled) {\n background: #1976d2;\n border-color: #1976d2;\n }\n \n .loading-spinner-sm {\n width: 14px;\n height: 14px;\n border: 2px solid transparent;\n border-top-color: currentColor;\n border-radius: 50%;\n animation: _ngcontent-%COMP%_spin 1s linear infinite;\n }\n }\n }\n}"] });
|
|
855
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AgentEditorComponent, [{
|
|
856
|
+
type: Component,
|
|
857
|
+
args: [{ selector: 'mj-agent-editor', template: "<div class=\"agent-editor-container\" mjFillContainer [rightMargin]=\"8\" [bottomMargin]=\"8\">\n <!-- Header -->\n <div class=\"editor-header\">\n <div class=\"header-info\">\n <button \n type=\"button\" \n class=\"back-btn\"\n (click)=\"closeEditor()\"\n title=\"Back to Agent List\">\n <i class=\"fa-solid fa-arrow-left\"></i>\n Back to Agents\n </button>\n \n @if (currentAgent) {\n <div class=\"agent-breadcrumb\">\n <h2>{{ currentAgent.Name }}</h2>\n @if (currentAgent.Parent) {\n <span class=\"breadcrumb-item\">\n <i class=\"fa-solid fa-chevron-right\"></i>\n Child of {{ currentAgent.Parent }}\n </span>\n }\n </div>\n }\n </div>\n </div>\n\n <!-- Tab Navigation -->\n @if (!isLoading && !error && currentAgent) {\n <div class=\"tab-navigation\">\n <button \n type=\"button\" \n class=\"tab-btn\"\n [class.active]=\"activeTab === 'hierarchy'\"\n (click)=\"setActiveTab('hierarchy')\">\n <i class=\"fa-solid fa-sitemap\"></i>\n Hierarchy\n </button>\n \n <button \n type=\"button\" \n class=\"tab-btn\"\n [class.active]=\"activeTab === 'prompts'\"\n (click)=\"setActiveTab('prompts')\">\n <i class=\"fa-solid fa-comment-dots\"></i>\n Prompts\n </button>\n \n <button \n type=\"button\" \n class=\"tab-btn\"\n [class.active]=\"activeTab === 'properties'\"\n (click)=\"setActiveTab('properties')\">\n <i class=\"fa-solid fa-cog\"></i>\n Properties\n </button>\n </div>\n }\n\n <!-- Loading State -->\n @if (isLoading) {\n <div class=\"loading-container\">\n <div class=\"loading-content\">\n <div class=\"loading-spinner\">\n <div class=\"spinner-ring\"></div>\n <div class=\"spinner-ring\"></div>\n <div class=\"spinner-ring\"></div>\n </div>\n <div class=\"loading-text\">Loading agent data...</div>\n </div>\n </div>\n }\n\n <!-- Error State -->\n @if (error) {\n <div class=\"error-container\">\n <div class=\"error-content\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n <h3>Error Loading Agent</h3>\n <p>{{ error }}</p>\n <button class=\"retry-btn\" (click)=\"loadAgentData()\">\n <i class=\"fa-solid fa-retry\"></i>\n Retry\n </button>\n </div>\n </div>\n }\n\n <!-- Tab Content -->\n @if (!isLoading && !error && currentAgent) {\n <div class=\"tab-content\" mjFillContainer>\n \n <!-- Hierarchy Tab -->\n @if (activeTab === 'hierarchy') {\n <div class=\"hierarchy-section\" mjFillContainer>\n <div class=\"section-header\">\n <h3>\n <i class=\"fa-solid fa-sitemap\"></i>\n Agent Hierarchy\n </h3>\n \n <div class=\"hierarchy-controls\">\n <div class=\"zoom-controls\">\n <button \n type=\"button\" \n class=\"zoom-btn\"\n (click)=\"zoomIn()\"\n title=\"Zoom In\">\n <i class=\"fa-solid fa-plus\"></i>\n </button>\n <button \n type=\"button\" \n class=\"zoom-btn\"\n (click)=\"zoomOut()\"\n title=\"Zoom Out\">\n <i class=\"fa-solid fa-minus\"></i>\n </button>\n <button \n type=\"button\" \n class=\"zoom-btn\"\n (click)=\"resetZoom()\"\n title=\"Reset Zoom\">\n <i class=\"fa-solid fa-expand\"></i>\n </button>\n </div>\n \n <div class=\"hierarchy-legend\">\n <div class=\"legend-item\">\n <div class=\"legend-rect level-0\"></div>\n <span>Root</span>\n </div>\n <div class=\"legend-item\">\n <div class=\"legend-rect level-1\"></div>\n <span>Level 1</span>\n </div>\n <div class=\"legend-item\">\n <div class=\"legend-rect level-2\"></div>\n <span>Level 2+</span>\n </div>\n </div>\n </div>\n </div>\n \n <div class=\"hierarchy-chart\" #hierarchyChart mjFillContainer>\n <!-- Help text overlay -->\n @if (hierarchyData && (hasChildren() || hasParent())) {\n <div class=\"chart-help\">\n <small>\n <i class=\"fa-solid fa-hand-pointer\"></i>\n Drag to pan \u2022 Use zoom controls or scroll to zoom \u2022 Click nodes to navigate\n </small>\n </div>\n }\n \n <!-- Empty state for hierarchy -->\n @if (!hierarchyData || (!hasChildren() && !hasParent())) {\n <div class=\"empty-hierarchy\">\n <i class=\"fa-solid fa-sitemap\"></i>\n <h4>No Agent Hierarchy</h4>\n <p>This agent doesn't have any parent or child agents yet.</p>\n <button class=\"create-subagent-btn\" (click)=\"openCreateSubAgent()\">\n <i class=\"fa-solid fa-plus\"></i>\n Create Sub-Agent\n </button>\n </div>\n }\n </div>\n </div>\n }\n \n <!-- Prompts Tab -->\n @if (activeTab === 'prompts') {\n <div class=\"prompts-section\" mjFillContainer>\n <div class=\"section-header\">\n <h3>\n <i class=\"fa-solid fa-comment-dots\"></i>\n Agent Prompts\n </h3>\n <button class=\"add-prompt-btn\" title=\"Add New Prompt\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Prompt\n </button>\n </div>\n \n <div class=\"prompts-list\">\n @if (agentPrompts.length === 0) {\n <div class=\"empty-prompts\">\n <i class=\"fa-solid fa-comment-dots\"></i>\n <p>No prompts configured for this agent</p>\n <button class=\"add-first-prompt-btn\">\n <i class=\"fa-solid fa-plus\"></i>\n Add First Prompt\n </button>\n </div>\n } @else {\n @for (prompt of agentPrompts; track prompt.id) {\n <div class=\"prompt-card\">\n <div class=\"prompt-header\">\n <div class=\"prompt-info\">\n <h4>{{ prompt.name }}</h4>\n <span class=\"prompt-type\">{{ prompt.type }}</span>\n </div>\n <div class=\"prompt-actions\">\n <button class=\"action-btn\" title=\"Edit Prompt\">\n <i class=\"fa-solid fa-edit\"></i>\n </button>\n <button class=\"action-btn danger\" title=\"Delete Prompt\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n </div>\n </div>\n <div class=\"prompt-content\">\n <p>{{ prompt.content }}</p>\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n \n <!-- Properties Tab -->\n @if (activeTab === 'properties') {\n <div class=\"properties-section\" mjFillContainer>\n <div class=\"section-header\">\n <h3>\n <i class=\"fa-solid fa-cog\"></i>\n Agent Properties\n </h3>\n <button class=\"save-btn\" title=\"Save Changes\">\n <i class=\"fa-solid fa-save\"></i>\n Save\n </button>\n </div>\n \n <div class=\"properties-form\">\n <div class=\"form-group\">\n <label>Name</label>\n <input \n type=\"text\" \n class=\"form-input\"\n [value]=\"currentAgent.Name\"\n placeholder=\"Agent name\">\n </div>\n \n <div class=\"form-group\">\n <label>Description</label>\n <textarea \n class=\"form-textarea\"\n [value]=\"currentAgent.Description\"\n placeholder=\"Agent description\"\n rows=\"3\"></textarea>\n </div>\n \n <div class=\"form-row\">\n <div class=\"form-group\">\n <label>Execution Mode</label>\n <select class=\"form-select\" [value]=\"currentAgent.ExecutionMode\">\n <option value=\"Sequential\">Sequential</option>\n <option value=\"Parallel\">Parallel</option>\n </select>\n </div>\n \n <div class=\"form-group\">\n <label>Execution Order</label>\n <input \n type=\"number\" \n class=\"form-input\"\n [value]=\"currentAgent.ExecutionOrder\"\n min=\"0\">\n </div>\n </div>\n \n <div class=\"form-group checkbox-group\">\n <label class=\"checkbox-label\">\n <input \n type=\"checkbox\" \n [checked]=\"currentAgent.ExposeAsAction\">\n <span class=\"checkmark\"></span>\n Expose as Action\n </label>\n <small>Allow this agent to be used as an action by other agents</small>\n </div>\n \n <div class=\"form-group checkbox-group\">\n <label class=\"checkbox-label\">\n <input \n type=\"checkbox\" \n [checked]=\"currentAgent.EnableContextCompression\">\n <span class=\"checkmark\"></span>\n Enable Context Compression\n </label>\n <small>Automatically compress conversation context when threshold is reached</small>\n </div>\n \n @if (currentAgent.EnableContextCompression) {\n <div class=\"form-row\">\n <div class=\"form-group\">\n <label>Message Threshold</label>\n <input \n type=\"number\" \n class=\"form-input\"\n [value]=\"currentAgent.ContextCompressionMessageThreshold\"\n min=\"1\"\n placeholder=\"Number of messages\">\n </div>\n \n <div class=\"form-group\">\n <label>Retention Count</label>\n <input \n type=\"number\" \n class=\"form-input\"\n [value]=\"currentAgent.ContextCompressionMessageRetentionCount\"\n min=\"0\"\n placeholder=\"Messages to keep\">\n </div>\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n\n <!-- Sub-Agent Creation Modal -->\n @if (showCreateSubAgent) {\n <div class=\"modal-overlay\" (click)=\"closeCreateSubAgent()\">\n <div class=\"create-subagent-modal\" (click)=\"$event.stopPropagation()\">\n <div class=\"modal-header\">\n <h3>\n <i class=\"fa-solid fa-plus\"></i>\n Create Sub-Agent\n </h3>\n <button class=\"close-btn\" (click)=\"closeCreateSubAgent()\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n \n <div class=\"modal-body\">\n @if (error) {\n <div class=\"error-message\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ error }}\n </div>\n }\n \n <div class=\"form-group\">\n <label>Agent Name *</label>\n <input \n type=\"text\" \n class=\"form-input\"\n [(ngModel)]=\"newSubAgentName\"\n placeholder=\"Enter agent name...\"\n maxlength=\"255\"\n [disabled]=\"isLoading\">\n </div>\n \n <div class=\"form-group\">\n <label>Description</label>\n <textarea \n class=\"form-textarea\"\n [(ngModel)]=\"newSubAgentDescription\"\n placeholder=\"Describe what this sub-agent will do...\"\n rows=\"4\"\n [disabled]=\"isLoading\"></textarea>\n </div>\n \n <div class=\"parent-info\">\n <strong>Parent Agent:</strong> {{ currentAgent?.Name }}\n </div>\n </div>\n \n <div class=\"modal-footer\">\n <button \n class=\"cancel-btn\" \n (click)=\"closeCreateSubAgent()\"\n [disabled]=\"isLoading\">\n Cancel\n </button>\n <button \n class=\"create-btn\" \n (click)=\"createSubAgent()\"\n [disabled]=\"!newSubAgentName.trim() || isLoading\">\n @if (isLoading) {\n <span class=\"loading-spinner-sm\"></span>\n Creating...\n } @else {\n <i class=\"fa-solid fa-plus\"></i>\n Create Sub-Agent\n }\n </button>\n </div>\n </div>\n </div>\n }\n</div>", styles: ["@use \"../../../../../../../dist/packages/Angular/Explorer/explorer-core/src/generic/generic-browse-list.component\";\n\n.agent-editor-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: #f8f9fa;\n}\n\n.editor-header {\n background: white;\n border-bottom: 1px solid #e0e0e0;\n padding: 16px 20px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n .header-info {\n display: flex;\n align-items: center;\n gap: 20px;\n \n .back-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n background: #f8f9fa;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n color: #666;\n text-decoration: none;\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s;\n \n &:hover {\n background: #e9ecef;\n border-color: #ccc;\n color: #333;\n }\n }\n \n .agent-breadcrumb {\n h2 {\n margin: 0;\n font-size: 24px;\n font-weight: 600;\n color: #333;\n }\n \n .breadcrumb-item {\n font-size: 14px;\n color: #666;\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 4px;\n }\n }\n }\n \n .header-controls {\n display: flex;\n gap: 8px;\n \n .control-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 12px;\n background: white;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n color: #666;\n font-size: 12px;\n cursor: pointer;\n transition: all 0.2s;\n \n &:hover {\n background: #f8f9fa;\n border-color: #2196f3;\n color: #2196f3;\n }\n \n &.active {\n background: #2196f3;\n border-color: #2196f3;\n color: white;\n }\n }\n }\n}\n\n// Tab Navigation\n.tab-navigation {\n background: white;\n border-bottom: 1px solid #e0e0e0;\n padding: 0 20px;\n display: flex;\n gap: 2px;\n flex-shrink: 0;\n \n .tab-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px;\n background: none;\n border: none;\n border-bottom: 3px solid transparent;\n color: #666;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n \n &:hover {\n color: #2196f3;\n background: #f8f9fa;\n }\n \n &.active {\n color: #2196f3;\n border-bottom-color: #2196f3;\n background: #f8f9fa;\n }\n \n i {\n font-size: 16px;\n }\n }\n}\n\n.tab-content {\n flex: 1;\n overflow: hidden;\n}\n\n.loading-container, .error-container {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n \n .loading-content, .error-content {\n text-align: center;\n \n .loading-spinner {\n position: relative;\n width: 60px;\n height: 60px;\n margin: 0 auto 20px;\n }\n \n .spinner-ring {\n position: absolute;\n width: 100%;\n height: 100%;\n border: 3px solid transparent;\n border-radius: 50%;\n animation: spin 1.5s linear infinite;\n \n &:nth-child(1) {\n border-top-color: #2196f3;\n animation-delay: 0s;\n }\n \n &:nth-child(2) {\n border-top-color: #9c27b0;\n animation-delay: 0.3s;\n transform: scale(0.8);\n }\n \n &:nth-child(3) {\n border-top-color: #ff6b35;\n animation-delay: 0.6s;\n transform: scale(0.6);\n }\n }\n \n .loading-text {\n font-size: 16px;\n color: #666;\n }\n \n i {\n font-size: 48px;\n color: #dc3545;\n margin-bottom: 16px;\n }\n \n h3 {\n margin: 0 0 8px 0;\n color: #333;\n }\n \n p {\n margin: 0 0 16px 0;\n color: #666;\n }\n \n .retry-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n background: #dc3545;\n border: none;\n border-radius: 4px;\n color: white;\n cursor: pointer;\n \n &:hover {\n background: #c82333;\n }\n }\n }\n}\n\n.editor-content {\n flex: 1;\n overflow: hidden;\n}\n\n.main-splitter, .bottom-splitter {\n height: 100%;\n \n .k-pane {\n overflow: hidden;\n }\n}\n\n// Hierarchy Section\n.hierarchy-section {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: white;\n \n .section-header {\n padding: 16px 20px;\n border-bottom: 1px solid #f0f0f0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: #333;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n \n .hierarchy-controls {\n display: flex;\n align-items: center;\n gap: 20px;\n \n .zoom-controls {\n display: flex;\n gap: 4px;\n \n .zoom-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n background: white;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n color: #666;\n cursor: pointer;\n transition: all 0.2s;\n \n &:hover {\n background: #f8f9fa;\n border-color: #2196f3;\n color: #2196f3;\n }\n \n i {\n font-size: 12px;\n }\n }\n }\n \n .hierarchy-legend {\n display: flex;\n gap: 16px;\n \n .legend-item {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n color: #666;\n \n .legend-rect {\n width: 20px;\n height: 12px;\n border-radius: 2px;\n border: 1px solid;\n \n &.level-0 {\n background: #1976d2;\n border-color: #1565c0;\n }\n \n &.level-1 {\n background: #388e3c;\n border-color: #2e7d32;\n }\n \n &.level-2 {\n background: #f57c00;\n border-color: #ef6c00;\n }\n }\n }\n }\n }\n }\n \n .hierarchy-chart {\n flex: 1;\n min-height: 300px;\n overflow: hidden;\n position: relative;\n \n .chart-help {\n position: absolute;\n bottom: 10px;\n left: 10px;\n background: rgba(255, 255, 255, 0.9);\n padding: 6px 10px;\n border-radius: 4px;\n border: 1px solid #e0e0e0;\n z-index: 10;\n \n small {\n font-size: 11px;\n color: #666;\n display: flex;\n align-items: center;\n gap: 6px;\n \n i {\n color: #2196f3;\n }\n }\n }\n \n .empty-hierarchy {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 40px 20px;\n text-align: center;\n color: #666;\n \n i {\n font-size: 64px;\n margin-bottom: 20px;\n opacity: 0.5;\n }\n \n h4 {\n margin: 0 0 12px 0;\n font-size: 18px;\n color: #333;\n }\n \n p {\n margin: 0 0 24px 0;\n font-size: 14px;\n color: #666;\n line-height: 1.5;\n }\n \n .create-subagent-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 20px;\n background: #2196f3;\n border: none;\n border-radius: 6px;\n color: white;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n \n &:hover {\n background: #1976d2;\n }\n }\n }\n }\n \n}\n\n// Prompts Section\n.prompts-section {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: white;\n border-right: 1px solid #f0f0f0;\n \n .section-header {\n padding: 16px 20px;\n border-bottom: 1px solid #f0f0f0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: #333;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n \n .add-prompt-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n background: #2196f3;\n border: none;\n border-radius: 4px;\n color: white;\n font-size: 12px;\n cursor: pointer;\n \n &:hover {\n background: #1976d2;\n }\n }\n }\n \n .prompts-list {\n flex: 1;\n overflow-y: auto;\n padding: 16px 20px;\n \n .empty-prompts {\n text-align: center;\n padding: 40px 20px;\n color: #666;\n \n i {\n font-size: 48px;\n margin-bottom: 16px;\n }\n \n p {\n margin: 0 0 20px 0;\n font-size: 14px;\n }\n \n .add-first-prompt-btn {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n background: #2196f3;\n border: none;\n border-radius: 4px;\n color: white;\n cursor: pointer;\n \n &:hover {\n background: #1976d2;\n }\n }\n }\n \n .prompt-card {\n background: #f8f9fa;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n margin-bottom: 12px;\n \n .prompt-header {\n padding: 12px 16px;\n border-bottom: 1px solid #e9ecef;\n display: flex;\n justify-content: space-between;\n align-items: center;\n \n .prompt-info {\n h4 {\n margin: 0 0 4px 0;\n font-size: 14px;\n font-weight: 600;\n color: #333;\n }\n \n .prompt-type {\n font-size: 11px;\n padding: 2px 6px;\n background: #007bff;\n color: white;\n border-radius: 3px;\n text-transform: uppercase;\n }\n }\n \n .prompt-actions {\n display: flex;\n gap: 4px;\n \n .action-btn {\n padding: 4px 8px;\n background: none;\n border: 1px solid #e0e0e0;\n border-radius: 3px;\n color: #666;\n cursor: pointer;\n font-size: 12px;\n \n &:hover {\n background: #f0f0f0;\n border-color: #ccc;\n }\n \n &.danger:hover {\n background: #dc3545;\n border-color: #dc3545;\n color: white;\n }\n }\n }\n }\n \n .prompt-content {\n padding: 12px 16px;\n \n p {\n margin: 0;\n font-size: 12px;\n color: #666;\n line-height: 1.4;\n }\n }\n }\n }\n}\n\n// Properties Section\n.properties-section {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: white;\n \n .section-header {\n padding: 16px 20px;\n border-bottom: 1px solid #f0f0f0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: #333;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n \n .save-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n background: #28a745;\n border: none;\n border-radius: 4px;\n color: white;\n font-size: 12px;\n cursor: pointer;\n \n &:hover {\n background: #218838;\n }\n }\n }\n \n .properties-form {\n flex: 1;\n overflow-y: auto;\n padding: 20px;\n \n .form-group {\n margin-bottom: 16px;\n \n label {\n display: block;\n font-size: 12px;\n font-weight: 600;\n color: #333;\n margin-bottom: 4px;\n }\n \n .form-input, .form-select, .form-textarea {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #ddd;\n border-radius: 4px;\n font-size: 13px;\n background: white;\n box-sizing: border-box;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n }\n \n .form-textarea {\n resize: vertical;\n min-height: 60px;\n }\n \n &.checkbox-group {\n .checkbox-label {\n display: flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n \n input[type=\"checkbox\"] {\n width: auto;\n margin: 0;\n }\n }\n \n small {\n display: block;\n font-size: 11px;\n color: #666;\n margin-top: 4px;\n margin-left: 24px;\n }\n }\n }\n \n .form-row {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n }\n }\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n// Sub-Agent Creation Modal\n.modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100vw;\n height: 100vh;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n padding: 20px;\n box-sizing: border-box;\n}\n\n.create-subagent-modal {\n background: white;\n border-radius: 8px;\n width: 100%;\n max-width: 500px;\n max-height: calc(100vh - 40px);\n min-height: 300px;\n display: flex;\n flex-direction: column;\n box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);\n position: relative;\n \n .modal-header {\n padding: 20px 24px;\n border-bottom: 1px solid #e9ecef;\n display: flex;\n justify-content: space-between;\n align-items: center;\n \n h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: #333;\n display: flex;\n align-items: center;\n gap: 10px;\n }\n \n .close-btn {\n background: none;\n border: none;\n padding: 8px;\n cursor: pointer;\n color: #666;\n border-radius: 4px;\n \n &:hover {\n background: #f8f9fa;\n color: #333;\n }\n }\n }\n \n .modal-body {\n padding: 24px;\n flex: 1;\n overflow-y: auto;\n \n .error-message {\n background: #f8d7da;\n border: 1px solid #f5c6cb;\n border-radius: 6px;\n padding: 12px;\n margin-bottom: 20px;\n color: #721c24;\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 8px;\n \n i {\n color: #dc3545;\n }\n }\n \n .form-group {\n margin-bottom: 20px;\n \n label {\n display: block;\n font-size: 14px;\n font-weight: 600;\n color: #333;\n margin-bottom: 8px;\n }\n \n .form-input, .form-textarea {\n width: 100%;\n padding: 12px;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n background: white;\n box-sizing: border-box;\n transition: border-color 0.2s;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n \n &::placeholder {\n color: #999;\n }\n }\n \n .form-textarea {\n resize: vertical;\n min-height: 80px;\n font-family: inherit;\n }\n }\n \n .parent-info {\n background: #f8f9fa;\n border: 1px solid #e9ecef;\n border-radius: 6px;\n padding: 12px;\n font-size: 14px;\n color: #666;\n \n strong {\n color: #333;\n }\n }\n }\n \n .modal-footer {\n padding: 20px 24px;\n border-top: 1px solid #e9ecef;\n display: flex;\n justify-content: flex-end;\n gap: 12px;\n \n .cancel-btn, .create-btn {\n padding: 10px 20px;\n border: 1px solid;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n \n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n }\n \n .cancel-btn {\n background: white;\n border-color: #ddd;\n color: #666;\n \n &:hover:not(:disabled) {\n background: #f8f9fa;\n border-color: #ccc;\n }\n }\n \n .create-btn {\n background: #2196f3;\n border-color: #2196f3;\n color: white;\n display: flex;\n align-items: center;\n gap: 8px;\n \n &:hover:not(:disabled) {\n background: #1976d2;\n border-color: #1976d2;\n }\n \n .loading-spinner-sm {\n width: 14px;\n height: 14px;\n border: 2px solid transparent;\n border-top-color: currentColor;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n }\n }\n}"] }]
|
|
858
|
+
}], null, { agentId: [{
|
|
859
|
+
type: Input
|
|
860
|
+
}], close: [{
|
|
861
|
+
type: Output
|
|
862
|
+
}], openAgent: [{
|
|
863
|
+
type: Output
|
|
864
|
+
}], hierarchyChartRef: [{
|
|
865
|
+
type: ViewChild,
|
|
866
|
+
args: ['hierarchyChart', { static: false }]
|
|
867
|
+
}] }); })();
|
|
868
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AgentEditorComponent, { className: "AgentEditorComponent", filePath: "src/AI/components/agents/agent-editor.component.ts", lineNumber: 28 }); })();
|
|
869
|
+
//# sourceMappingURL=agent-editor.component.js.map
|