@@ -4,15 +4,14 @@ import { useState, useEffect, useRef } from 'react'
44import { useTranslation } from 'react-i18next'
55import BusinessLogicConfig from './components/AgentManagementConfig'
66import DebugConfig from './components/DebugConfig'
7- import GuideSteps from './components/GuideSteps'
8- import { Row , Col , Drawer , App } from 'antd'
7+
8+ import { Drawer , App } from 'antd'
99import { fetchTools , fetchAgentList , exportAgent , deleteAgent } from '@/services/agentConfigService'
1010import { generatePromptStream } from '@/services/promptService'
1111import { OpenAIModel } from '@/types/agent'
1212import { updateToolList } from '@/services/mcpService'
1313import {
1414 SETUP_PAGE_CONTAINER ,
15- THREE_COLUMN_LAYOUT ,
1615 STANDARD_CARD ,
1716} from '@/lib/layoutConstants'
1817import '../../i18n'
@@ -26,12 +25,13 @@ const LAYOUT_CONFIG = {
2625
2726/**
2827 * Agent configuration main component
28+ * Provides a full-width interface for agent business logic configuration
29+ * Follows SETUP_PAGE_CONTAINER layout standards for consistent height and spacing
2930 */
3031export default function AgentConfig ( ) {
3132 const { t } = useTranslation ( 'common' )
3233 const { message } = App . useApp ( )
3334 const [ businessLogic , setBusinessLogic ] = useState ( "" )
34- const [ systemPrompt , setSystemPrompt ] = useState ( "" )
3535 const [ selectedTools , setSelectedTools ] = useState < any [ ] > ( [ ] )
3636 const [ isDebugDrawerOpen , setIsDebugDrawerOpen ] = useState ( false )
3737 const [ isCreatingNewAgent , setIsCreatingNewAgent ] = useState ( false )
@@ -43,7 +43,7 @@ export default function AgentConfig() {
4343 const [ loadingAgents , setLoadingAgents ] = useState ( false )
4444
4545 const [ enabledAgentIds , setEnabledAgentIds ] = useState < number [ ] > ( [ ] )
46- const [ currentGuideStep , setCurrentGuideStep ] = useState < number | undefined > ( undefined )
46+
4747 const [ isEditingAgent , setIsEditingAgent ] = useState ( false )
4848 const [ editingAgent , setEditingAgent ] = useState < any > ( null )
4949
@@ -335,9 +335,7 @@ export default function AgentConfig() {
335335 }
336336
337337 // Always reset these states regardless of creation mode
338- setSystemPrompt ( '' ) ;
339338 setSelectedTools ( [ ] ) ;
340- setCurrentGuideStep ( undefined ) ;
341339
342340 // Reset the main agent configuration related status
343341 if ( ! isCreatingNewAgent ) {
@@ -441,47 +439,16 @@ export default function AgentConfig() {
441439
442440 return (
443441 < App >
444- < div className = "w-full h-full mx-auto" style = { {
442+ < div className = "w-full mx-auto" style = { {
445443 maxWidth : SETUP_PAGE_CONTAINER . MAX_WIDTH ,
446- padding : `0 ${ SETUP_PAGE_CONTAINER . HORIZONTAL_PADDING } `
444+ height : SETUP_PAGE_CONTAINER . MAIN_CONTENT_HEIGHT
447445 } } >
448- < div className = "w-full h-full" >
449- < Row gutter = { THREE_COLUMN_LAYOUT . GUTTER } className = "h-full" >
450- { /* Left Timeline Guide */ }
451- < Col xs = { 24 } md = { 24 } lg = { 4 } xl = { 4 } className = "h-full" >
452- < div className = "bg-white border border-gray-200 rounded-md flex flex-col overflow-hidden h-[300px] lg:h-[82vh]" style = { {
453- padding : STANDARD_CARD . PADDING ,
454- overflowY : "auto" ,
455- overflowX : "hidden"
456- } } >
457- < GuideSteps
458- isCreatingNewAgent = { isCreatingNewAgent }
459- systemPrompt = { systemPrompt }
460- businessLogic = { businessLogic }
461- selectedTools = { selectedTools }
462- currentStep = { currentGuideStep }
463- isEditingAgent = { isEditingAgent }
464- dutyContent = { dutyContent }
465- constraintContent = { constraintContent }
466- fewShotsContent = { fewShotsContent }
467- enabledAgentIds = { enabledAgentIds }
468- />
469- </ div >
470- </ Col >
471-
472- { /* Middle and Right Panel Container */ }
473- < Col xs = { 24 } md = { 24 } lg = { 20 } xl = { 20 } >
474- < div className = "bg-white border border-gray-200 rounded-md flex flex-col overflow-hidden h-[calc(100vh-200px)] lg:h-[82vh]" style = { {
475- overflowY : "auto" ,
476- overflowX : "hidden"
477- } } >
478- { /* Middle Panel - Business Logic Configuration */ }
479- < div className = "flex-1 min-h-0" style = { {
480- padding : STANDARD_CARD . PADDING ,
481- overflowY : "auto" ,
482- overflowX : "hidden"
483- } } >
484- < BusinessLogicConfig
446+ < div className = { STANDARD_CARD . BASE_CLASSES } style = { {
447+ height : "100%" ,
448+ ...STANDARD_CARD . CONTENT_SCROLL
449+ } } >
450+ < div style = { { padding : STANDARD_CARD . PADDING , height : "100%" } } >
451+ < BusinessLogicConfig
485452 businessLogic = { businessLogic }
486453 setBusinessLogic = { ( value ) => {
487454 setBusinessLogic ( value ) ;
@@ -491,7 +458,6 @@ export default function AgentConfig() {
491458 } }
492459 selectedTools = { selectedTools }
493460 setSelectedTools = { setSelectedTools }
494- setSystemPrompt = { setSystemPrompt }
495461 isCreatingNewAgent = { isCreatingNewAgent }
496462 setIsCreatingNewAgent = { setIsCreatingNewAgent }
497463 mainAgentModel = { mainAgentModel }
@@ -554,7 +520,6 @@ export default function AgentConfig() {
554520 // SystemPromptDisplay related props
555521 onDebug = { ( ) => {
556522 setIsDebugDrawerOpen ( true ) ;
557- setCurrentGuideStep ( isCreatingNewAgent ? 5 : 5 ) ;
558523 } }
559524 getCurrentAgentId = { getCurrentAgentId }
560525 onGenerateAgent = { handleGenerateAgent }
@@ -563,34 +528,31 @@ export default function AgentConfig() {
563528 editingAgent = { editingAgent }
564529 onExitCreation = { handleExitCreation }
565530 />
566- </ div >
567- </ div >
568- </ Col >
569- </ Row >
570- </ div >
571-
572- { /* Commissioning drawer */ }
573- < Drawer
574- title = { t ( 'agent.debug.title' ) }
575- placement = "right"
576- onClose = { ( ) => setIsDebugDrawerOpen ( false ) }
577- open = { isDebugDrawerOpen }
578- width = { LAYOUT_CONFIG . DRAWER_WIDTH }
579- styles = { {
580- body : {
581- padding : 0 ,
582- height : '100%' ,
583- overflow : 'hidden'
584- }
585- } }
586- >
587- < div className = "h-full" >
588- < DebugConfig
589- agentId = { getCurrentAgentId ( ) }
590- />
591531 </ div >
592- </ Drawer >
532+ </ div >
593533 </ div >
534+
535+ { /* Commissioning drawer */ }
536+ < Drawer
537+ title = { t ( 'agent.debug.title' ) }
538+ placement = "right"
539+ onClose = { ( ) => setIsDebugDrawerOpen ( false ) }
540+ open = { isDebugDrawerOpen }
541+ width = { LAYOUT_CONFIG . DRAWER_WIDTH }
542+ styles = { {
543+ body : {
544+ padding : 0 ,
545+ height : '100%' ,
546+ overflow : 'hidden'
547+ }
548+ } }
549+ >
550+ < div className = "h-full" >
551+ < DebugConfig
552+ agentId = { getCurrentAgentId ( ) }
553+ />
554+ </ div >
555+ </ Drawer >
594556 </ App >
595557 )
596558}
0 commit comments