@agent-relay/dashboard 2.0.80 → 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/{AqelRhy1vr2nBUcU0Iqcp → IxfA6RZu4trcsEMYlkQra}/_buildManifest.js +0 -0
- /package/out/_next/static/{AqelRhy1vr2nBUcU0Iqcp → 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
package/src/app/page.tsx
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { LandingPage } from '../landing';
|
|
5
|
+
import { App } from '../components/App';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Detect if running in cloud mode (should show landing page at root)
|
|
9
|
+
* Local mode shows the dashboard directly at root
|
|
10
|
+
*/
|
|
11
|
+
function detectCloudMode(): boolean {
|
|
12
|
+
if (typeof window === 'undefined') return false;
|
|
13
|
+
|
|
14
|
+
const hostname = window.location.hostname;
|
|
15
|
+
const params = new URLSearchParams(window.location.search);
|
|
16
|
+
|
|
17
|
+
// Query param for testing: ?landing=true or ?cloud=true
|
|
18
|
+
if (params.get('landing') === 'true' || params.get('cloud') === 'true') return true;
|
|
19
|
+
|
|
20
|
+
// Cloud URL patterns
|
|
21
|
+
if (hostname.includes('agent-relay.com')) return true;
|
|
22
|
+
if (hostname.includes('agentrelay.dev')) return true;
|
|
23
|
+
if (hostname.includes('.fly.dev')) return true;
|
|
24
|
+
|
|
25
|
+
// Cloud mode flag in meta tags
|
|
26
|
+
const cloudMeta = document.querySelector('meta[name="agent-relay-cloud"]');
|
|
27
|
+
if (cloudMeta?.getAttribute('content') === 'true') return true;
|
|
28
|
+
|
|
29
|
+
// Cloud mode in local storage (for development)
|
|
30
|
+
if (localStorage.getItem('agent-relay-cloud-mode') === 'true') return true;
|
|
31
|
+
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default function HomePage() {
|
|
36
|
+
// Default to local mode (dashboard) - this is the most common case when
|
|
37
|
+
// running via agent-relay up. Cloud mode is only for hosted deployment.
|
|
38
|
+
const [isCloud, setIsCloud] = useState(false);
|
|
39
|
+
const [isReady, setIsReady] = useState(false);
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setIsCloud(detectCloudMode());
|
|
43
|
+
setIsReady(true);
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
46
|
+
// Show dashboard-styled loading state while detecting mode
|
|
47
|
+
// This prevents flash of unstyled content
|
|
48
|
+
if (!isReady) {
|
|
49
|
+
return (
|
|
50
|
+
<div className="flex h-screen bg-bg-deep font-sans text-text-primary items-center justify-center">
|
|
51
|
+
<div className="text-text-muted">Loading...</div>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Cloud mode: show landing page at root
|
|
57
|
+
// Local mode: show dashboard at root
|
|
58
|
+
return isCloud ? <LandingPage /> : <App />;
|
|
59
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Providers Page
|
|
3
|
+
*
|
|
4
|
+
* Connect AI providers (Anthropic, OpenAI, etc.) to enable workspace creation.
|
|
5
|
+
* Uses the shared ProviderConnectionList component for consistent UI with /app onboarding.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use client';
|
|
9
|
+
|
|
10
|
+
import React, { useState, useEffect, Suspense } from 'react';
|
|
11
|
+
import { useSearchParams } from 'next/navigation';
|
|
12
|
+
import { LogoIcon } from '../../components/Logo';
|
|
13
|
+
import { ProviderConnectionList, type ProviderInfo } from '../../components/ProviderConnectionList';
|
|
14
|
+
|
|
15
|
+
interface BackendProvider {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
description: string;
|
|
20
|
+
color: string;
|
|
21
|
+
isConnected: boolean;
|
|
22
|
+
connectedAs?: string;
|
|
23
|
+
cliCommand?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Available AI providers - same as /app page
|
|
27
|
+
const AI_PROVIDERS: ProviderInfo[] = [
|
|
28
|
+
{ id: 'anthropic', name: 'Anthropic', displayName: 'Claude', color: '#D97757', cliCommand: 'claude', requiresUrlCopy: true },
|
|
29
|
+
{ id: 'codex', name: 'OpenAI', displayName: 'Codex', color: '#10A37F', cliCommand: 'codex login', requiresUrlCopy: true },
|
|
30
|
+
{ id: 'google', name: 'Google', displayName: 'Gemini', color: '#4285F4', cliCommand: 'gemini' },
|
|
31
|
+
{ id: 'opencode', name: 'OpenCode', displayName: 'OpenCode', color: '#00D4AA', cliCommand: 'opencode', comingSoon: true },
|
|
32
|
+
{ id: 'droid', name: 'Factory', displayName: 'Droid', color: '#6366F1', cliCommand: 'droid', comingSoon: true },
|
|
33
|
+
{ id: 'cursor', name: 'Cursor', displayName: 'Cursor', color: '#7C3AED', cliCommand: 'agent', requiresUrlCopy: true },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
// Loading fallback for Suspense
|
|
37
|
+
function ProvidersLoading() {
|
|
38
|
+
return (
|
|
39
|
+
<div className="min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center">
|
|
40
|
+
<div className="text-center">
|
|
41
|
+
<svg className="w-8 h-8 text-accent-cyan animate-spin mx-auto" fill="none" viewBox="0 0 24 24">
|
|
42
|
+
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
|
|
43
|
+
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
|
|
44
|
+
</svg>
|
|
45
|
+
<p className="mt-4 text-text-muted">Loading providers...</p>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Main content component that uses useSearchParams
|
|
52
|
+
function ProvidersContent() {
|
|
53
|
+
const searchParams = useSearchParams();
|
|
54
|
+
const workspaceId = searchParams.get('workspace');
|
|
55
|
+
|
|
56
|
+
const [loading, setLoading] = useState(true);
|
|
57
|
+
const [error, setError] = useState<string | null>(null);
|
|
58
|
+
const [csrfToken, setCsrfToken] = useState<string | null>(null);
|
|
59
|
+
const [connectedProviders, setConnectedProviders] = useState<string[]>([]);
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const fetchProviders = async () => {
|
|
63
|
+
try {
|
|
64
|
+
const res = await fetch('/api/providers', { credentials: 'include' });
|
|
65
|
+
|
|
66
|
+
// Capture CSRF token
|
|
67
|
+
const token = res.headers.get('X-CSRF-Token');
|
|
68
|
+
if (token) setCsrfToken(token);
|
|
69
|
+
|
|
70
|
+
if (!res.ok) {
|
|
71
|
+
if (res.status === 401) {
|
|
72
|
+
window.location.href = '/login';
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
throw new Error('Failed to fetch providers');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const data = await res.json();
|
|
79
|
+
// Extract connected provider IDs
|
|
80
|
+
const connected = (data.providers || [])
|
|
81
|
+
.filter((p: BackendProvider) => p.isConnected && p.id !== 'github')
|
|
82
|
+
.map((p: BackendProvider) => p.id);
|
|
83
|
+
setConnectedProviders(connected);
|
|
84
|
+
} catch (err) {
|
|
85
|
+
setError(err instanceof Error ? err.message : 'Failed to load providers');
|
|
86
|
+
} finally {
|
|
87
|
+
setLoading(false);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
fetchProviders();
|
|
92
|
+
}, []);
|
|
93
|
+
|
|
94
|
+
const handleProviderConnected = (providerId: string) => {
|
|
95
|
+
setConnectedProviders(prev => [...new Set([...prev, providerId])]);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const handleContinue = () => {
|
|
99
|
+
window.location.href = workspaceId ? `/app?workspace=${workspaceId}` : '/app';
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
if (loading) {
|
|
103
|
+
return (
|
|
104
|
+
<div className="min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center">
|
|
105
|
+
<div className="text-center">
|
|
106
|
+
<svg className="w-8 h-8 text-accent-cyan animate-spin mx-auto" fill="none" viewBox="0 0 24 24">
|
|
107
|
+
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
|
|
108
|
+
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
|
|
109
|
+
</svg>
|
|
110
|
+
<p className="mt-4 text-text-muted">Loading providers...</p>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<div className="min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex flex-col items-center justify-center p-4">
|
|
118
|
+
{/* Background grid */}
|
|
119
|
+
<div className="fixed inset-0 opacity-10 pointer-events-none">
|
|
120
|
+
<div
|
|
121
|
+
className="absolute inset-0"
|
|
122
|
+
style={{
|
|
123
|
+
backgroundImage: `linear-gradient(rgba(0, 217, 255, 0.1) 1px, transparent 1px),
|
|
124
|
+
linear-gradient(90deg, rgba(0, 217, 255, 0.1) 1px, transparent 1px)`,
|
|
125
|
+
backgroundSize: '50px 50px',
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div className="relative z-10 w-full max-w-xl">
|
|
131
|
+
{/* Logo */}
|
|
132
|
+
<div className="flex flex-col items-center mb-8">
|
|
133
|
+
<LogoIcon size={48} withGlow={true} />
|
|
134
|
+
<h1 className="mt-4 text-2xl font-bold text-white">Connect AI Providers</h1>
|
|
135
|
+
<p className="mt-2 text-text-muted text-center">
|
|
136
|
+
Connect your AI providers to start using agents.
|
|
137
|
+
</p>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
{error && (
|
|
141
|
+
<div className="mb-4 p-4 bg-error/10 border border-error/20 rounded-xl">
|
|
142
|
+
<p className="text-error">{error}</p>
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
145
|
+
|
|
146
|
+
{/* No workspace warning */}
|
|
147
|
+
{!workspaceId && (
|
|
148
|
+
<div className="mb-4 p-4 bg-warning/10 border border-warning/20 rounded-xl">
|
|
149
|
+
<p className="text-warning text-sm">
|
|
150
|
+
<strong>Note:</strong> CLI-based authentication requires a running workspace.
|
|
151
|
+
Please{' '}
|
|
152
|
+
<a href="/app" className="underline hover:no-underline">create a workspace</a> first.
|
|
153
|
+
</p>
|
|
154
|
+
</div>
|
|
155
|
+
)}
|
|
156
|
+
|
|
157
|
+
{/* Shared provider connection component */}
|
|
158
|
+
{workspaceId ? (
|
|
159
|
+
<ProviderConnectionList
|
|
160
|
+
providers={AI_PROVIDERS}
|
|
161
|
+
connectedProviders={connectedProviders}
|
|
162
|
+
workspaceId={workspaceId}
|
|
163
|
+
csrfToken={csrfToken || undefined}
|
|
164
|
+
onProviderConnected={handleProviderConnected}
|
|
165
|
+
onContinue={handleContinue}
|
|
166
|
+
showDetailedInfo={true}
|
|
167
|
+
/>
|
|
168
|
+
) : (
|
|
169
|
+
<div className="bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-2xl p-6 text-center">
|
|
170
|
+
<p className="text-text-muted mb-4">
|
|
171
|
+
A workspace is required to connect providers via CLI authentication.
|
|
172
|
+
</p>
|
|
173
|
+
<a
|
|
174
|
+
href="/app"
|
|
175
|
+
className="inline-block py-3 px-6 bg-gradient-to-r from-accent-cyan to-[#00b8d9] text-bg-deep font-semibold rounded-xl hover:shadow-glow-cyan transition-all"
|
|
176
|
+
>
|
|
177
|
+
Create a Workspace
|
|
178
|
+
</a>
|
|
179
|
+
</div>
|
|
180
|
+
)}
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Export page wrapped in Suspense for static generation
|
|
187
|
+
export default function ProvidersPage() {
|
|
188
|
+
return (
|
|
189
|
+
<Suspense fallback={<ProvidersLoading />}>
|
|
190
|
+
<ProvidersContent />
|
|
191
|
+
</Suspense>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Setup Client Component
|
|
3
|
+
*
|
|
4
|
+
* Full-page interactive terminal for provider authentication and setup.
|
|
5
|
+
* Uses the shared TerminalProviderSetup component.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use client';
|
|
9
|
+
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { useRouter, useSearchParams } from 'next/navigation';
|
|
12
|
+
import { LogoIcon } from '../../../../components/Logo';
|
|
13
|
+
import { TerminalProviderSetup } from '../../../../components/TerminalProviderSetup';
|
|
14
|
+
import { ProviderAuthFlow } from '../../../../components/ProviderAuthFlow';
|
|
15
|
+
import { PROVIDER_CONFIGS } from './constants';
|
|
16
|
+
|
|
17
|
+
// Provider auth configuration - determines which auth method to use
|
|
18
|
+
const PROVIDER_AUTH_CONFIG: Record<string, {
|
|
19
|
+
authMethod: 'terminal' | 'oauth';
|
|
20
|
+
requiresUrlCopy?: boolean;
|
|
21
|
+
}> = {
|
|
22
|
+
anthropic: { authMethod: 'oauth', requiresUrlCopy: true },
|
|
23
|
+
codex: { authMethod: 'oauth', requiresUrlCopy: true },
|
|
24
|
+
openai: { authMethod: 'oauth', requiresUrlCopy: true },
|
|
25
|
+
cursor: { authMethod: 'oauth', requiresUrlCopy: true },
|
|
26
|
+
// Gemini uses terminal - CLI shows interactive menu for OAuth vs API key
|
|
27
|
+
google: { authMethod: 'terminal' },
|
|
28
|
+
opencode: { authMethod: 'terminal' },
|
|
29
|
+
droid: { authMethod: 'terminal' },
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export interface ProviderSetupClientProps {
|
|
33
|
+
provider: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function ProviderSetupClient({ provider }: ProviderSetupClientProps) {
|
|
37
|
+
const router = useRouter();
|
|
38
|
+
const searchParams = useSearchParams();
|
|
39
|
+
const workspaceId = searchParams.get('workspace');
|
|
40
|
+
|
|
41
|
+
const config = PROVIDER_CONFIGS[provider];
|
|
42
|
+
|
|
43
|
+
if (!config) {
|
|
44
|
+
return (
|
|
45
|
+
<div className="min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center">
|
|
46
|
+
<div className="text-center">
|
|
47
|
+
<p className="text-error">Unknown provider: {provider}</p>
|
|
48
|
+
<a href="/providers" className="mt-4 text-accent-cyan hover:underline">
|
|
49
|
+
Back to providers
|
|
50
|
+
</a>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (!workspaceId) {
|
|
57
|
+
return (
|
|
58
|
+
<div className="min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center">
|
|
59
|
+
<div className="text-center">
|
|
60
|
+
<p className="text-error">No workspace specified</p>
|
|
61
|
+
<a href="/app" className="mt-4 text-accent-cyan hover:underline">
|
|
62
|
+
Back to dashboard
|
|
63
|
+
</a>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const handleSuccess = () => {
|
|
70
|
+
router.push(`/app?workspace=${workspaceId}`);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const handleCancel = () => {
|
|
74
|
+
router.push(`/app?workspace=${workspaceId}`);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const handleConnectAnother = () => {
|
|
78
|
+
// Navigate to providers page to select another provider
|
|
79
|
+
router.push(`/providers?workspace=${workspaceId}`);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// Get auth configuration for this provider
|
|
83
|
+
const authConfig = PROVIDER_AUTH_CONFIG[config.name];
|
|
84
|
+
const isOAuthProvider = authConfig?.authMethod === 'oauth';
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div className="min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] p-8">
|
|
88
|
+
<div className="max-w-4xl mx-auto">
|
|
89
|
+
{/* Header */}
|
|
90
|
+
<div className="flex items-center justify-between mb-8">
|
|
91
|
+
<a href="/app" className="flex items-center gap-3 group">
|
|
92
|
+
<LogoIcon className="w-8 h-8 text-accent-cyan group-hover:scale-105 transition-transform" />
|
|
93
|
+
<span className="text-lg font-bold text-white">Agent Relay</span>
|
|
94
|
+
</a>
|
|
95
|
+
<a
|
|
96
|
+
href={`/app?workspace=${workspaceId}`}
|
|
97
|
+
className="px-4 py-2 text-sm text-text-secondary hover:text-text-primary transition-colors"
|
|
98
|
+
>
|
|
99
|
+
Skip for now →
|
|
100
|
+
</a>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
{/* Title */}
|
|
104
|
+
<div className="text-center mb-8">
|
|
105
|
+
<div className="inline-flex items-center gap-3 mb-4">
|
|
106
|
+
<div
|
|
107
|
+
className="w-12 h-12 rounded-xl flex items-center justify-center text-white font-bold text-xl shadow-lg"
|
|
108
|
+
style={{
|
|
109
|
+
backgroundColor: config.color,
|
|
110
|
+
boxShadow: `0 4px 20px ${config.color}40`,
|
|
111
|
+
}}
|
|
112
|
+
>
|
|
113
|
+
{config.displayName[0]}
|
|
114
|
+
</div>
|
|
115
|
+
<h1 className="text-2xl font-bold text-white">
|
|
116
|
+
Set up {config.displayName}
|
|
117
|
+
</h1>
|
|
118
|
+
</div>
|
|
119
|
+
<p className="text-text-muted">
|
|
120
|
+
{isOAuthProvider
|
|
121
|
+
? 'Follow the instructions below to authenticate using your local terminal'
|
|
122
|
+
: 'Complete the authentication flow in the interactive terminal below'
|
|
123
|
+
}
|
|
124
|
+
</p>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
{/* Auth Component - OAuth or Terminal based on provider config */}
|
|
128
|
+
{isOAuthProvider ? (
|
|
129
|
+
<ProviderAuthFlow
|
|
130
|
+
provider={{
|
|
131
|
+
id: config.name,
|
|
132
|
+
name: config.name,
|
|
133
|
+
displayName: config.displayName,
|
|
134
|
+
color: config.color,
|
|
135
|
+
requiresUrlCopy: authConfig.requiresUrlCopy,
|
|
136
|
+
}}
|
|
137
|
+
workspaceId={workspaceId}
|
|
138
|
+
onSuccess={handleSuccess}
|
|
139
|
+
onCancel={handleCancel}
|
|
140
|
+
onError={(err) => console.error('Setup error:', err)}
|
|
141
|
+
/>
|
|
142
|
+
) : (
|
|
143
|
+
<TerminalProviderSetup
|
|
144
|
+
provider={{
|
|
145
|
+
id: config.id,
|
|
146
|
+
name: config.name,
|
|
147
|
+
displayName: config.displayName,
|
|
148
|
+
color: config.color,
|
|
149
|
+
}}
|
|
150
|
+
workspaceId={workspaceId}
|
|
151
|
+
maxHeight="500px"
|
|
152
|
+
showHeader={true}
|
|
153
|
+
onSuccess={handleSuccess}
|
|
154
|
+
onCancel={handleCancel}
|
|
155
|
+
onConnectAnother={handleConnectAnother}
|
|
156
|
+
onError={(err) => console.error('Setup error:', err)}
|
|
157
|
+
className="shadow-2xl"
|
|
158
|
+
/>
|
|
159
|
+
)}
|
|
160
|
+
|
|
161
|
+
{/* Help text */}
|
|
162
|
+
<div className="mt-6 p-4 bg-bg-primary/80 backdrop-blur-sm border border-border-subtle rounded-xl">
|
|
163
|
+
<h3 className="text-white font-medium mb-2">How this works:</h3>
|
|
164
|
+
{isOAuthProvider ? (
|
|
165
|
+
<ol className="text-sm text-text-muted space-y-1 list-decimal list-inside">
|
|
166
|
+
<li>Copy the command shown above and run it in your terminal</li>
|
|
167
|
+
<li>The CLI will open your browser automatically for OAuth login</li>
|
|
168
|
+
<li>Complete the authentication in your browser</li>
|
|
169
|
+
<li>The CLI will capture the callback and complete the setup</li>
|
|
170
|
+
<li>Return here to continue to the dashboard</li>
|
|
171
|
+
</ol>
|
|
172
|
+
) : (
|
|
173
|
+
<ol className="text-sm text-text-muted space-y-1 list-decimal list-inside">
|
|
174
|
+
<li>The terminal above is interactive - respond to any prompts by typing directly</li>
|
|
175
|
+
<li>When a login URL appears, copy and paste it into your browser</li>
|
|
176
|
+
<li>Complete the login in your browser, then return here</li>
|
|
177
|
+
<li>Answer any remaining prompts (skills, permissions, etc.) in the terminal</li>
|
|
178
|
+
<li>Once connected, click "Done - Continue" to go to the dashboard</li>
|
|
179
|
+
</ol>
|
|
180
|
+
)}
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
{/* Fallback link */}
|
|
184
|
+
<div className="mt-4 text-center">
|
|
185
|
+
<a
|
|
186
|
+
href={`/providers?connect=${config.id}&workspace=${workspaceId}`}
|
|
187
|
+
className="text-sm text-text-muted hover:text-accent-cyan transition-colors"
|
|
188
|
+
>
|
|
189
|
+
Having trouble? Try the popup-based login instead →
|
|
190
|
+
</a>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export default ProviderSetupClient;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider configurations for setup
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface ProviderConfig {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
color: string;
|
|
10
|
+
agentCommand: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const PROVIDER_CONFIGS: Record<string, ProviderConfig> = {
|
|
14
|
+
claude: {
|
|
15
|
+
id: 'claude',
|
|
16
|
+
name: 'anthropic',
|
|
17
|
+
displayName: 'Claude',
|
|
18
|
+
color: '#D97706',
|
|
19
|
+
agentCommand: 'claude',
|
|
20
|
+
},
|
|
21
|
+
codex: {
|
|
22
|
+
id: 'codex',
|
|
23
|
+
name: 'codex',
|
|
24
|
+
displayName: 'Codex',
|
|
25
|
+
color: '#10A37F',
|
|
26
|
+
agentCommand: 'codex',
|
|
27
|
+
},
|
|
28
|
+
cursor: {
|
|
29
|
+
id: 'cursor',
|
|
30
|
+
name: 'cursor',
|
|
31
|
+
displayName: 'Cursor',
|
|
32
|
+
color: '#7C3AED', // Purple for Cursor
|
|
33
|
+
agentCommand: 'cursor',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Setup Page (Server Component)
|
|
3
|
+
*
|
|
4
|
+
* Renders the client component with static params for Next.js export.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Suspense } from 'react';
|
|
8
|
+
import { ProviderSetupClient } from './ProviderSetupClient';
|
|
9
|
+
import { PROVIDER_CONFIGS } from './constants';
|
|
10
|
+
|
|
11
|
+
// Required for static export with dynamic routes
|
|
12
|
+
export function generateStaticParams() {
|
|
13
|
+
return Object.keys(PROVIDER_CONFIGS).map((provider) => ({
|
|
14
|
+
provider,
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function LoadingFallback() {
|
|
19
|
+
return (
|
|
20
|
+
<div className="min-h-screen bg-gradient-to-br from-[#0a0a0f] via-[#0d1117] to-[#0a0a0f] flex items-center justify-center">
|
|
21
|
+
<div className="flex items-center gap-3">
|
|
22
|
+
<svg className="w-6 h-6 text-accent-cyan animate-spin" fill="none" viewBox="0 0 24 24">
|
|
23
|
+
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
|
|
24
|
+
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
|
|
25
|
+
</svg>
|
|
26
|
+
<span className="text-text-muted">Loading setup...</span>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default function ProviderSetupPage({
|
|
33
|
+
params,
|
|
34
|
+
}: {
|
|
35
|
+
params: { provider: string };
|
|
36
|
+
}) {
|
|
37
|
+
return (
|
|
38
|
+
<Suspense fallback={<LoadingFallback />}>
|
|
39
|
+
<ProviderSetupClient provider={params.provider} />
|
|
40
|
+
</Suspense>
|
|
41
|
+
);
|
|
42
|
+
}
|