Amir Mahla commited on
Commit
13eda1d
·
1 Parent(s): 304e233

REMOVE unused code

Browse files
cua2-front/src/component/poc/ConnectionStatus.tsx DELETED
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
-
3
- interface ConnectionStatusProps {
4
- isConnected: boolean;
5
- }
6
-
7
- export const ConnectionStatus: React.FC<ConnectionStatusProps> = ({ isConnected }) => {
8
- return (
9
- <div style={{
10
- display: 'flex',
11
- alignItems: 'center',
12
- gap: '8px',
13
- backgroundColor: 'rgba(255, 255, 255, 0.2)',
14
- padding: '8px 16px',
15
- borderRadius: '20px',
16
- backdropFilter: 'blur(10px)',
17
- border: '1px solid rgba(255, 255, 255, 0.3)'
18
- }}>
19
- <div style={{
20
- width: '8px',
21
- height: '8px',
22
- borderRadius: '50%',
23
- backgroundColor: isConnected ? '#10b981' : '#ef4444',
24
- boxShadow: isConnected ? '0 0 8px #10b981' : '0 0 8px #ef4444',
25
- animation: isConnected ? 'pulse 2s infinite' : 'none'
26
- }}></div>
27
- <div style={{ display: 'flex', flexDirection: 'column' }}>
28
- <span className="text-xs font-semibold text-white" style={{ lineHeight: '1.2' }}>
29
- {isConnected ? 'Connected' : 'Disconnected'}
30
- </span>
31
- <span className="text-xs text-white" style={{ opacity: 0.7, fontSize: '10px', lineHeight: '1.2' }}>
32
- WebSocket
33
- </span>
34
- </div>
35
- </div>
36
- );
37
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cua2-front/src/component/poc/Header.tsx DELETED
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import { ConnectionStatus } from './ConnectionStatus';
3
- import { ProcessingIndicator } from './ProcessingIndicator';
4
- import { TaskButton } from './TaskButton';
5
-
6
- interface HeaderProps {
7
- isConnected: boolean;
8
- isAgentProcessing: boolean;
9
- onSendTask: (content: string, modelId: string) => void;
10
- }
11
-
12
- export const Header: React.FC<HeaderProps> = ({ isConnected, isAgentProcessing, onSendTask }) => {
13
- return (
14
- <>
15
- <div style={{
16
- flexShrink: 0,
17
- }}>
18
- <div style={{ maxWidth: '1400px', margin: '0 auto', padding: '20px 32px' }}>
19
- <div className="flex items-center justify-between">
20
- <div className="flex items-center gap-6">
21
- <ConnectionStatus isConnected={isConnected} />
22
- <h1 className="text-3xl font-bold text-white" style={{ textShadow: '0 2px 4px rgba(0, 0, 0, 0.2)' }}>
23
- CUA2 Agent
24
- </h1>
25
- </div>
26
- <ProcessingIndicator isAgentProcessing={isAgentProcessing} />
27
- </div>
28
- <TaskButton
29
- isAgentProcessing={isAgentProcessing}
30
- isConnected={isConnected}
31
- onSendTask={onSendTask}
32
- />
33
- </div>
34
- </div>
35
-
36
- <style>{`
37
- @keyframes spin {
38
- to { transform: rotate(360deg); }
39
- }
40
- @keyframes pulse {
41
- 0%, 100% { opacity: 1; }
42
- 50% { opacity: 0.5; }
43
- }
44
- `}</style>
45
- </>
46
- );
47
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cua2-front/src/component/poc/Metadata.tsx DELETED
@@ -1,38 +0,0 @@
1
- import { AgentTrace } from '@/types/agent';
2
- import React from 'react';
3
-
4
- interface MetadataProps {
5
- trace?: AgentTrace;
6
- }
7
-
8
- export const Metadata: React.FC<MetadataProps> = ({ trace }) => {
9
- return (
10
- <div style={{ flexShrink: 0 }} className="bg-white rounded-lg shadow-md border border-gray-200 p-5">
11
- <h3 className="text-lg font-semibold text-gray-800 mb-4">Metadata</h3>
12
- {trace?.metadata ? (
13
- <div style={{ display: 'flex', gap: '12px' }}>
14
- <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', backgroundColor: '#eff6ff', borderRadius: '8px', padding: '12px', border: '1px solid #bfdbfe', boxShadow: '0 2px 4px rgba(59, 130, 246, 0.1)' }}>
15
- <span style={{ fontSize: '10px', fontWeight: 600, color: '#2563eb', textTransform: 'uppercase', letterSpacing: '0.8px', marginBottom: '6px' }}>Total Time</span>
16
- <span style={{ fontSize: '24px', fontWeight: 700, color: '#1e40af' }}>{trace.metadata.duration.toFixed(2)}s</span>
17
- </div>
18
- <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', backgroundColor: '#f0fdf4', borderRadius: '8px', padding: '12px', border: '1px solid #bbf7d0', boxShadow: '0 2px 4px rgba(16, 185, 129, 0.1)' }}>
19
- <span style={{ fontSize: '10px', fontWeight: 600, color: '#059669', textTransform: 'uppercase', letterSpacing: '0.8px', marginBottom: '6px' }}>In Tokens</span>
20
- <span style={{ fontSize: '24px', fontWeight: 700, color: '#166534' }}>{trace.metadata.inputTokensUsed.toLocaleString()}</span>
21
- </div>
22
- <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', backgroundColor: '#faf5ff', borderRadius: '8px', padding: '12px', border: '1px solid #e9d5ff', boxShadow: '0 2px 4px rgba(139, 92, 246, 0.1)' }}>
23
- <span style={{ fontSize: '10px', fontWeight: 600, color: '#9333ea', textTransform: 'uppercase', letterSpacing: '0.8px', marginBottom: '6px' }}>Out Tokens</span>
24
- <span style={{ fontSize: '24px', fontWeight: 700, color: '#6b21a8' }}>{trace.metadata.outputTokensUsed.toLocaleString()}</span>
25
- </div>
26
- <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', backgroundColor: '#fff7ed', borderRadius: '8px', padding: '12px', border: '1px solid #fed7aa', boxShadow: '0 2px 4px rgba(249, 115, 22, 0.1)' }}>
27
- <span style={{ fontSize: '10px', fontWeight: 600, color: '#ea580c', textTransform: 'uppercase', letterSpacing: '0.8px', marginBottom: '6px' }}>Total Steps</span>
28
- <span style={{ fontSize: '24px', fontWeight: 700, color: '#c2410c' }}>{trace.metadata.numberOfSteps}</span>
29
- </div>
30
- </div>
31
- ) : (
32
- <div className="text-gray-400 text-sm py-2">
33
- {trace ? 'Waiting for completion...' : 'No task started yet'}
34
- </div>
35
- )}
36
- </div>
37
- );
38
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cua2-front/src/component/poc/ProcessingIndicator.tsx DELETED
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
-
3
- interface ProcessingIndicatorProps {
4
- isAgentProcessing: boolean;
5
- }
6
-
7
- export const ProcessingIndicator: React.FC<ProcessingIndicatorProps> = ({ isAgentProcessing }) => {
8
- if (!isAgentProcessing) return null;
9
-
10
- return (
11
- <div style={{
12
- display: 'flex',
13
- alignItems: 'center',
14
- gap: '10px',
15
- padding: '10px 20px',
16
- backgroundColor: 'rgba(251, 191, 36, 0.2)',
17
- borderRadius: '10px',
18
- border: '1px solid rgba(251, 191, 36, 0.4)'
19
- }}>
20
- <span style={{
21
- width: '16px',
22
- height: '16px',
23
- border: '2px solid #fbbf24',
24
- borderTopColor: 'transparent',
25
- borderRadius: '50%',
26
- animation: 'spin 1s linear infinite',
27
- display: 'inline-block'
28
- }}></span>
29
- <span style={{ fontSize: '14px', fontWeight: 600, color: '#fbbf24', letterSpacing: '0.5px' }}>
30
- PROCESSING...
31
- </span>
32
- </div>
33
- );
34
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cua2-front/src/component/poc/StackSteps.tsx DELETED
@@ -1,29 +0,0 @@
1
- import { AgentTrace } from '@/types/agent';
2
- import React from 'react';
3
- import { StepCard } from './StepCard';
4
-
5
- interface StackStepsProps {
6
- trace?: AgentTrace;
7
- }
8
-
9
- export const StackSteps: React.FC<StackStepsProps> = ({ trace }) => {
10
- return (
11
- <div style={{ width: '360px', flexShrink: 0, display: 'flex', flexDirection: 'column', backgroundColor: 'white', borderRadius: '10px', marginLeft: '12px', marginTop: '20px', marginBottom: '20px', boxShadow: '0 2px 12px rgba(0, 0, 0, 0.08)', border: '1px solid #e5e7eb' }}>
12
- <h3 className="text-lg font-semibold text-gray-800 mb-4">Stack Steps</h3>
13
- <div style={{ flex: 1, overflowY: 'auto', minHeight: 0, padding: '16px' }}>
14
- {trace?.steps && trace.steps.length > 0 ? (
15
- <div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
16
- {trace.steps.map((step, index) => (
17
- <StepCard key={step.stepId} step={step} index={index} />
18
- ))}
19
- </div>
20
- ) : (
21
- <div className="flex flex-col items-center justify-center h-full text-gray-400 p-6 text-center">
22
- <p className="font-medium">No steps yet</p>
23
- <p className="text-xs mt-1">Steps will appear as agent progresses</p>
24
- </div>
25
- )}
26
- </div>
27
- </div>
28
- );
29
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cua2-front/src/component/poc/StepCard.tsx DELETED
@@ -1,84 +0,0 @@
1
- import { AgentStep } from '@/types/agent';
2
- import React from 'react';
3
-
4
- interface StepCardProps {
5
- step: AgentStep;
6
- index: number;
7
- }
8
-
9
- export const StepCard: React.FC<StepCardProps> = ({ step, index }) => {
10
- return (
11
- <div
12
- key={step.stepId}
13
- style={{ backgroundColor: '#f9fafb', borderRadius: '8px', border: '1px solid #d1d5db', padding: '12px', boxShadow: '0 1px 3px rgba(0, 0, 0, 0.1)' }}
14
- className="hover:border-blue-400 transition-all"
15
- >
16
- {/* Step Header */}
17
- <div className="mb-6">
18
- <span className="text-xs font-bold text-blue-600 uppercase tracking-wide">Step {index + 1}</span>
19
- <hr style={{ margin: '12px 0', border: 'none', borderTop: '2px solid #d1d5db' }} />
20
- </div>
21
-
22
- {/* Step Image */}
23
- {step.image && (
24
- <div className="mb-6">
25
- <div className="rounded-md overflow-hidden border border-gray-300 bg-white" style={{ maxHeight: '140px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
26
- <img
27
- src={step.image}
28
- alt={`Step ${index + 1}`}
29
- style={{ width: '100%', height: 'auto', maxHeight: '140px', objectFit: 'contain' }}
30
- />
31
- </div>
32
- <hr style={{ margin: '20px 0', border: 'none', borderTop: '1px solid #e5e7eb' }} />
33
- </div>
34
- )}
35
-
36
- {/* Thought */}
37
- <div className="mb-6">
38
- <div className="bg-white rounded-md p-2.5 border border-gray-200">
39
- <h4 className="text-xs font-semibold text-gray-700 mb-1.5 flex items-center gap-1">
40
- <span>💭</span>
41
- <span>Thought</span>
42
- </h4>
43
- <p className="text-xs text-gray-600 leading-relaxed">{step.thought}</p>
44
- </div>
45
- <hr style={{ margin: '20px 0', border: 'none', borderTop: '1px solid #e5e7eb' }} />
46
- </div>
47
-
48
- {/* Actions */}
49
- <div className="mb-6">
50
- <div className="bg-white rounded-md p-2.5 border border-gray-200">
51
- <h4 className="text-xs font-semibold text-gray-700 mb-1.5 flex items-center gap-1">
52
- <span>⚡</span>
53
- <span>Actions</span>
54
- </h4>
55
- <ul className="space-y-1" style={{ listStyle: 'none', padding: 0, margin: 0 }}>
56
- {step.actions.map((action, actionIndex) => (
57
- <li key={actionIndex} className="text-xs text-gray-600 flex items-start leading-snug">
58
- <span className="mr-1.5 text-blue-500 flex-shrink-0">→</span>
59
- <span className="break-words">{action}</span>
60
- </li>
61
- ))}
62
- </ul>
63
- </div>
64
- <hr style={{ margin: '20px 0', border: 'none', borderTop: '1px solid #e5e7eb' }} />
65
- </div>
66
-
67
- {/* Step Metadata Footer */}
68
- <div style={{ display: 'flex', alignItems: 'center', gap: '6px' }}>
69
- <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', backgroundColor: '#eff6ff', borderRadius: '6px', padding: '6px 8px', border: '1px solid #bfdbfe' }}>
70
- <span style={{ fontSize: '9px', fontWeight: 500, color: '#2563eb', textTransform: 'uppercase', letterSpacing: '0.5px' }}>Time</span>
71
- <span style={{ fontSize: '12px', fontWeight: 700, color: '#1e40af' }}>{step.duration.toFixed(2)}s</span>
72
- </div>
73
- <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', backgroundColor: '#f0fdf4', borderRadius: '6px', padding: '6px 8px', border: '1px solid #bbf7d0' }}>
74
- <span style={{ fontSize: '9px', fontWeight: 500, color: '#059669', textTransform: 'uppercase', letterSpacing: '0.5px' }}>In Tokens</span>
75
- <span style={{ fontSize: '12px', fontWeight: 700, color: '#166534' }}>{step.inputTokensUsed}</span>
76
- </div>
77
- <div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', backgroundColor: '#faf5ff', borderRadius: '6px', padding: '6px 8px', border: '1px solid #e9d5ff' }}>
78
- <span style={{ fontSize: '9px', fontWeight: 500, color: '#9333ea', textTransform: 'uppercase', letterSpacing: '0.5px' }}>Out Tokens</span>
79
- <span style={{ fontSize: '12px', fontWeight: 700, color: '#6b21a8' }}>{step.outputTokensUsed}</span>
80
- </div>
81
- </div>
82
- </div>
83
- );
84
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cua2-front/src/component/poc/TaskButton.tsx DELETED
@@ -1,76 +0,0 @@
1
- import React from 'react';
2
-
3
- interface TaskButtonProps {
4
- isAgentProcessing: boolean;
5
- isConnected: boolean;
6
- onSendTask: (content: string, modelId: string) => void;
7
- }
8
-
9
- export const TaskButton: React.FC<TaskButtonProps> = ({ isAgentProcessing, isConnected, onSendTask }) => {
10
- return (
11
- <div
12
- onClick={() => {
13
- if (!isAgentProcessing && isConnected) {
14
- onSendTask(
15
- "Complete the online form by clicking through the required fields",
16
- "anthropic/claude-sonnet-4-5-20250929"
17
- );
18
- }
19
- }}
20
- style={{
21
- marginTop: '16px',
22
- padding: '14px 18px',
23
- background: isAgentProcessing || !isConnected
24
- ? 'rgba(255, 255, 255, 0.1)'
25
- : 'rgba(255, 255, 255, 0.15)',
26
- borderRadius: '10px',
27
- backdropFilter: 'blur(10px)',
28
- border: '2px solid rgba(0, 0, 0, 0.3)',
29
- cursor: isAgentProcessing || !isConnected ? 'not-allowed' : 'pointer',
30
- transition: 'all 0.3s ease',
31
- opacity: isAgentProcessing || !isConnected ? 0.6 : 1,
32
- }}
33
- onMouseEnter={(e) => {
34
- if (!isAgentProcessing && isConnected) {
35
- e.currentTarget.style.background = 'rgba(200, 200, 200, 0.3)';
36
- e.currentTarget.style.borderColor = 'rgba(0, 0, 0, 0.5)';
37
- e.currentTarget.style.transform = 'translateY(-2px)';
38
- e.currentTarget.style.boxShadow = '0 6px 20px rgba(0, 0, 0, 0.2)';
39
- }
40
- }}
41
- onMouseLeave={(e) => {
42
- e.currentTarget.style.background = 'rgba(255, 255, 255, 0.15)';
43
- e.currentTarget.style.borderColor = 'rgba(0, 0, 0, 0.3)';
44
- e.currentTarget.style.transform = 'translateY(0)';
45
- e.currentTarget.style.boxShadow = 'none';
46
- }}
47
- >
48
- <div style={{ display: 'flex', gap: '24px', alignItems: 'center' }}>
49
- <div style={{ flex: 1 }}>
50
- <div style={{ display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '4px' }}>
51
- <span style={{ fontSize: '11px', fontWeight: 600, color: 'rgba(0, 0, 0, 0.7)', textTransform: 'uppercase', letterSpacing: '1px' }}>Task</span>
52
- {!isAgentProcessing && isConnected && (
53
- <span style={{ fontSize: '10px', color: 'rgba(0, 0, 0, 0.5)', fontStyle: 'italic' }}>
54
- (click to run)
55
- </span>
56
- )}
57
- </div>
58
- <p style={{ fontSize: '15px', fontWeight: 500, color: '#1f2937' }}>
59
- Complete the online form by clicking through the required fields
60
- </p>
61
- </div>
62
- <div style={{
63
- padding: '8px 16px',
64
- backgroundColor: 'rgba(0, 0, 0, 0.1)',
65
- borderRadius: '6px',
66
- border: '1px solid rgba(0, 0, 0, 0.2)'
67
- }}>
68
- <span style={{ fontSize: '11px', fontWeight: 600, color: 'rgba(0, 0, 0, 0.6)', textTransform: 'uppercase', letterSpacing: '1px' }}>Model</span>
69
- <p style={{ fontSize: '12px', fontWeight: 600, color: '#1f2937', marginTop: '2px', whiteSpace: 'nowrap' }}>
70
- claude-sonnet-4-5-20250929
71
- </p>
72
- </div>
73
- </div>
74
- </div>
75
- );
76
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cua2-front/src/component/poc/VNCStream.tsx DELETED
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
-
3
- interface VNCStreamProps {
4
- vncUrl: string;
5
- }
6
-
7
- export const VNCStream: React.FC<VNCStreamProps> = ({ vncUrl }) => {
8
- return (
9
- <div style={{ flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column', backgroundColor: 'white', borderRadius: '10px', boxShadow: '0 2px 8px rgba(0, 0, 0, 0.08)', border: '1px solid #e5e7eb', overflow: 'hidden', padding: '20px' }}>
10
- <h3 className="text-lg font-semibold text-gray-800 mb-4">VNC Stream</h3>
11
- <div style={{ flex: 1, minHeight: 0, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
12
- {vncUrl ? (
13
- <iframe
14
- src={vncUrl}
15
- style={{ width: '100%', height: '100%', border: 'none' }}
16
- title="VNC Stream"
17
- />
18
- ) : (
19
- <div className="text-gray-400 text-center p-8">
20
- <svg className="w-16 h-16 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
21
- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
22
- </svg>
23
- <p className="font-medium">No VNC stream available</p>
24
- <p className="text-sm mt-1 text-gray-500">Stream will appear when agent starts</p>
25
- </div>
26
- )}
27
- </div>
28
- </div>
29
- );
30
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cua2-front/src/component/poc/index.ts DELETED
@@ -1,8 +0,0 @@
1
- export { ConnectionStatus } from './ConnectionStatus';
2
- export { Header } from './Header';
3
- export { Metadata } from './Metadata';
4
- export { ProcessingIndicator } from './ProcessingIndicator';
5
- export { StackSteps } from './StackSteps';
6
- export { StepCard } from './StepCard';
7
- export { TaskButton } from './TaskButton';
8
- export { VNCStream } from './VNCStream';