@@ -2,11 +2,7 @@ import { useEffect, useState } from 'react';
22import { PhaserGame } from './game/PhaserGame' ;
33import { EventBus } from './game/EventBus' ;
44import DraggableWindow from './components/DraggableWindow' ;
5- import { testGraphChain } from './langgraph/testLanggraph' ;
65import { marked } from 'marked' ;
7- import { generateChartImage } from './langgraph/visualizationGenerate' ;
8- import { TEST_D3_SCRIPT } from './langgraph/const' ;
9- import ConstitutionPanel from './components/ConstitutionPanel' ;
106
117export interface Report {
128 report : string ,
@@ -57,25 +53,6 @@ function App()
5753 } ;
5854
5955
60- const handleAgentInformation = ( data : { agent : string , mssg : string } ) => {
61- console . log ( "Agent information received" , data . agent , data . mssg ) ;
62- const curReport :AgentInformation = {
63- mssg : data . mssg ,
64- agent : data . agent ,
65- }
66- // check if the report'department is already in the list, if yes, update the report; if no, add the report
67- const index = agentProfiles . findIndex ( ( r ) => r . agent === data . agent ) ;
68- if ( index !== - 1 ) {
69- agentProfiles [ index ] = curReport ;
70- setAgentProfiles ( [ ...agentProfiles ] ) ;
71- } else {
72- agentProfiles . push ( curReport ) ;
73- setAgentProfiles ( [ ...agentProfiles ] ) ;
74- }
75-
76- console . log ( "agentProfiles" , agentProfiles ) ;
77- }
78-
7956 const handleAgentInformation = ( data : { agent : string , mssg : string } ) => {
8057 console . log ( "Agent information received" , data . agent , data . mssg ) ;
8158 const curReport :AgentInformation = {
@@ -138,46 +115,6 @@ function App()
138115
139116
140117
141-
142- const handleAgentInformationOpen = ( data : { agent : string } ) => {
143- const index = agentProfiles . findIndex ( ( r ) => r . agent === data . agent ) ;
144- if ( index !== - 1 ) {
145- setCurrentReport ( agentProfiles [ index ] . mssg ) ;
146-
147- marked . use ( {
148- extensions : [
149- {
150- name : 'highlight' ,
151- level : 'inline' ,
152- start ( src ) { return src . indexOf ( "==" ) ; } ,
153- tokenizer ( src , tokens ) {
154- const rule = / ^ = = ( [ ^ = ] + ) = = / ;
155- const match = rule . exec ( src ) ;
156- if ( match ) {
157- return {
158- type : 'highlight' ,
159- raw : match [ 0 ] ,
160- text : match [ 1 ] ,
161- tokens : this . lexer . inlineTokens ( match [ 1 ] ) ,
162- } ;
163- }
164- } ,
165- renderer ( token : any ) {
166- return `<mark>${ marked . parser ( token . tokens ) } </mark>` ;
167- } ,
168- } ,
169- ] ,
170- } ) ;
171-
172- console . log ( "agentProfiles[index].mssg" , agentProfiles [ index ] . mssg ) ;
173-
174- setHtmlReport ( agentProfiles [ index ] . mssg ) ;
175- if ( ! isOpen ) setIsOpen ( true ) ;
176- }
177- }
178-
179-
180-
181118 const handleAgentInformationOpen = ( data : { agent : string } ) => {
182119 const index = agentProfiles . findIndex ( ( r ) => r . agent === data . agent ) ;
183120 if ( index !== - 1 ) {
0 commit comments