@agent-relay/dashboard 2.0.81 → 2.0.82
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/out/404.html +1 -1
- package/out/_next/static/chunks/{118-4c8241b0218335de.js → 118-ae2b650136a5a5fc.js} +1 -1
- package/out/_next/static/chunks/407-0c82986cf79c8ecb.js +1 -0
- package/out/_next/static/chunks/app/app/[[...slug]]/{page-1e81c047cff17212.js → page-f7eca1b66fb4249b.js} +1 -1
- package/out/_next/static/chunks/app/{page-6892fe2dd07fb48b.js → page-0ee604f7070d14c0.js} +1 -1
- package/out/_next/static/css/8968d98ed4c4d33f.css +1 -0
- package/out/about.html +2 -2
- package/out/about.txt +1 -1
- package/out/app/onboarding.html +1 -1
- package/out/app/onboarding.txt +1 -1
- package/out/app.html +1 -1
- package/out/app.txt +2 -2
- package/out/blog/go-to-bed-wake-up-to-a-finished-product.html +2 -2
- package/out/blog/go-to-bed-wake-up-to-a-finished-product.txt +1 -1
- package/out/blog/let-them-cook-multi-agent-orchestration.html +2 -2
- package/out/blog/let-them-cook-multi-agent-orchestration.txt +2 -2
- package/out/blog.html +2 -2
- package/out/blog.txt +1 -1
- package/out/careers.html +2 -2
- package/out/careers.txt +1 -1
- package/out/changelog.html +2 -2
- package/out/changelog.txt +1 -1
- package/out/cloud/link.html +1 -1
- package/out/cloud/link.txt +2 -2
- package/out/complete-profile.html +2 -2
- package/out/complete-profile.txt +1 -1
- package/out/connect-repos.html +1 -1
- package/out/connect-repos.txt +1 -1
- package/out/contact.html +2 -2
- package/out/contact.txt +1 -1
- package/out/docs.html +2 -2
- package/out/docs.txt +1 -1
- package/out/history.html +1 -1
- package/out/history.txt +2 -2
- package/out/index.html +1 -1
- package/out/index.txt +2 -2
- package/out/login.html +2 -2
- package/out/login.txt +1 -1
- package/out/metrics.html +1 -1
- package/out/metrics.txt +2 -2
- package/out/pricing.html +2 -2
- package/out/pricing.txt +1 -1
- package/out/privacy.html +2 -2
- package/out/privacy.txt +1 -1
- package/out/providers/setup/claude.html +1 -1
- package/out/providers/setup/claude.txt +1 -1
- package/out/providers/setup/codex.html +1 -1
- package/out/providers/setup/codex.txt +1 -1
- package/out/providers/setup/cursor.html +1 -1
- package/out/providers/setup/cursor.txt +1 -1
- package/out/providers.html +1 -1
- package/out/providers.txt +1 -1
- package/out/security.html +2 -2
- package/out/security.txt +1 -1
- package/out/signup.html +2 -2
- package/out/signup.txt +1 -1
- package/out/terms.html +2 -2
- package/out/terms.txt +1 -1
- package/package.json +7 -1
- package/src/app/about/page.tsx +7 -0
- package/src/app/app/[[...slug]]/DashboardPageClient.tsx +853 -0
- package/src/app/app/[[...slug]]/page.tsx +23 -0
- package/src/app/app/onboarding/page.tsx +394 -0
- package/src/app/apple-icon.png +0 -0
- package/src/app/blog/go-to-bed-wake-up-to-a-finished-product/page.tsx +88 -0
- package/src/app/blog/let-them-cook-multi-agent-orchestration/page.tsx +93 -0
- package/src/app/blog/page.tsx +15 -0
- package/src/app/careers/page.tsx +7 -0
- package/src/app/changelog/page.tsx +7 -0
- package/src/app/cloud/link/page.tsx +464 -0
- package/src/app/complete-profile/page.tsx +204 -0
- package/src/app/connect-repos/page.tsx +410 -0
- package/src/app/contact/page.tsx +7 -0
- package/src/app/docs/page.tsx +7 -0
- package/src/app/favicon.png +0 -0
- package/src/app/globals.css +200 -0
- package/src/app/history/page.tsx +658 -0
- package/src/app/layout.tsx +25 -0
- package/src/app/login/page.tsx +424 -0
- package/src/app/metrics/page.tsx +781 -0
- package/src/app/page.tsx +59 -0
- package/src/app/pricing/page.tsx +7 -0
- package/src/app/privacy/page.tsx +7 -0
- package/src/app/providers/page.tsx +193 -0
- package/src/app/providers/setup/[provider]/ProviderSetupClient.tsx +197 -0
- package/src/app/providers/setup/[provider]/constants.ts +35 -0
- package/src/app/providers/setup/[provider]/page.tsx +42 -0
- package/src/app/security/page.tsx +7 -0
- package/src/app/signup/page.tsx +533 -0
- package/src/app/terms/page.tsx +7 -0
- package/src/components/ActivityFeed.tsx +216 -0
- package/src/components/AddWorkspaceModal.tsx +170 -0
- package/src/components/AgentCard.test.tsx +134 -0
- package/src/components/AgentCard.tsx +585 -0
- package/src/components/AgentList.test.tsx +147 -0
- package/src/components/AgentList.tsx +419 -0
- package/src/components/AgentLogPreview.tsx +173 -0
- package/src/components/AgentProfilePanel.tsx +569 -0
- package/src/components/App.tsx +3424 -0
- package/src/components/BillingPanel.tsx +922 -0
- package/src/components/BillingResult.tsx +447 -0
- package/src/components/BroadcastComposer.tsx +690 -0
- package/src/components/ChannelAdminPanel.tsx +773 -0
- package/src/components/ChannelBrowser.tsx +385 -0
- package/src/components/ChannelChat.tsx +261 -0
- package/src/components/ChannelSidebar.tsx +399 -0
- package/src/components/CloudSessionProvider.tsx +130 -0
- package/src/components/CommandPalette.tsx +815 -0
- package/src/components/ConfirmationDialog.tsx +133 -0
- package/src/components/ConversationHistory.tsx +518 -0
- package/src/components/CoordinatorPanel.tsx +956 -0
- package/src/components/DecisionQueue.tsx +717 -0
- package/src/components/DirectMessageView.tsx +164 -0
- package/src/components/FileAutocomplete.tsx +368 -0
- package/src/components/FleetOverview.tsx +278 -0
- package/src/components/LogViewer.tsx +310 -0
- package/src/components/LogViewerPanel.tsx +482 -0
- package/src/components/Logo.tsx +284 -0
- package/src/components/MentionAutocomplete.tsx +384 -0
- package/src/components/MessageComposer.tsx +473 -0
- package/src/components/MessageList.tsx +725 -0
- package/src/components/MessageSenderName.tsx +91 -0
- package/src/components/MessageStatusIndicator.tsx +142 -0
- package/src/components/NewConversationModal.tsx +400 -0
- package/src/components/NotificationToast.tsx +488 -0
- package/src/components/OnlineUsersIndicator.tsx +164 -0
- package/src/components/Pagination.tsx +124 -0
- package/src/components/PricingPlans.tsx +386 -0
- package/src/components/ProjectList.tsx +711 -0
- package/src/components/ProviderAuthFlow.tsx +343 -0
- package/src/components/ProviderConnectionList.tsx +375 -0
- package/src/components/ProvisioningProgress.tsx +730 -0
- package/src/components/ReactionChips.tsx +70 -0
- package/src/components/ReactionPicker.tsx +121 -0
- package/src/components/RepoAccessPanel.tsx +787 -0
- package/src/components/RepositoriesPanel.tsx +901 -0
- package/src/components/ServerCard.tsx +202 -0
- package/src/components/SessionExpiredModal.tsx +128 -0
- package/src/components/SpawnModal.test.tsx +190 -0
- package/src/components/SpawnModal.tsx +1001 -0
- package/src/components/TaskAssignmentUI.tsx +375 -0
- package/src/components/TerminalProviderSetup.tsx +517 -0
- package/src/components/ThemeProvider.tsx +159 -0
- package/src/components/ThinkingIndicator.tsx +231 -0
- package/src/components/ThreadList.tsx +198 -0
- package/src/components/ThreadPanel.tsx +405 -0
- package/src/components/TrajectoryViewer.tsx +698 -0
- package/src/components/TypingIndicator.tsx +69 -0
- package/src/components/UsageBanner.tsx +231 -0
- package/src/components/UserProfilePanel.tsx +233 -0
- package/src/components/WorkspaceContext.tsx +95 -0
- package/src/components/WorkspaceSelector.tsx +234 -0
- package/src/components/WorkspaceStatusIndicator.tsx +396 -0
- package/src/components/XTermInteractive.tsx +516 -0
- package/src/components/XTermLogViewer.tsx +719 -0
- package/src/components/channels/ChannelDialogs.tsx +1411 -0
- package/src/components/channels/ChannelHeader.tsx +317 -0
- package/src/components/channels/ChannelMessageList.tsx +463 -0
- package/src/components/channels/ChannelViewV1.tsx +146 -0
- package/src/components/channels/MessageInput.tsx +302 -0
- package/src/components/channels/SearchInput.tsx +172 -0
- package/src/components/channels/SearchResults.tsx +336 -0
- package/src/components/channels/api.test.ts +1527 -0
- package/src/components/channels/api.ts +703 -0
- package/src/components/channels/index.ts +76 -0
- package/src/components/channels/mockApi.ts +344 -0
- package/src/components/channels/types.ts +566 -0
- package/src/components/hooks/index.ts +58 -0
- package/src/components/hooks/useAgentLogs.ts +504 -0
- package/src/components/hooks/useAgents.ts +127 -0
- package/src/components/hooks/useBroadcastDedup.test.ts +371 -0
- package/src/components/hooks/useBroadcastDedup.ts +86 -0
- package/src/components/hooks/useChannelAdmin.ts +329 -0
- package/src/components/hooks/useChannelBrowser.ts +239 -0
- package/src/components/hooks/useChannelCommands.ts +138 -0
- package/src/components/hooks/useChannels.ts +367 -0
- package/src/components/hooks/useDebounce.ts +29 -0
- package/src/components/hooks/useDirectMessage.test.ts +952 -0
- package/src/components/hooks/useDirectMessage.ts +141 -0
- package/src/components/hooks/useMessages.ts +310 -0
- package/src/components/hooks/useOrchestrator.test.ts +165 -0
- package/src/components/hooks/useOrchestrator.ts +424 -0
- package/src/components/hooks/usePinnedAgents.test.ts +356 -0
- package/src/components/hooks/usePinnedAgents.ts +140 -0
- package/src/components/hooks/usePresence.test.ts +245 -0
- package/src/components/hooks/usePresence.ts +377 -0
- package/src/components/hooks/useRecentRepos.ts +130 -0
- package/src/components/hooks/useSession.ts +209 -0
- package/src/components/hooks/useThread.ts +138 -0
- package/src/components/hooks/useTrajectory.ts +265 -0
- package/src/components/hooks/useWebSocket.ts +290 -0
- package/src/components/hooks/useWorkspaceMembers.ts +132 -0
- package/src/components/hooks/useWorkspaceRepos.ts +73 -0
- package/src/components/hooks/useWorkspaceStatus.ts +237 -0
- package/src/components/index.ts +81 -0
- package/src/components/layout/Header.tsx +311 -0
- package/src/components/layout/RepoContextHeader.tsx +361 -0
- package/src/components/layout/Sidebar.archive.test.tsx +126 -0
- package/src/components/layout/Sidebar.test.tsx +691 -0
- package/src/components/layout/Sidebar.tsx +900 -0
- package/src/components/layout/index.ts +7 -0
- package/src/components/settings/BillingSettingsPanel.tsx +564 -0
- package/src/components/settings/SettingsPage.tsx +683 -0
- package/src/components/settings/TeamSettingsPanel.tsx +560 -0
- package/src/components/settings/WorkspaceSettingsPanel.tsx +1368 -0
- package/src/components/settings/index.ts +11 -0
- package/src/components/settings/types.ts +79 -0
- package/src/components/utils/messageFormatting.test.tsx +331 -0
- package/src/components/utils/messageFormatting.tsx +597 -0
- package/src/index.ts +63 -0
- package/src/landing/AboutPage.tsx +77 -0
- package/src/landing/BlogContent.tsx +187 -0
- package/src/landing/BlogPage.tsx +47 -0
- package/src/landing/CareersPage.tsx +53 -0
- package/src/landing/ChangelogPage.tsx +33 -0
- package/src/landing/ContactPage.tsx +41 -0
- package/src/landing/DocsPage.tsx +43 -0
- package/src/landing/LandingPage.tsx +702 -0
- package/src/landing/PricingPage.tsx +549 -0
- package/src/landing/PrivacyPage.tsx +117 -0
- package/src/landing/SecurityPage.tsx +42 -0
- package/src/landing/StaticPage.tsx +165 -0
- package/src/landing/TermsPage.tsx +125 -0
- package/src/landing/blogData.ts +312 -0
- package/src/landing/index.ts +18 -0
- package/src/landing/styles.css +3673 -0
- package/src/lib/agent-merge.test.ts +43 -0
- package/src/lib/agent-merge.ts +35 -0
- package/src/lib/api.ts +1294 -0
- package/src/lib/cloudApi.ts +893 -0
- package/src/lib/colors.test.ts +175 -0
- package/src/lib/colors.ts +218 -0
- package/src/lib/config.ts +109 -0
- package/src/lib/hierarchy.ts +242 -0
- package/src/lib/stuckDetection.ts +142 -0
- package/src/lib/useUrlRouting.ts +190 -0
- package/src/types/index.ts +317 -0
- package/src/types/threading.ts +7 -0
- package/out/_next/static/chunks/285-dc644487a8d6500d.js +0 -1
- package/out/_next/static/css/4c58d9cf493aa626.css +0 -1
- /package/out/_next/static/{dYlczDQI12PIQ3tqq3N4Y → IxfA6RZu4trcsEMYlkQra}/_buildManifest.js +0 -0
- /package/out/_next/static/{dYlczDQI12PIQ3tqq3N4Y → IxfA6RZu4trcsEMYlkQra}/_ssgManifest.js +0 -0
- /package/out/_next/static/chunks/{528-d375bc8b46912d2c.js → 528-f5f676996d613c25.js} +0 -0
- /package/out/_next/static/chunks/app/blog/let-them-cook-multi-agent-orchestration/{page-a58308f43557b908.js → page-b194f207fbd91862.js} +0 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LogViewerPanel Component
|
|
3
|
+
*
|
|
4
|
+
* A full-screen or sidebar panel wrapper for the LogViewer.
|
|
5
|
+
* Provides a modal-like overlay for dedicated log viewing.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
9
|
+
import { LogViewer } from './LogViewer';
|
|
10
|
+
import { getAgentColor, getAgentInitials } from '../lib/colors';
|
|
11
|
+
import { api } from '../lib/api';
|
|
12
|
+
import type { Agent } from '../types';
|
|
13
|
+
|
|
14
|
+
export type PanelPosition = 'right' | 'bottom' | 'fullscreen';
|
|
15
|
+
|
|
16
|
+
export interface LogViewerPanelProps {
|
|
17
|
+
/** Agent to show logs for */
|
|
18
|
+
agent: Agent;
|
|
19
|
+
/** Panel position/style */
|
|
20
|
+
position?: PanelPosition;
|
|
21
|
+
/** Whether the panel is open */
|
|
22
|
+
isOpen: boolean;
|
|
23
|
+
/** Callback when panel should close */
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
/** Callback when user wants to switch to a different agent */
|
|
26
|
+
onAgentChange?: (agent: Agent) => void;
|
|
27
|
+
/** List of available agents (for agent switcher) */
|
|
28
|
+
availableAgents?: Agent[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function LogViewerPanel({
|
|
32
|
+
agent,
|
|
33
|
+
position = 'right',
|
|
34
|
+
isOpen,
|
|
35
|
+
onClose,
|
|
36
|
+
onAgentChange,
|
|
37
|
+
availableAgents = [],
|
|
38
|
+
}: LogViewerPanelProps) {
|
|
39
|
+
const colors = getAgentColor(agent.name);
|
|
40
|
+
const [isInterrupting, setIsInterrupting] = useState(false);
|
|
41
|
+
|
|
42
|
+
// Handle interrupt button click
|
|
43
|
+
const handleInterrupt = useCallback(async () => {
|
|
44
|
+
if (isInterrupting) return;
|
|
45
|
+
|
|
46
|
+
setIsInterrupting(true);
|
|
47
|
+
try {
|
|
48
|
+
const result = await api.interruptAgent(agent.name);
|
|
49
|
+
if (!result.success) {
|
|
50
|
+
console.error('Failed to interrupt agent:', result.error);
|
|
51
|
+
}
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.error('Error interrupting agent:', err);
|
|
54
|
+
} finally {
|
|
55
|
+
// Brief delay to show the button was pressed
|
|
56
|
+
setTimeout(() => setIsInterrupting(false), 500);
|
|
57
|
+
}
|
|
58
|
+
}, [agent.name, isInterrupting]);
|
|
59
|
+
|
|
60
|
+
// Close on Escape
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const handleKeyDown = (e: KeyboardEvent) => {
|
|
63
|
+
if (e.key === 'Escape' && isOpen) {
|
|
64
|
+
onClose();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
69
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
70
|
+
}, [isOpen, onClose]);
|
|
71
|
+
|
|
72
|
+
// Prevent body scroll when panel is open (fix mobile scroll capture)
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!isOpen) return;
|
|
75
|
+
|
|
76
|
+
const previousOverflow = document.body.style.overflow;
|
|
77
|
+
const previousOverscroll = document.body.style.overscrollBehavior;
|
|
78
|
+
|
|
79
|
+
document.body.style.overflow = 'hidden';
|
|
80
|
+
document.body.style.overscrollBehavior = 'none';
|
|
81
|
+
|
|
82
|
+
return () => {
|
|
83
|
+
document.body.style.overflow = previousOverflow;
|
|
84
|
+
document.body.style.overscrollBehavior = previousOverscroll;
|
|
85
|
+
};
|
|
86
|
+
}, [isOpen]);
|
|
87
|
+
|
|
88
|
+
if (!isOpen) return null;
|
|
89
|
+
|
|
90
|
+
const getPanelStyles = (): React.CSSProperties => {
|
|
91
|
+
const base: React.CSSProperties = {
|
|
92
|
+
position: 'fixed',
|
|
93
|
+
zIndex: 1100,
|
|
94
|
+
background: 'linear-gradient(180deg, #0d0f14 0%, #0a0c10 100%)',
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
switch (position) {
|
|
98
|
+
case 'right':
|
|
99
|
+
return {
|
|
100
|
+
...base,
|
|
101
|
+
top: 0,
|
|
102
|
+
right: 0,
|
|
103
|
+
bottom: 0,
|
|
104
|
+
width: '600px',
|
|
105
|
+
maxWidth: '100vw',
|
|
106
|
+
borderLeft: '1px solid #21262d',
|
|
107
|
+
boxShadow: '-20px 0 60px rgba(0, 0, 0, 0.5)',
|
|
108
|
+
};
|
|
109
|
+
case 'bottom':
|
|
110
|
+
return {
|
|
111
|
+
...base,
|
|
112
|
+
left: 0,
|
|
113
|
+
right: 0,
|
|
114
|
+
bottom: 0,
|
|
115
|
+
height: '400px',
|
|
116
|
+
maxHeight: '60vh',
|
|
117
|
+
borderTop: '1px solid #21262d',
|
|
118
|
+
boxShadow: '0 -20px 60px rgba(0, 0, 0, 0.5)',
|
|
119
|
+
};
|
|
120
|
+
case 'fullscreen':
|
|
121
|
+
return {
|
|
122
|
+
...base,
|
|
123
|
+
inset: 0,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const getAnimationClass = () => {
|
|
129
|
+
switch (position) {
|
|
130
|
+
case 'right':
|
|
131
|
+
return 'animate-slide-in-right';
|
|
132
|
+
case 'bottom':
|
|
133
|
+
return 'animate-slide-in-bottom';
|
|
134
|
+
case 'fullscreen':
|
|
135
|
+
return 'animate-fade-in';
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<>
|
|
141
|
+
{/* Backdrop */}
|
|
142
|
+
<div
|
|
143
|
+
className="fixed inset-0 bg-black/60 z-[1099] animate-fade-in"
|
|
144
|
+
onClick={onClose}
|
|
145
|
+
/>
|
|
146
|
+
|
|
147
|
+
{/* Panel */}
|
|
148
|
+
<div
|
|
149
|
+
className={`flex flex-col ${getAnimationClass()}`}
|
|
150
|
+
style={getPanelStyles()}
|
|
151
|
+
>
|
|
152
|
+
{/* Header with agent info - two row layout */}
|
|
153
|
+
<div
|
|
154
|
+
className="flex flex-col gap-3 border-b border-[#21262d] px-4 py-3 sm:px-5 sm:py-4"
|
|
155
|
+
style={{
|
|
156
|
+
background: 'linear-gradient(180deg, #161b22 0%, #0d1117 100%)',
|
|
157
|
+
}}
|
|
158
|
+
>
|
|
159
|
+
{/* Row 1: Avatar, Agent Name, Status */}
|
|
160
|
+
<div className="flex items-center gap-3">
|
|
161
|
+
{/* Agent avatar with shine effect */}
|
|
162
|
+
<div
|
|
163
|
+
className="relative shrink-0 rounded-xl flex items-center justify-center font-bold overflow-hidden w-9 h-9 text-sm sm:w-11 sm:h-11"
|
|
164
|
+
style={{
|
|
165
|
+
backgroundColor: colors.primary,
|
|
166
|
+
color: colors.text,
|
|
167
|
+
boxShadow: `0 0 20px ${colors.primary}50, inset 0 1px 0 rgba(255,255,255,0.2)`,
|
|
168
|
+
}}
|
|
169
|
+
>
|
|
170
|
+
{/* Shine overlay */}
|
|
171
|
+
<div
|
|
172
|
+
className="absolute inset-0 opacity-30"
|
|
173
|
+
style={{
|
|
174
|
+
background: 'linear-gradient(135deg, rgba(255,255,255,0.35) 0%, transparent 50%)',
|
|
175
|
+
}}
|
|
176
|
+
/>
|
|
177
|
+
<span className="relative z-10">{getAgentInitials(agent.name)}</span>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
{/* Agent name and status */}
|
|
181
|
+
<div className="flex flex-col min-w-0 flex-1">
|
|
182
|
+
<div className="flex items-center gap-2.5 flex-wrap">
|
|
183
|
+
<h2
|
|
184
|
+
className="text-base sm:text-lg font-semibold m-0"
|
|
185
|
+
style={{ color: colors.primary }}
|
|
186
|
+
title={agent.name}
|
|
187
|
+
>
|
|
188
|
+
{agent.name}
|
|
189
|
+
</h2>
|
|
190
|
+
<span
|
|
191
|
+
className={`px-2 py-0.5 rounded-md text-[10px] uppercase tracking-wider font-medium shrink-0 ${
|
|
192
|
+
agent.status === 'online'
|
|
193
|
+
? 'bg-[#3fb950]/15 text-[#3fb950]'
|
|
194
|
+
: agent.status === 'busy'
|
|
195
|
+
? 'bg-[#d29922]/15 text-[#d29922]'
|
|
196
|
+
: 'bg-[#484f58]/15 text-[#484f58]'
|
|
197
|
+
}`}
|
|
198
|
+
style={{
|
|
199
|
+
boxShadow: agent.status === 'online' ? '0 0 8px rgba(63,185,80,0.2)' : 'none',
|
|
200
|
+
}}
|
|
201
|
+
>
|
|
202
|
+
{agent.status}
|
|
203
|
+
</span>
|
|
204
|
+
</div>
|
|
205
|
+
{agent.currentTask && (
|
|
206
|
+
<span
|
|
207
|
+
className="text-xs sm:text-sm text-[#8b949e] truncate mt-0.5"
|
|
208
|
+
title={agent.currentTask}
|
|
209
|
+
>
|
|
210
|
+
{agent.currentTask}
|
|
211
|
+
</span>
|
|
212
|
+
)}
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
{/* Row 2: All control buttons */}
|
|
217
|
+
<div className="flex items-center gap-2 flex-wrap">
|
|
218
|
+
{/* Agent switcher dropdown */}
|
|
219
|
+
{availableAgents.length > 1 && onAgentChange && (
|
|
220
|
+
<AgentSwitcher
|
|
221
|
+
agents={availableAgents}
|
|
222
|
+
currentAgent={agent}
|
|
223
|
+
onSelect={onAgentChange}
|
|
224
|
+
/>
|
|
225
|
+
)}
|
|
226
|
+
|
|
227
|
+
{/* Position toggle buttons */}
|
|
228
|
+
<div className="flex items-center gap-1 bg-[#21262d]/80 rounded-lg p-1 border border-[#30363d]/50">
|
|
229
|
+
<button
|
|
230
|
+
className={`p-1.5 rounded-md transition-all duration-200 ${
|
|
231
|
+
position === 'right'
|
|
232
|
+
? 'bg-accent-cyan/15 text-accent-cyan shadow-[0_0_8px_rgba(0,217,255,0.15)]'
|
|
233
|
+
: 'text-[#8b949e] hover:text-[#c9d1d9] hover:bg-[#30363d]'
|
|
234
|
+
}`}
|
|
235
|
+
title="Sidebar view"
|
|
236
|
+
>
|
|
237
|
+
<SidebarIcon />
|
|
238
|
+
</button>
|
|
239
|
+
<button
|
|
240
|
+
className={`p-1.5 rounded-md transition-all duration-200 ${
|
|
241
|
+
position === 'bottom'
|
|
242
|
+
? 'bg-accent-cyan/15 text-accent-cyan shadow-[0_0_8px_rgba(0,217,255,0.15)]'
|
|
243
|
+
: 'text-[#8b949e] hover:text-[#c9d1d9] hover:bg-[#30363d]'
|
|
244
|
+
}`}
|
|
245
|
+
title="Bottom panel"
|
|
246
|
+
>
|
|
247
|
+
<BottomPanelIcon />
|
|
248
|
+
</button>
|
|
249
|
+
<button
|
|
250
|
+
className={`p-1.5 rounded-md transition-all duration-200 ${
|
|
251
|
+
position === 'fullscreen'
|
|
252
|
+
? 'bg-accent-cyan/15 text-accent-cyan shadow-[0_0_8px_rgba(0,217,255,0.15)]'
|
|
253
|
+
: 'text-[#8b949e] hover:text-[#c9d1d9] hover:bg-[#30363d]'
|
|
254
|
+
}`}
|
|
255
|
+
title="Fullscreen"
|
|
256
|
+
>
|
|
257
|
+
<FullscreenIcon />
|
|
258
|
+
</button>
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
{/* Spacer to push interrupt and close to the right */}
|
|
262
|
+
<div className="flex-1" />
|
|
263
|
+
|
|
264
|
+
{/* Interrupt button - send ESC to break agent out of stuck loops */}
|
|
265
|
+
<button
|
|
266
|
+
className={`p-2 rounded-lg transition-all duration-200 ${
|
|
267
|
+
isInterrupting
|
|
268
|
+
? 'bg-[#d29922]/20 text-[#d29922] animate-pulse'
|
|
269
|
+
: 'text-[#8b949e] hover:text-[#d29922] hover:bg-[#d29922]/10 hover:shadow-[0_0_8px_rgba(210,153,34,0.2)]'
|
|
270
|
+
}`}
|
|
271
|
+
onClick={handleInterrupt}
|
|
272
|
+
disabled={isInterrupting}
|
|
273
|
+
title="Send ESC to agent - interrupt current operation"
|
|
274
|
+
>
|
|
275
|
+
<InterruptIcon />
|
|
276
|
+
</button>
|
|
277
|
+
|
|
278
|
+
{/* Close button */}
|
|
279
|
+
<button
|
|
280
|
+
className="p-2 rounded-lg text-[#8b949e] hover:text-[#f85149] hover:bg-[#f85149]/10 transition-all duration-200 hover:shadow-[0_0_8px_rgba(248,81,73,0.2)]"
|
|
281
|
+
onClick={onClose}
|
|
282
|
+
>
|
|
283
|
+
<CloseIcon />
|
|
284
|
+
</button>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
{/* Log viewer */}
|
|
289
|
+
<div className="flex-1 min-h-0 overflow-hidden">
|
|
290
|
+
<LogViewer
|
|
291
|
+
agentName={agent.name}
|
|
292
|
+
mode="panel"
|
|
293
|
+
showHeader={false}
|
|
294
|
+
maxHeight="100%"
|
|
295
|
+
className="h-full rounded-none border-none"
|
|
296
|
+
/>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
{/* Custom keyframes for animations */}
|
|
301
|
+
<style>{`
|
|
302
|
+
@keyframes slideInRight {
|
|
303
|
+
from {
|
|
304
|
+
transform: translateX(100%);
|
|
305
|
+
opacity: 0;
|
|
306
|
+
}
|
|
307
|
+
to {
|
|
308
|
+
transform: translateX(0);
|
|
309
|
+
opacity: 1;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
@keyframes slideInBottom {
|
|
314
|
+
from {
|
|
315
|
+
transform: translateY(100%);
|
|
316
|
+
opacity: 0;
|
|
317
|
+
}
|
|
318
|
+
to {
|
|
319
|
+
transform: translateY(0);
|
|
320
|
+
opacity: 1;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.animate-slide-in-right {
|
|
325
|
+
animation: slideInRight 0.3s cubic-bezier(0.32, 0.72, 0, 1);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.animate-slide-in-bottom {
|
|
329
|
+
animation: slideInBottom 0.3s cubic-bezier(0.32, 0.72, 0, 1);
|
|
330
|
+
}
|
|
331
|
+
`}</style>
|
|
332
|
+
</>
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Agent switcher dropdown
|
|
337
|
+
interface AgentSwitcherProps {
|
|
338
|
+
agents: Agent[];
|
|
339
|
+
currentAgent: Agent;
|
|
340
|
+
onSelect: (agent: Agent) => void;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function AgentSwitcher({ agents, currentAgent, onSelect }: AgentSwitcherProps) {
|
|
344
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
345
|
+
const dropdownRef = React.useRef<HTMLDivElement>(null);
|
|
346
|
+
|
|
347
|
+
// Close dropdown when clicking outside
|
|
348
|
+
useEffect(() => {
|
|
349
|
+
const handleClickOutside = (e: MouseEvent) => {
|
|
350
|
+
if (dropdownRef.current && !dropdownRef.current.contains(e.target as Node)) {
|
|
351
|
+
setIsOpen(false);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
356
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
357
|
+
}, []);
|
|
358
|
+
|
|
359
|
+
return (
|
|
360
|
+
<div className="relative" ref={dropdownRef}>
|
|
361
|
+
<button
|
|
362
|
+
className="flex items-center gap-2 px-3 py-1.5 bg-[#21262d] hover:bg-[#30363d] rounded-lg text-sm text-[#c9d1d9] transition-colors"
|
|
363
|
+
onClick={() => setIsOpen(!isOpen)}
|
|
364
|
+
>
|
|
365
|
+
<span>Switch agent</span>
|
|
366
|
+
<ChevronDownIcon />
|
|
367
|
+
</button>
|
|
368
|
+
|
|
369
|
+
{isOpen && (
|
|
370
|
+
<div className="absolute right-0 top-full mt-2 w-64 bg-[#161b22] border border-[#30363d] rounded-lg shadow-xl overflow-hidden z-10">
|
|
371
|
+
<div className="max-h-64 overflow-y-auto">
|
|
372
|
+
{agents.map((agent) => {
|
|
373
|
+
const colors = getAgentColor(agent.name);
|
|
374
|
+
const isCurrent = agent.name === currentAgent.name;
|
|
375
|
+
|
|
376
|
+
return (
|
|
377
|
+
<button
|
|
378
|
+
key={agent.name}
|
|
379
|
+
className={`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${
|
|
380
|
+
isCurrent
|
|
381
|
+
? 'bg-[#238636]/20'
|
|
382
|
+
: 'hover:bg-[#21262d]'
|
|
383
|
+
}`}
|
|
384
|
+
onClick={() => {
|
|
385
|
+
onSelect(agent);
|
|
386
|
+
setIsOpen(false);
|
|
387
|
+
}}
|
|
388
|
+
>
|
|
389
|
+
<div
|
|
390
|
+
className="w-8 h-8 rounded flex items-center justify-center text-xs font-semibold shrink-0"
|
|
391
|
+
style={{
|
|
392
|
+
backgroundColor: colors.primary,
|
|
393
|
+
color: colors.text,
|
|
394
|
+
}}
|
|
395
|
+
>
|
|
396
|
+
{getAgentInitials(agent.name)}
|
|
397
|
+
</div>
|
|
398
|
+
<div className="flex-1 min-w-0">
|
|
399
|
+
<div className="text-sm text-[#c9d1d9] truncate">
|
|
400
|
+
{agent.name}
|
|
401
|
+
</div>
|
|
402
|
+
<div className="text-xs text-[#8b949e]">{agent.status}</div>
|
|
403
|
+
</div>
|
|
404
|
+
{isCurrent && (
|
|
405
|
+
<CheckIcon />
|
|
406
|
+
)}
|
|
407
|
+
</button>
|
|
408
|
+
);
|
|
409
|
+
})}
|
|
410
|
+
</div>
|
|
411
|
+
</div>
|
|
412
|
+
)}
|
|
413
|
+
</div>
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// Icons
|
|
418
|
+
function InterruptIcon() {
|
|
419
|
+
return (
|
|
420
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
421
|
+
{/* ESC key icon - represents sending escape sequence */}
|
|
422
|
+
<rect x="3" y="5" width="18" height="14" rx="2" />
|
|
423
|
+
<text x="12" y="15" textAnchor="middle" fill="currentColor" stroke="none" fontSize="8" fontWeight="600" fontFamily="system-ui">ESC</text>
|
|
424
|
+
</svg>
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
function CloseIcon() {
|
|
429
|
+
return (
|
|
430
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
431
|
+
<line x1="18" y1="6" x2="6" y2="18" />
|
|
432
|
+
<line x1="6" y1="6" x2="18" y2="18" />
|
|
433
|
+
</svg>
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function SidebarIcon() {
|
|
438
|
+
return (
|
|
439
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
440
|
+
<rect x="3" y="3" width="18" height="18" rx="2" />
|
|
441
|
+
<line x1="15" y1="3" x2="15" y2="21" />
|
|
442
|
+
</svg>
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
function BottomPanelIcon() {
|
|
447
|
+
return (
|
|
448
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
449
|
+
<rect x="3" y="3" width="18" height="18" rx="2" />
|
|
450
|
+
<line x1="3" y1="15" x2="21" y2="15" />
|
|
451
|
+
</svg>
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
function FullscreenIcon() {
|
|
456
|
+
return (
|
|
457
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
458
|
+
<polyline points="15 3 21 3 21 9" />
|
|
459
|
+
<polyline points="9 21 3 21 3 15" />
|
|
460
|
+
<line x1="21" y1="3" x2="14" y2="10" />
|
|
461
|
+
<line x1="3" y1="21" x2="10" y2="14" />
|
|
462
|
+
</svg>
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
function ChevronDownIcon() {
|
|
467
|
+
return (
|
|
468
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
469
|
+
<polyline points="6 9 12 15 18 9" />
|
|
470
|
+
</svg>
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function CheckIcon() {
|
|
475
|
+
return (
|
|
476
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#3fb950" strokeWidth="2">
|
|
477
|
+
<polyline points="20 6 9 17 4 12" />
|
|
478
|
+
</svg>
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export default LogViewerPanel;
|