77 import Breadcrumb from ' $lib/common/Breadcrumb.svelte' ;
88 import HeadTitle from ' $lib/common/HeadTitle.svelte' ;
99 import LoadingToComplete from ' $lib/common/LoadingToComplete.svelte' ;
10- import AgentPrompt from ' ./agent-prompt.svelte' ;
11- import AgentOverview from ' ./agent-overview.svelte' ;
12- import AgentRouting from ' ./agent-routing.svelte' ;
13- import AgentFunction from ' ./agent-function.svelte' ;
14- import AgentLlmConfig from ' ./agent-llm-config.svelte' ;
10+ import AgentPrompt from ' ./agent-components/agent-prompt.svelte' ;
11+ import AgentOverview from ' ./agent-components/agent-overview.svelte' ;
12+ import AgentFunction from ' ./agent-components/agent-function.svelte' ;
13+ import AgentTabs from ' ./agent-tabs.svelte' ;
1514 import { page } from ' $app/stores' ;
1615 import { deleteAgent , getAgent , saveAgent } from ' $lib/services/agent-service.js' ;
1716 import { onMount } from ' svelte' ;
1817 import { _ } from ' svelte-i18n'
1918 import Swal from ' sweetalert2'
2019 import { goto } from ' $app/navigation' ;
21- import AgentUtility from ' ./agent-utility.svelte' ;
22- import AgentKnowledgeBase from ' ./agent-knowledge-base.svelte' ;
2320 import { AgentExtensions } from ' $lib/helpers/utils/agent' ;
2421
2522
3027 /** @type {any} */
3128 let agentPromptCmp = null ;
3229 /** @type {any} */
33- let agentUtilityCmp = null ;
34- /** @type {any} */
35- let agentKnowledgeBaseCmp = null ;
30+ let agentTabsCmp = null ;
3631
3732 /** @type {boolean} */
3833 let isLoading = false ;
7267 function handleAgentUpdate () {
7368 fetchJsonContent ();
7469 fetchPrompts ();
75- fetchUtilties ();
76- fetchKnowledgeBases ();
70+ fetchTabData ();
7771
7872 agent = {
7973 ... agent,
8377 profiles: agent .profiles ? .filter ((x , idx , self ) => x? .trim ()? .length > 0 && self .indexOf (x) === idx) || [],
8478 utilities: agent .utilities || [],
8579 knowledge_bases: agent .knowledge_bases || [],
80+ event_rules: agent .event_rules || [],
8681 max_message_count: Number (agent .max_message_count ) > 0 ? Number (agent .max_message_count ) : null
8782 };
8883 isLoading = true ;
121116 agent .channel_instructions = obj .channelPrompts || [];
122117 }
123118
124- function fetchUtilties () {
125- const list = agentUtilityCmp? .fetchUtilities ();
126- agent .utilities = list || [];
127- }
128-
129- function fetchKnowledgeBases () {
130- const list = agentKnowledgeBaseCmp? .fetchKnowledgeBases ();
131- agent .knowledge_bases = list || [];
119+ function fetchTabData () {
120+ const data = agentTabsCmp? .fetchData ();
121+ if (data) {
122+ agent .utilities = data .utilities || [];
123+ agent .knowledge_bases = data .knwoledgebases || [];
124+ agent .event_rules = data .eventRules || [];
125+ }
132126 }
133127
134128 function refreshChannelPrompts () {
163157< LoadingToComplete isLoading= {isLoading} isComplete= {isComplete} isError= {isError} / >
164158
165159{#if agent}
160+ < div>
166161 < Row class = " agent-detail-sections" >
167- < Col class = " section-min-width agent-overview " style= " flex: 35 %;" >
162+ < Col class = " section-min-width agent-col " style= " flex: 40 %;" >
168163 < div class = " agent-detail-section" >
169164 < AgentOverview agent= {agent} profiles= {agent .profiles || []} / >
170165 < / div>
171166 < div class = " agent-detail-section" >
172- < AgentLlmConfig agent= {agent} / >
173- {#if agent .routing_rules ? .length > 0 }
174- < AgentRouting agent= {agent} / >
175- {/ if }
176- < / div>
177- < div class = " agent-detail-section" >
178- < AgentUtility bind: this = {agentUtilityCmp} agent= {agent} / >
179- < / div>
180- < div class = " agent-detail-section" >
181- < AgentKnowledgeBase bind: this = {agentKnowledgeBaseCmp} agent= {agent} / >
167+ < AgentTabs bind: this = {agentTabsCmp} agent= {agent} / >
182168 < / div>
183169 < / Col>
184- < Col class = " section-min-width" style= " flex: 65 %;" >
170+ < Col class = " section-min-width agent-col " style= " flex: 60 %;" >
185171 < div class = " agent-detail-section" >
186172 < AgentPrompt bind: this = {agentPromptCmp} agent= {agent} / >
187173 < / div>
199185 < / div>
200186 < / Row>
201187 {/ if }
188+ < / div>
202189{/ if }
0 commit comments