agent-relay 2.0.22 → 2.0.23
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/bin/relay-pty-linux-arm64 +0 -0
- package/dist/src/cli/index.d.ts +3 -3
- package/dist/src/cli/index.js +31 -100
- package/package.json +22 -29
- package/packages/api-types/package.json +1 -1
- package/packages/bridge/package.json +8 -8
- package/packages/cli-tester/package.json +1 -1
- package/packages/cloud/dist/server.js +25 -4
- package/packages/cloud/package.json +6 -6
- package/packages/config/package.json +2 -2
- package/packages/continuity/package.json +1 -1
- package/packages/daemon/dist/orchestrator.js +19 -1
- package/packages/daemon/package.json +12 -12
- package/packages/hooks/package.json +4 -4
- package/packages/mcp/package.json +2 -2
- package/packages/memory/package.json +2 -2
- package/packages/policy/package.json +2 -2
- package/packages/protocol/package.json +1 -1
- package/packages/resiliency/package.json +1 -1
- package/packages/sdk/package.json +2 -2
- package/packages/spawner/package.json +1 -1
- package/packages/state/package.json +1 -1
- package/packages/storage/package.json +2 -2
- package/packages/telemetry/package.json +1 -1
- package/packages/trajectory/package.json +2 -2
- package/packages/user-directory/package.json +2 -2
- package/packages/utils/dist/update-checker.js +4 -0
- package/packages/utils/package.json +1 -1
- package/packages/wrapper/package.json +6 -6
- package/deploy/workspace/codex.config.toml +0 -20
- package/deploy/workspace/entrypoint-browser.sh +0 -118
- package/deploy/workspace/entrypoint.sh +0 -612
- package/deploy/workspace/gh-credential-relay +0 -90
- package/deploy/workspace/gh-relay +0 -156
- package/deploy/workspace/git-credential-relay +0 -330
- package/deploy/workspace/git-credential-relay.test.sh +0 -230
- package/dist/dashboard/out/404.html +0 -1
- package/dist/dashboard/out/_next/static/91mkGYq3qbG8WHE6VytQ8/_buildManifest.js +0 -1
- package/dist/dashboard/out/_next/static/91mkGYq3qbG8WHE6VytQ8/_ssgManifest.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/116-a883fca163f3a5bc.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/117-c8afed19e821a35d.js +0 -2
- package/dist/dashboard/out/_next/static/chunks/282-980c2eb8fff20123.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/320-a6304232cd0ee2ce.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/532-bace199897eeab37.js +0 -9
- package/dist/dashboard/out/_next/static/chunks/631-16b905e5920f9b59.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/648-acb2ff9f77cbfbd3.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/766-2aea80818f7eb0d8.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/83-26d2bde54616ee90.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/847-f1f467060f32afff.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/891-5cb1513eeb97a891.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/_not-found/page-60501fddbafba9dc.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/onboarding/page-9914652442f7e4fb.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/page-366fb7c078d4e9e0.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/cloud/link/page-fa1d5842aa90e8a6.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/complete-profile/page-dd64bbdf66b639cd.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-113060009ef35bc2.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/history/page-9965d2483011b846.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/layout-6b91e33784c20610.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/login/page-435eceb0073be027.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-1e37ef8e73940b40.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/page-8119d4246743574e.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-9db3ebdfa567a7c9.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-ecb16ffd3b36262b.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/providers/setup/[provider]/page-4dbe33f0f7691b7c.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/signup/page-c7a0a28341365ae0.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +0 -18
- package/dist/dashboard/out/_next/static/chunks/fd9d1056-609918ca7b6280bb.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/framework-f66176bb897dc684.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/main-311c3db74dcfadb7.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/main-app-fdbeb09028f57c9f.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +0 -1
- package/dist/dashboard/out/_next/static/css/4034f236dd1a3178.css +0 -1
- package/dist/dashboard/out/_next/static/css/6892f8422896ef7a.css +0 -1
- package/dist/dashboard/out/alt-logos/agent-relay-logo-128.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-256.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-32.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-512.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo-64.png +0 -0
- package/dist/dashboard/out/alt-logos/agent-relay-logo.svg +0 -45
- package/dist/dashboard/out/alt-logos/logo.svg +0 -38
- package/dist/dashboard/out/alt-logos/monogram-logo-128.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-256.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-32.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-512.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo-64.png +0 -0
- package/dist/dashboard/out/alt-logos/monogram-logo.svg +0 -38
- package/dist/dashboard/out/app/onboarding.html +0 -1
- package/dist/dashboard/out/app/onboarding.txt +0 -7
- package/dist/dashboard/out/app.html +0 -1
- package/dist/dashboard/out/app.txt +0 -7
- package/dist/dashboard/out/apple-icon.png +0 -0
- package/dist/dashboard/out/cloud/link.html +0 -1
- package/dist/dashboard/out/cloud/link.txt +0 -7
- package/dist/dashboard/out/complete-profile.html +0 -5
- package/dist/dashboard/out/complete-profile.txt +0 -7
- package/dist/dashboard/out/connect-repos.html +0 -1
- package/dist/dashboard/out/connect-repos.txt +0 -7
- package/dist/dashboard/out/history.html +0 -1
- package/dist/dashboard/out/history.txt +0 -7
- package/dist/dashboard/out/index.html +0 -1
- package/dist/dashboard/out/index.txt +0 -7
- package/dist/dashboard/out/login.html +0 -5
- package/dist/dashboard/out/login.txt +0 -7
- package/dist/dashboard/out/metrics.html +0 -1
- package/dist/dashboard/out/metrics.txt +0 -7
- package/dist/dashboard/out/pricing.html +0 -13
- package/dist/dashboard/out/pricing.txt +0 -7
- package/dist/dashboard/out/providers/setup/claude.html +0 -1
- package/dist/dashboard/out/providers/setup/claude.txt +0 -8
- package/dist/dashboard/out/providers/setup/codex.html +0 -1
- package/dist/dashboard/out/providers/setup/codex.txt +0 -8
- package/dist/dashboard/out/providers/setup/cursor.html +0 -1
- package/dist/dashboard/out/providers/setup/cursor.txt +0 -8
- package/dist/dashboard/out/providers.html +0 -1
- package/dist/dashboard/out/providers.txt +0 -7
- package/dist/dashboard/out/signup.html +0 -6
- package/dist/dashboard/out/signup.txt +0 -7
- package/dist/src/dashboard-server/index.d.ts +0 -8
- package/dist/src/dashboard-server/index.js +0 -8
- package/packages/dashboard/README.md +0 -48
- package/packages/dashboard/dist/health-worker-manager.d.ts +0 -62
- package/packages/dashboard/dist/health-worker-manager.js +0 -144
- package/packages/dashboard/dist/health-worker.d.ts +0 -9
- package/packages/dashboard/dist/health-worker.js +0 -79
- package/packages/dashboard/dist/index.d.ts +0 -20
- package/packages/dashboard/dist/index.js +0 -19
- package/packages/dashboard/dist/metrics.d.ts +0 -105
- package/packages/dashboard/dist/metrics.js +0 -193
- package/packages/dashboard/dist/needs-attention.d.ts +0 -24
- package/packages/dashboard/dist/needs-attention.js +0 -78
- package/packages/dashboard/dist/server.d.ts +0 -25
- package/packages/dashboard/dist/server.js +0 -5270
- package/packages/dashboard/dist/start.d.ts +0 -6
- package/packages/dashboard/dist/start.js +0 -13
- package/packages/dashboard/dist/types/threading.d.ts +0 -8
- package/packages/dashboard/dist/types/threading.js +0 -2
- package/packages/dashboard/dist/user-bridge.d.ts +0 -154
- package/packages/dashboard/dist/user-bridge.js +0 -372
- package/packages/dashboard/package.json +0 -65
- package/packages/dashboard/ui/app/app/onboarding/page.tsx +0 -394
- package/packages/dashboard/ui/app/app/page.tsx +0 -667
- package/packages/dashboard/ui/app/apple-icon.png +0 -0
- package/packages/dashboard/ui/app/cloud/link/page.tsx +0 -464
- package/packages/dashboard/ui/app/complete-profile/page.tsx +0 -204
- package/packages/dashboard/ui/app/connect-repos/page.tsx +0 -410
- package/packages/dashboard/ui/app/favicon.png +0 -0
- package/packages/dashboard/ui/app/globals.css +0 -59
- package/packages/dashboard/ui/app/history/page.tsx +0 -658
- package/packages/dashboard/ui/app/layout.tsx +0 -25
- package/packages/dashboard/ui/app/login/page.tsx +0 -424
- package/packages/dashboard/ui/app/metrics/page.tsx +0 -751
- package/packages/dashboard/ui/app/page.tsx +0 -59
- package/packages/dashboard/ui/app/pricing/page.tsx +0 -7
- package/packages/dashboard/ui/app/providers/page.tsx +0 -193
- package/packages/dashboard/ui/app/providers/setup/[provider]/ProviderSetupClient.tsx +0 -148
- package/packages/dashboard/ui/app/providers/setup/[provider]/constants.ts +0 -35
- package/packages/dashboard/ui/app/providers/setup/[provider]/page.tsx +0 -42
- package/packages/dashboard/ui/app/signup/page.tsx +0 -533
- package/packages/dashboard/ui/index.ts +0 -49
- package/packages/dashboard/ui/landing/LandingPage.tsx +0 -713
- package/packages/dashboard/ui/landing/PricingPage.tsx +0 -559
- package/packages/dashboard/ui/landing/index.ts +0 -6
- package/packages/dashboard/ui/landing/styles.css +0 -2850
- package/packages/dashboard/ui/lib/agent-merge.ts +0 -35
- package/packages/dashboard/ui/lib/api.ts +0 -1155
- package/packages/dashboard/ui/lib/cloudApi.ts +0 -877
- package/packages/dashboard/ui/lib/colors.ts +0 -218
- package/packages/dashboard/ui/lib/hierarchy.ts +0 -242
- package/packages/dashboard/ui/lib/stuckDetection.ts +0 -142
- package/packages/dashboard/ui/next-env.d.ts +0 -5
- package/packages/dashboard/ui/next.config.js +0 -41
- package/packages/dashboard/ui/package-lock.json +0 -2882
- package/packages/dashboard/ui/package.json +0 -33
- package/packages/dashboard/ui/postcss.config.js +0 -5
- package/packages/dashboard/ui/react-components/ActivityFeed.tsx +0 -216
- package/packages/dashboard/ui/react-components/AddWorkspaceModal.tsx +0 -170
- package/packages/dashboard/ui/react-components/AgentCard.tsx +0 -587
- package/packages/dashboard/ui/react-components/AgentList.tsx +0 -411
- package/packages/dashboard/ui/react-components/AgentProfilePanel.tsx +0 -564
- package/packages/dashboard/ui/react-components/App.tsx +0 -3033
- package/packages/dashboard/ui/react-components/BillingPanel.tsx +0 -922
- package/packages/dashboard/ui/react-components/BillingResult.tsx +0 -447
- package/packages/dashboard/ui/react-components/BroadcastComposer.tsx +0 -690
- package/packages/dashboard/ui/react-components/ChannelAdminPanel.tsx +0 -773
- package/packages/dashboard/ui/react-components/ChannelBrowser.tsx +0 -385
- package/packages/dashboard/ui/react-components/ChannelChat.tsx +0 -261
- package/packages/dashboard/ui/react-components/ChannelSidebar.tsx +0 -399
- package/packages/dashboard/ui/react-components/CloudSessionProvider.tsx +0 -130
- package/packages/dashboard/ui/react-components/CommandPalette.tsx +0 -815
- package/packages/dashboard/ui/react-components/ConfirmationDialog.tsx +0 -133
- package/packages/dashboard/ui/react-components/ConversationHistory.tsx +0 -518
- package/packages/dashboard/ui/react-components/CoordinatorPanel.tsx +0 -944
- package/packages/dashboard/ui/react-components/DecisionQueue.tsx +0 -717
- package/packages/dashboard/ui/react-components/DirectMessageView.tsx +0 -164
- package/packages/dashboard/ui/react-components/FileAutocomplete.tsx +0 -368
- package/packages/dashboard/ui/react-components/FleetOverview.tsx +0 -278
- package/packages/dashboard/ui/react-components/LogViewer.tsx +0 -310
- package/packages/dashboard/ui/react-components/LogViewerPanel.tsx +0 -482
- package/packages/dashboard/ui/react-components/Logo.tsx +0 -284
- package/packages/dashboard/ui/react-components/MentionAutocomplete.tsx +0 -384
- package/packages/dashboard/ui/react-components/MessageComposer.tsx +0 -457
- package/packages/dashboard/ui/react-components/MessageList.tsx +0 -649
- package/packages/dashboard/ui/react-components/MessageSenderName.tsx +0 -91
- package/packages/dashboard/ui/react-components/MessageStatusIndicator.tsx +0 -142
- package/packages/dashboard/ui/react-components/NewConversationModal.tsx +0 -400
- package/packages/dashboard/ui/react-components/NotificationToast.tsx +0 -488
- package/packages/dashboard/ui/react-components/OnlineUsersIndicator.tsx +0 -164
- package/packages/dashboard/ui/react-components/Pagination.tsx +0 -124
- package/packages/dashboard/ui/react-components/PricingPlans.tsx +0 -386
- package/packages/dashboard/ui/react-components/ProjectList.tsx +0 -625
- package/packages/dashboard/ui/react-components/ProviderAuthFlow.tsx +0 -853
- package/packages/dashboard/ui/react-components/ProviderConnectionList.tsx +0 -378
- package/packages/dashboard/ui/react-components/ProvisioningProgress.tsx +0 -730
- package/packages/dashboard/ui/react-components/RepoAccessPanel.tsx +0 -549
- package/packages/dashboard/ui/react-components/ServerCard.tsx +0 -202
- package/packages/dashboard/ui/react-components/SessionExpiredModal.tsx +0 -128
- package/packages/dashboard/ui/react-components/SpawnModal.tsx +0 -804
- package/packages/dashboard/ui/react-components/TaskAssignmentUI.tsx +0 -375
- package/packages/dashboard/ui/react-components/TerminalProviderSetup.tsx +0 -608
- package/packages/dashboard/ui/react-components/ThemeProvider.tsx +0 -325
- package/packages/dashboard/ui/react-components/ThinkingIndicator.tsx +0 -231
- package/packages/dashboard/ui/react-components/ThreadList.tsx +0 -198
- package/packages/dashboard/ui/react-components/ThreadPanel.tsx +0 -346
- package/packages/dashboard/ui/react-components/TrajectoryViewer.tsx +0 -698
- package/packages/dashboard/ui/react-components/TypingIndicator.tsx +0 -69
- package/packages/dashboard/ui/react-components/UsageBanner.tsx +0 -231
- package/packages/dashboard/ui/react-components/UserProfilePanel.tsx +0 -233
- package/packages/dashboard/ui/react-components/WorkspaceContext.tsx +0 -107
- package/packages/dashboard/ui/react-components/WorkspaceSelector.tsx +0 -234
- package/packages/dashboard/ui/react-components/WorkspaceStatusIndicator.tsx +0 -370
- package/packages/dashboard/ui/react-components/XTermInteractive.tsx +0 -510
- package/packages/dashboard/ui/react-components/XTermLogViewer.tsx +0 -719
- package/packages/dashboard/ui/react-components/channels/ChannelDialogs.tsx +0 -1411
- package/packages/dashboard/ui/react-components/channels/ChannelHeader.tsx +0 -317
- package/packages/dashboard/ui/react-components/channels/ChannelMessageList.tsx +0 -463
- package/packages/dashboard/ui/react-components/channels/ChannelViewV1.tsx +0 -146
- package/packages/dashboard/ui/react-components/channels/MessageInput.tsx +0 -288
- package/packages/dashboard/ui/react-components/channels/SearchInput.tsx +0 -172
- package/packages/dashboard/ui/react-components/channels/SearchResults.tsx +0 -336
- package/packages/dashboard/ui/react-components/channels/api.ts +0 -697
- package/packages/dashboard/ui/react-components/channels/index.ts +0 -76
- package/packages/dashboard/ui/react-components/channels/mockApi.ts +0 -344
- package/packages/dashboard/ui/react-components/channels/types.ts +0 -566
- package/packages/dashboard/ui/react-components/hooks/index.ts +0 -57
- package/packages/dashboard/ui/react-components/hooks/useAgentLogs.ts +0 -394
- package/packages/dashboard/ui/react-components/hooks/useAgents.ts +0 -127
- package/packages/dashboard/ui/react-components/hooks/useBroadcastDedup.ts +0 -86
- package/packages/dashboard/ui/react-components/hooks/useChannelAdmin.ts +0 -329
- package/packages/dashboard/ui/react-components/hooks/useChannelBrowser.ts +0 -239
- package/packages/dashboard/ui/react-components/hooks/useChannelCommands.ts +0 -138
- package/packages/dashboard/ui/react-components/hooks/useChannels.ts +0 -328
- package/packages/dashboard/ui/react-components/hooks/useDebounce.ts +0 -29
- package/packages/dashboard/ui/react-components/hooks/useDirectMessage.ts +0 -141
- package/packages/dashboard/ui/react-components/hooks/useMessages.ts +0 -309
- package/packages/dashboard/ui/react-components/hooks/useOrchestrator.ts +0 -364
- package/packages/dashboard/ui/react-components/hooks/usePinnedAgents.ts +0 -140
- package/packages/dashboard/ui/react-components/hooks/usePresence.ts +0 -340
- package/packages/dashboard/ui/react-components/hooks/useRecentRepos.ts +0 -130
- package/packages/dashboard/ui/react-components/hooks/useSession.ts +0 -209
- package/packages/dashboard/ui/react-components/hooks/useTrajectory.ts +0 -265
- package/packages/dashboard/ui/react-components/hooks/useWebSocket.ts +0 -169
- package/packages/dashboard/ui/react-components/hooks/useWorkspaceMembers.ts +0 -120
- package/packages/dashboard/ui/react-components/hooks/useWorkspaceRepos.ts +0 -73
- package/packages/dashboard/ui/react-components/hooks/useWorkspaceStatus.ts +0 -237
- package/packages/dashboard/ui/react-components/index.ts +0 -81
- package/packages/dashboard/ui/react-components/layout/Header.tsx +0 -355
- package/packages/dashboard/ui/react-components/layout/RepoContextHeader.tsx +0 -361
- package/packages/dashboard/ui/react-components/layout/Sidebar.archive.test.tsx +0 -126
- package/packages/dashboard/ui/react-components/layout/Sidebar.test.tsx +0 -691
- package/packages/dashboard/ui/react-components/layout/Sidebar.tsx +0 -930
- package/packages/dashboard/ui/react-components/layout/index.ts +0 -7
- package/packages/dashboard/ui/react-components/settings/BillingSettingsPanel.tsx +0 -564
- package/packages/dashboard/ui/react-components/settings/SettingsPage.tsx +0 -544
- package/packages/dashboard/ui/react-components/settings/TeamSettingsPanel.tsx +0 -560
- package/packages/dashboard/ui/react-components/settings/WorkspaceSettingsPanel.tsx +0 -1386
- package/packages/dashboard/ui/react-components/settings/index.ts +0 -11
- package/packages/dashboard/ui/react-components/settings/types.ts +0 -53
- package/packages/dashboard/ui/react-components/utils/messageFormatting.tsx +0 -370
- package/packages/dashboard/ui/tailwind.config.js +0 -148
- package/packages/dashboard/ui/types/index.ts +0 -304
- package/packages/dashboard/ui/types/threading.ts +0 -7
- package/packages/dashboard/ui-dist/404.html +0 -1
- package/packages/dashboard/ui-dist/_next/static/91mkGYq3qbG8WHE6VytQ8/_buildManifest.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/91mkGYq3qbG8WHE6VytQ8/_ssgManifest.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/T2rV14eEU5OweDeV29SvG/_buildManifest.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/T2rV14eEU5OweDeV29SvG/_ssgManifest.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/116-a883fca163f3a5bc.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/117-c8afed19e821a35d.js +0 -2
- package/packages/dashboard/ui-dist/_next/static/chunks/282-980c2eb8fff20123.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/320-a6304232cd0ee2ce.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/532-bace199897eeab37.js +0 -9
- package/packages/dashboard/ui-dist/_next/static/chunks/631-16b905e5920f9b59.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/648-acb2ff9f77cbfbd3.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/766-2aea80818f7eb0d8.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/83-26d2bde54616ee90.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/847-f1f467060f32afff.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/891-5cb1513eeb97a891.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/_not-found/page-60501fddbafba9dc.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/app/onboarding/page-9914652442f7e4fb.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/app/page-366fb7c078d4e9e0.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/cloud/link/page-fa1d5842aa90e8a6.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/complete-profile/page-dd64bbdf66b639cd.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/connect-repos/page-113060009ef35bc2.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/history/page-9965d2483011b846.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/layout-6b91e33784c20610.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/login/page-435eceb0073be027.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/metrics/page-1e37ef8e73940b40.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/page-8119d4246743574e.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/pricing/page-9db3ebdfa567a7c9.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/providers/page-ecb16ffd3b36262b.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/providers/setup/[provider]/page-4dbe33f0f7691b7c.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/app/signup/page-c7a0a28341365ae0.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/e868780c-48e5f147c90a3a41.js +0 -18
- package/packages/dashboard/ui-dist/_next/static/chunks/fd9d1056-609918ca7b6280bb.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/framework-f66176bb897dc684.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/main-311c3db74dcfadb7.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/main-app-fdbeb09028f57c9f.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/css/4034f236dd1a3178.css +0 -1
- package/packages/dashboard/ui-dist/_next/static/css/6892f8422896ef7a.css +0 -1
- package/packages/dashboard/ui-dist/_next/static/l8L2OscDSR2vsMIlWcC48/_buildManifest.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/l8L2OscDSR2vsMIlWcC48/_ssgManifest.js +0 -1
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-128.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-256.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-32.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-512.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-64.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo.svg +0 -45
- package/packages/dashboard/ui-dist/alt-logos/logo.svg +0 -38
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-128.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-256.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-32.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-512.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo-64.png +0 -0
- package/packages/dashboard/ui-dist/alt-logos/monogram-logo.svg +0 -38
- package/packages/dashboard/ui-dist/app/onboarding.html +0 -1
- package/packages/dashboard/ui-dist/app/onboarding.txt +0 -7
- package/packages/dashboard/ui-dist/app.html +0 -1
- package/packages/dashboard/ui-dist/app.txt +0 -7
- package/packages/dashboard/ui-dist/apple-icon.png +0 -0
- package/packages/dashboard/ui-dist/cloud/link.html +0 -1
- package/packages/dashboard/ui-dist/cloud/link.txt +0 -7
- package/packages/dashboard/ui-dist/complete-profile.html +0 -5
- package/packages/dashboard/ui-dist/complete-profile.txt +0 -7
- package/packages/dashboard/ui-dist/connect-repos.html +0 -1
- package/packages/dashboard/ui-dist/connect-repos.txt +0 -7
- package/packages/dashboard/ui-dist/history.html +0 -1
- package/packages/dashboard/ui-dist/history.txt +0 -7
- package/packages/dashboard/ui-dist/index.html +0 -1
- package/packages/dashboard/ui-dist/index.txt +0 -7
- package/packages/dashboard/ui-dist/login.html +0 -5
- package/packages/dashboard/ui-dist/login.txt +0 -7
- package/packages/dashboard/ui-dist/metrics.html +0 -1
- package/packages/dashboard/ui-dist/metrics.txt +0 -7
- package/packages/dashboard/ui-dist/pricing.html +0 -13
- package/packages/dashboard/ui-dist/pricing.txt +0 -7
- package/packages/dashboard/ui-dist/providers/setup/claude.html +0 -1
- package/packages/dashboard/ui-dist/providers/setup/claude.txt +0 -8
- package/packages/dashboard/ui-dist/providers/setup/codex.html +0 -1
- package/packages/dashboard/ui-dist/providers/setup/codex.txt +0 -8
- package/packages/dashboard/ui-dist/providers/setup/cursor.html +0 -1
- package/packages/dashboard/ui-dist/providers/setup/cursor.txt +0 -8
- package/packages/dashboard/ui-dist/providers.html +0 -1
- package/packages/dashboard/ui-dist/providers.txt +0 -7
- package/packages/dashboard/ui-dist/signup.html +0 -6
- package/packages/dashboard/ui-dist/signup.txt +0 -7
- package/packages/dashboard-server/dist/health-worker-manager.d.ts +0 -62
- package/packages/dashboard-server/dist/health-worker-manager.js +0 -144
- package/packages/dashboard-server/dist/health-worker.d.ts +0 -9
- package/packages/dashboard-server/dist/health-worker.js +0 -79
- package/packages/dashboard-server/dist/index.d.ts +0 -18
- package/packages/dashboard-server/dist/index.js +0 -17
- package/packages/dashboard-server/dist/metrics.d.ts +0 -105
- package/packages/dashboard-server/dist/metrics.js +0 -193
- package/packages/dashboard-server/dist/needs-attention.d.ts +0 -24
- package/packages/dashboard-server/dist/needs-attention.js +0 -78
- package/packages/dashboard-server/dist/server.d.ts +0 -25
- package/packages/dashboard-server/dist/server.js +0 -5158
- package/packages/dashboard-server/dist/start.d.ts +0 -6
- package/packages/dashboard-server/dist/start.js +0 -13
- package/packages/dashboard-server/dist/types/threading.d.ts +0 -8
- package/packages/dashboard-server/dist/types/threading.js +0 -2
- package/packages/dashboard-server/dist/user-bridge.d.ts +0 -158
- package/packages/dashboard-server/dist/user-bridge.js +0 -390
- package/packages/dashboard-server/package.json +0 -55
|
@@ -1,608 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TerminalProviderSetup Component
|
|
3
|
-
*
|
|
4
|
-
* Reusable component for terminal-based provider authentication setup.
|
|
5
|
-
* Handles agent spawning, interactive terminal, auth URL detection, and cleanup.
|
|
6
|
-
*
|
|
7
|
-
* Used in:
|
|
8
|
-
* - /providers/setup/[provider] page (full-page setup)
|
|
9
|
-
* - WorkspaceSettingsPanel (embedded setup)
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import React, { useRef, useEffect, useCallback, useState } from 'react';
|
|
13
|
-
import { Terminal } from '@xterm/xterm';
|
|
14
|
-
import { FitAddon } from '@xterm/addon-fit';
|
|
15
|
-
|
|
16
|
-
export interface ProviderConfig {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
displayName: string;
|
|
20
|
-
color: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface TerminalProviderSetupProps {
|
|
24
|
-
/** Provider configuration */
|
|
25
|
-
provider: ProviderConfig;
|
|
26
|
-
/** Workspace ID to spawn agent in */
|
|
27
|
-
workspaceId: string;
|
|
28
|
-
/** CSRF token for API requests */
|
|
29
|
-
csrfToken?: string;
|
|
30
|
-
/** Maximum height of the terminal */
|
|
31
|
-
maxHeight?: string;
|
|
32
|
-
/** Called when authentication is detected as complete */
|
|
33
|
-
onSuccess?: () => void;
|
|
34
|
-
/** Called when an error occurs */
|
|
35
|
-
onError?: (error: string) => void;
|
|
36
|
-
/** Called when cancel is requested */
|
|
37
|
-
onCancel?: () => void;
|
|
38
|
-
/** Called when user wants to connect another provider */
|
|
39
|
-
onConnectAnother?: () => void;
|
|
40
|
-
/** Whether to show header with close button */
|
|
41
|
-
showHeader?: boolean;
|
|
42
|
-
/** Custom class name */
|
|
43
|
-
className?: string;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Terminal theme matching dashboard dark theme
|
|
47
|
-
const TERMINAL_THEME = {
|
|
48
|
-
background: '#0d0f14',
|
|
49
|
-
foreground: '#c9d1d9',
|
|
50
|
-
cursor: '#58a6ff',
|
|
51
|
-
cursorAccent: '#0d0f14',
|
|
52
|
-
selectionBackground: '#264f78',
|
|
53
|
-
selectionForeground: '#ffffff',
|
|
54
|
-
black: '#484f58',
|
|
55
|
-
red: '#f85149',
|
|
56
|
-
green: '#3fb950',
|
|
57
|
-
yellow: '#d29922',
|
|
58
|
-
blue: '#58a6ff',
|
|
59
|
-
magenta: '#bc8cff',
|
|
60
|
-
cyan: '#39c5cf',
|
|
61
|
-
white: '#b1bac4',
|
|
62
|
-
brightBlack: '#6e7681',
|
|
63
|
-
brightRed: '#ff7b72',
|
|
64
|
-
brightGreen: '#56d364',
|
|
65
|
-
brightYellow: '#e3b341',
|
|
66
|
-
brightBlue: '#79c0ff',
|
|
67
|
-
brightMagenta: '#d2a8ff',
|
|
68
|
-
brightCyan: '#56d4dd',
|
|
69
|
-
brightWhite: '#ffffff',
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// Auth URL patterns to detect
|
|
73
|
-
const AUTH_URL_PATTERNS = [
|
|
74
|
-
/https:\/\/console\.anthropic\.com\/oauth/i,
|
|
75
|
-
/https:\/\/auth\.openai\.com/i,
|
|
76
|
-
/https:\/\/accounts\.google\.com/i,
|
|
77
|
-
/https:\/\/github\.com\/login\/oauth/i,
|
|
78
|
-
/https:\/\/[^\s]+\/oauth/i,
|
|
79
|
-
/https:\/\/[^\s]+\/auth/i,
|
|
80
|
-
/https:\/\/[^\s]+\/login/i,
|
|
81
|
-
];
|
|
82
|
-
|
|
83
|
-
export function TerminalProviderSetup({
|
|
84
|
-
provider,
|
|
85
|
-
workspaceId,
|
|
86
|
-
csrfToken: initialCsrfToken,
|
|
87
|
-
maxHeight = '400px',
|
|
88
|
-
onSuccess,
|
|
89
|
-
onError,
|
|
90
|
-
onCancel,
|
|
91
|
-
onConnectAnother,
|
|
92
|
-
showHeader = true,
|
|
93
|
-
className = '',
|
|
94
|
-
}: TerminalProviderSetupProps) {
|
|
95
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
96
|
-
const terminalRef = useRef<Terminal | null>(null);
|
|
97
|
-
const fitAddonRef = useRef<FitAddon | null>(null);
|
|
98
|
-
const wsRef = useRef<WebSocket | null>(null);
|
|
99
|
-
const reconnectTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
|
100
|
-
const shownAuthUrlsRef = useRef<Set<string>>(new Set());
|
|
101
|
-
const hasShownConnectedRef = useRef(false); // Prevent duplicate "Connected" messages
|
|
102
|
-
const onDataDisposableRef = useRef<{ dispose: () => void } | null>(null); // Track onData handler for cleanup
|
|
103
|
-
|
|
104
|
-
const [isSpawning, setIsSpawning] = useState(false);
|
|
105
|
-
const [isConnected, setIsConnected] = useState(false);
|
|
106
|
-
const [isConnecting, setIsConnecting] = useState(false);
|
|
107
|
-
const [error, setError] = useState<string | null>(null);
|
|
108
|
-
const [agentName, setAgentName] = useState<string | null>(null);
|
|
109
|
-
const [authUrl, setAuthUrl] = useState<string | null>(null);
|
|
110
|
-
const [showAuthModal, setShowAuthModal] = useState(false);
|
|
111
|
-
const [authModalDismissed, setAuthModalDismissed] = useState(false);
|
|
112
|
-
const [isComplete, setIsComplete] = useState(false);
|
|
113
|
-
const [csrfToken, setCsrfToken] = useState<string | undefined>(initialCsrfToken);
|
|
114
|
-
|
|
115
|
-
// Generate unique agent name
|
|
116
|
-
const generateAgentName = useCallback(() => {
|
|
117
|
-
const timestamp = Date.now().toString(36);
|
|
118
|
-
const random = Math.random().toString(36).substring(2, 6);
|
|
119
|
-
return `__setup__${provider.id}-${timestamp}${random}`;
|
|
120
|
-
}, [provider.id]);
|
|
121
|
-
|
|
122
|
-
// Fetch CSRF token if not provided
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
if (!csrfToken) {
|
|
125
|
-
fetch('/api/auth/session', { credentials: 'include' })
|
|
126
|
-
.then(res => {
|
|
127
|
-
const token = res.headers.get('X-CSRF-Token');
|
|
128
|
-
if (token) setCsrfToken(token);
|
|
129
|
-
})
|
|
130
|
-
.catch(() => {});
|
|
131
|
-
}
|
|
132
|
-
}, [csrfToken]);
|
|
133
|
-
|
|
134
|
-
// Cleanup agent
|
|
135
|
-
const cleanupAgent = useCallback(async () => {
|
|
136
|
-
if (!workspaceId || !agentName) return;
|
|
137
|
-
|
|
138
|
-
try {
|
|
139
|
-
const headers: Record<string, string> = {};
|
|
140
|
-
if (csrfToken) headers['X-CSRF-Token'] = csrfToken;
|
|
141
|
-
|
|
142
|
-
await fetch(`/api/workspaces/${workspaceId}/agents/${encodeURIComponent(agentName)}`, {
|
|
143
|
-
method: 'DELETE',
|
|
144
|
-
credentials: 'include',
|
|
145
|
-
headers,
|
|
146
|
-
});
|
|
147
|
-
} catch {
|
|
148
|
-
// Ignore cleanup errors
|
|
149
|
-
}
|
|
150
|
-
}, [workspaceId, agentName, csrfToken]);
|
|
151
|
-
|
|
152
|
-
// Spawn agent
|
|
153
|
-
const spawnAgent = useCallback(async () => {
|
|
154
|
-
if (!workspaceId || !csrfToken) return;
|
|
155
|
-
|
|
156
|
-
setIsSpawning(true);
|
|
157
|
-
setError(null);
|
|
158
|
-
|
|
159
|
-
const name = generateAgentName();
|
|
160
|
-
|
|
161
|
-
try {
|
|
162
|
-
const headers: Record<string, string> = { 'Content-Type': 'application/json' };
|
|
163
|
-
if (csrfToken) headers['X-CSRF-Token'] = csrfToken;
|
|
164
|
-
|
|
165
|
-
const res = await fetch(`/api/workspaces/${workspaceId}/agents`, {
|
|
166
|
-
method: 'POST',
|
|
167
|
-
credentials: 'include',
|
|
168
|
-
headers,
|
|
169
|
-
body: JSON.stringify({
|
|
170
|
-
name,
|
|
171
|
-
provider: provider.id === 'anthropic' ? 'claude' : provider.id,
|
|
172
|
-
interactive: true, // Disable auto-accept prompts
|
|
173
|
-
}),
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
if (!res.ok) {
|
|
177
|
-
const data = await res.json();
|
|
178
|
-
throw new Error(data.error || 'Failed to spawn agent');
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
setAgentName(name);
|
|
182
|
-
} catch (err) {
|
|
183
|
-
const message = err instanceof Error ? err.message : 'Failed to spawn agent';
|
|
184
|
-
setError(message);
|
|
185
|
-
onError?.(message);
|
|
186
|
-
} finally {
|
|
187
|
-
setIsSpawning(false);
|
|
188
|
-
}
|
|
189
|
-
}, [workspaceId, csrfToken, provider.id, generateAgentName, onError]);
|
|
190
|
-
|
|
191
|
-
// Initialize terminal
|
|
192
|
-
useEffect(() => {
|
|
193
|
-
if (!containerRef.current) return;
|
|
194
|
-
|
|
195
|
-
const terminal = new Terminal({
|
|
196
|
-
theme: TERMINAL_THEME,
|
|
197
|
-
fontFamily: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',
|
|
198
|
-
fontSize: 12,
|
|
199
|
-
lineHeight: 1.4,
|
|
200
|
-
convertEol: true,
|
|
201
|
-
scrollback: 10000,
|
|
202
|
-
cursorBlink: true,
|
|
203
|
-
cursorStyle: 'block',
|
|
204
|
-
disableStdin: false,
|
|
205
|
-
allowProposedApi: true,
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
const fitAddon = new FitAddon();
|
|
209
|
-
terminal.loadAddon(fitAddon);
|
|
210
|
-
terminal.open(containerRef.current);
|
|
211
|
-
fitAddon.fit();
|
|
212
|
-
|
|
213
|
-
terminalRef.current = terminal;
|
|
214
|
-
fitAddonRef.current = fitAddon;
|
|
215
|
-
|
|
216
|
-
// Handle resize
|
|
217
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
218
|
-
fitAddon.fit();
|
|
219
|
-
});
|
|
220
|
-
resizeObserver.observe(containerRef.current);
|
|
221
|
-
|
|
222
|
-
return () => {
|
|
223
|
-
resizeObserver.disconnect();
|
|
224
|
-
terminal.dispose();
|
|
225
|
-
terminalRef.current = null;
|
|
226
|
-
fitAddonRef.current = null;
|
|
227
|
-
};
|
|
228
|
-
}, []);
|
|
229
|
-
|
|
230
|
-
// Ref to hold authModalDismissed state for use in callbacks without causing re-renders
|
|
231
|
-
const authModalDismissedRef = useRef(authModalDismissed);
|
|
232
|
-
authModalDismissedRef.current = authModalDismissed;
|
|
233
|
-
|
|
234
|
-
// Detect auth URLs in output - uses ref to avoid dependency on authModalDismissed
|
|
235
|
-
const detectAuthUrl = useCallback((content: string) => {
|
|
236
|
-
// Don't show modal if user already dismissed it
|
|
237
|
-
if (authModalDismissedRef.current) return false;
|
|
238
|
-
|
|
239
|
-
for (const pattern of AUTH_URL_PATTERNS) {
|
|
240
|
-
const match = content.match(pattern);
|
|
241
|
-
if (match) {
|
|
242
|
-
// Extract full URL
|
|
243
|
-
const urlMatch = content.match(/https:\/\/[^\s\])"']+/i);
|
|
244
|
-
if (urlMatch) {
|
|
245
|
-
const url = urlMatch[0];
|
|
246
|
-
// Only show modal once per unique URL
|
|
247
|
-
if (!shownAuthUrlsRef.current.has(url)) {
|
|
248
|
-
shownAuthUrlsRef.current.add(url);
|
|
249
|
-
setAuthUrl(url);
|
|
250
|
-
setShowAuthModal(true);
|
|
251
|
-
return true;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
return false;
|
|
257
|
-
}, []); // No dependencies - uses ref for mutable state
|
|
258
|
-
|
|
259
|
-
// Connect WebSocket when agent is spawned
|
|
260
|
-
useEffect(() => {
|
|
261
|
-
if (!agentName || !workspaceId) return;
|
|
262
|
-
|
|
263
|
-
// Reset the connected message flag when agent changes
|
|
264
|
-
hasShownConnectedRef.current = false;
|
|
265
|
-
|
|
266
|
-
const connectWebSocket = () => {
|
|
267
|
-
// Don't reconnect if we already have an open connection
|
|
268
|
-
if (wsRef.current?.readyState === WebSocket.OPEN) {
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
273
|
-
const wsUrl = `${protocol}//${window.location.host}/ws/logs/${encodeURIComponent(workspaceId)}/${encodeURIComponent(agentName)}`;
|
|
274
|
-
|
|
275
|
-
setIsConnecting(true);
|
|
276
|
-
const ws = new WebSocket(wsUrl);
|
|
277
|
-
wsRef.current = ws;
|
|
278
|
-
|
|
279
|
-
ws.onopen = () => {
|
|
280
|
-
setIsConnected(true);
|
|
281
|
-
setIsConnecting(false);
|
|
282
|
-
// Only show connected message once per session
|
|
283
|
-
if (!hasShownConnectedRef.current) {
|
|
284
|
-
hasShownConnectedRef.current = true;
|
|
285
|
-
terminalRef.current?.writeln('\x1b[90m[Connected - Interactive Mode]\x1b[0m');
|
|
286
|
-
terminalRef.current?.writeln('\x1b[90m[Type directly to respond to prompts]\x1b[0m\n');
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
ws.onclose = () => {
|
|
291
|
-
setIsConnected(false);
|
|
292
|
-
setIsConnecting(false);
|
|
293
|
-
|
|
294
|
-
// Reconnect after delay (only if not intentionally closed)
|
|
295
|
-
reconnectTimeoutRef.current = setTimeout(connectWebSocket, 2000);
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
ws.onmessage = (event) => {
|
|
299
|
-
try {
|
|
300
|
-
const data = JSON.parse(event.data);
|
|
301
|
-
|
|
302
|
-
if (data.type === 'history' && Array.isArray(data.lines)) {
|
|
303
|
-
data.lines.forEach((line: string) => {
|
|
304
|
-
terminalRef.current?.writeln(line);
|
|
305
|
-
detectAuthUrl(line);
|
|
306
|
-
});
|
|
307
|
-
} else if (data.type === 'log' || data.type === 'output') {
|
|
308
|
-
const content = data.content || data.data || data.message || '';
|
|
309
|
-
if (content) {
|
|
310
|
-
terminalRef.current?.write(content);
|
|
311
|
-
detectAuthUrl(content);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
} catch {
|
|
315
|
-
if (typeof event.data === 'string') {
|
|
316
|
-
terminalRef.current?.write(event.data);
|
|
317
|
-
detectAuthUrl(event.data);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
// Clean up previous onData handler before adding new one
|
|
323
|
-
if (onDataDisposableRef.current) {
|
|
324
|
-
onDataDisposableRef.current.dispose();
|
|
325
|
-
onDataDisposableRef.current = null;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// Handle user input - store disposable for cleanup
|
|
329
|
-
if (terminalRef.current) {
|
|
330
|
-
onDataDisposableRef.current = terminalRef.current.onData((data: string) => {
|
|
331
|
-
if (ws.readyState === WebSocket.OPEN) {
|
|
332
|
-
ws.send(JSON.stringify({ type: 'input', agent: agentName, data }));
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
connectWebSocket();
|
|
339
|
-
|
|
340
|
-
return () => {
|
|
341
|
-
if (reconnectTimeoutRef.current) {
|
|
342
|
-
clearTimeout(reconnectTimeoutRef.current);
|
|
343
|
-
reconnectTimeoutRef.current = null;
|
|
344
|
-
}
|
|
345
|
-
if (onDataDisposableRef.current) {
|
|
346
|
-
onDataDisposableRef.current.dispose();
|
|
347
|
-
onDataDisposableRef.current = null;
|
|
348
|
-
}
|
|
349
|
-
wsRef.current?.close();
|
|
350
|
-
wsRef.current = null;
|
|
351
|
-
};
|
|
352
|
-
}, [agentName, workspaceId, detectAuthUrl]);
|
|
353
|
-
|
|
354
|
-
// Auto-spawn on mount
|
|
355
|
-
useEffect(() => {
|
|
356
|
-
if (csrfToken && !agentName && !isSpawning) {
|
|
357
|
-
spawnAgent();
|
|
358
|
-
}
|
|
359
|
-
}, [csrfToken, agentName, isSpawning, spawnAgent]);
|
|
360
|
-
|
|
361
|
-
// Cleanup on unmount
|
|
362
|
-
useEffect(() => {
|
|
363
|
-
return () => {
|
|
364
|
-
cleanupAgent();
|
|
365
|
-
};
|
|
366
|
-
}, [cleanupAgent]);
|
|
367
|
-
|
|
368
|
-
const handleOpenAuthUrl = useCallback(() => {
|
|
369
|
-
if (authUrl) {
|
|
370
|
-
window.open(authUrl, '_blank', 'width=600,height=700');
|
|
371
|
-
setShowAuthModal(false); // Close modal after opening URL
|
|
372
|
-
}
|
|
373
|
-
}, [authUrl]);
|
|
374
|
-
|
|
375
|
-
const handleComplete = useCallback(async () => {
|
|
376
|
-
// Mark provider as connected in the database
|
|
377
|
-
// Use provider.name (anthropic/openai) not provider.id (claude/codex)
|
|
378
|
-
const providerName = provider.name || provider.id;
|
|
379
|
-
try {
|
|
380
|
-
const headers: Record<string, string> = { 'Content-Type': 'application/json' };
|
|
381
|
-
if (csrfToken) headers['X-CSRF-Token'] = csrfToken;
|
|
382
|
-
|
|
383
|
-
const response = await fetch(`/api/onboarding/mark-connected/${providerName}`, {
|
|
384
|
-
method: 'POST',
|
|
385
|
-
credentials: 'include',
|
|
386
|
-
headers,
|
|
387
|
-
body: JSON.stringify({ workspaceId }),
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
if (!response.ok) {
|
|
391
|
-
console.error('Failed to mark provider as connected:', await response.text());
|
|
392
|
-
}
|
|
393
|
-
} catch (err) {
|
|
394
|
-
console.error('Error marking provider as connected:', err);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
await cleanupAgent();
|
|
398
|
-
setIsComplete(true);
|
|
399
|
-
}, [cleanupAgent, provider.id, provider.name, csrfToken, workspaceId]);
|
|
400
|
-
|
|
401
|
-
const handleDone = useCallback(() => {
|
|
402
|
-
onSuccess?.();
|
|
403
|
-
}, [onSuccess]);
|
|
404
|
-
|
|
405
|
-
const handleConnectAnother = useCallback(() => {
|
|
406
|
-
onConnectAnother?.();
|
|
407
|
-
}, [onConnectAnother]);
|
|
408
|
-
|
|
409
|
-
const handleCancel = useCallback(async () => {
|
|
410
|
-
await cleanupAgent();
|
|
411
|
-
onCancel?.();
|
|
412
|
-
}, [cleanupAgent, onCancel]);
|
|
413
|
-
|
|
414
|
-
return (
|
|
415
|
-
<div className={`flex flex-col rounded-xl overflow-hidden border border-border-subtle ${className}`}>
|
|
416
|
-
{/* Header */}
|
|
417
|
-
{showHeader && (
|
|
418
|
-
<div className="flex items-center justify-between px-4 py-3 border-b border-border-subtle bg-bg-tertiary">
|
|
419
|
-
<div className="flex items-center gap-3">
|
|
420
|
-
<div
|
|
421
|
-
className="w-8 h-8 rounded-lg flex items-center justify-center text-white font-bold text-sm"
|
|
422
|
-
style={{ backgroundColor: provider.color }}
|
|
423
|
-
>
|
|
424
|
-
{provider.displayName[0]}
|
|
425
|
-
</div>
|
|
426
|
-
<div>
|
|
427
|
-
<h4 className="text-sm font-semibold text-text-primary">
|
|
428
|
-
{provider.displayName} Setup
|
|
429
|
-
</h4>
|
|
430
|
-
<p className="text-xs text-text-muted">Interactive terminal</p>
|
|
431
|
-
</div>
|
|
432
|
-
</div>
|
|
433
|
-
<div className="flex items-center gap-2">
|
|
434
|
-
{isConnected && (
|
|
435
|
-
<span className="flex items-center gap-1 px-2 py-1 rounded-full bg-success/15 text-xs text-success">
|
|
436
|
-
<span className="w-1.5 h-1.5 rounded-full bg-success animate-pulse" />
|
|
437
|
-
Connected
|
|
438
|
-
</span>
|
|
439
|
-
)}
|
|
440
|
-
{onCancel && (
|
|
441
|
-
<button
|
|
442
|
-
onClick={handleCancel}
|
|
443
|
-
className="p-1.5 rounded-lg hover:bg-bg-hover text-text-muted hover:text-text-primary transition-colors"
|
|
444
|
-
>
|
|
445
|
-
<CloseIcon />
|
|
446
|
-
</button>
|
|
447
|
-
)}
|
|
448
|
-
</div>
|
|
449
|
-
</div>
|
|
450
|
-
)}
|
|
451
|
-
|
|
452
|
-
{/* Success State */}
|
|
453
|
-
{isComplete ? (
|
|
454
|
-
<div className="flex flex-col items-center justify-center py-12 px-6">
|
|
455
|
-
<div
|
|
456
|
-
className="w-16 h-16 rounded-full flex items-center justify-center mb-4"
|
|
457
|
-
style={{ backgroundColor: `${provider.color}20` }}
|
|
458
|
-
>
|
|
459
|
-
<CheckIcon className="w-8 h-8" style={{ color: provider.color }} />
|
|
460
|
-
</div>
|
|
461
|
-
<h3 className="text-lg font-semibold text-text-primary mb-2">
|
|
462
|
-
{provider.displayName} Connected!
|
|
463
|
-
</h3>
|
|
464
|
-
<p className="text-sm text-text-muted mb-6 text-center">
|
|
465
|
-
Your {provider.displayName} account has been successfully connected.
|
|
466
|
-
</p>
|
|
467
|
-
<div className="flex gap-3">
|
|
468
|
-
{onConnectAnother && (
|
|
469
|
-
<button
|
|
470
|
-
onClick={handleConnectAnother}
|
|
471
|
-
className="px-4 py-2 bg-bg-hover text-text-primary text-sm font-medium rounded-lg hover:bg-bg-tertiary transition-colors border border-border-subtle"
|
|
472
|
-
>
|
|
473
|
-
Connect Another Provider
|
|
474
|
-
</button>
|
|
475
|
-
)}
|
|
476
|
-
<button
|
|
477
|
-
onClick={handleDone}
|
|
478
|
-
className="px-4 py-2 bg-accent-cyan text-bg-deep text-sm font-semibold rounded-lg hover:bg-accent-cyan/90 transition-colors"
|
|
479
|
-
>
|
|
480
|
-
Continue to Dashboard
|
|
481
|
-
</button>
|
|
482
|
-
</div>
|
|
483
|
-
</div>
|
|
484
|
-
) : (
|
|
485
|
-
<>
|
|
486
|
-
{/* Error */}
|
|
487
|
-
{error && (
|
|
488
|
-
<div className="px-4 py-3 bg-error/10 border-b border-error/30 text-sm text-error flex items-center gap-2">
|
|
489
|
-
<AlertIcon />
|
|
490
|
-
<span>{error}</span>
|
|
491
|
-
<button
|
|
492
|
-
onClick={spawnAgent}
|
|
493
|
-
className="ml-auto text-xs px-2 py-1 rounded bg-error/20 hover:bg-error/30 transition-colors"
|
|
494
|
-
>
|
|
495
|
-
Retry
|
|
496
|
-
</button>
|
|
497
|
-
</div>
|
|
498
|
-
)}
|
|
499
|
-
|
|
500
|
-
{/* Spawning indicator */}
|
|
501
|
-
{isSpawning && (
|
|
502
|
-
<div className="px-4 py-3 bg-accent-cyan/10 border-b border-accent-cyan/30 text-sm text-accent-cyan flex items-center gap-2">
|
|
503
|
-
<div className="w-4 h-4 border-2 border-accent-cyan/30 border-t-accent-cyan rounded-full animate-spin" />
|
|
504
|
-
<span>Starting {provider.displayName}...</span>
|
|
505
|
-
</div>
|
|
506
|
-
)}
|
|
507
|
-
|
|
508
|
-
{/* Terminal */}
|
|
509
|
-
<div
|
|
510
|
-
ref={containerRef}
|
|
511
|
-
className="flex-1 bg-[#0d0f14]"
|
|
512
|
-
style={{ minHeight: '300px', maxHeight }}
|
|
513
|
-
onClick={() => terminalRef.current?.focus()}
|
|
514
|
-
/>
|
|
515
|
-
|
|
516
|
-
{/* Footer with actions */}
|
|
517
|
-
<div className="flex items-center justify-between px-4 py-3 border-t border-border-subtle bg-bg-tertiary">
|
|
518
|
-
<p className="text-xs text-text-muted">
|
|
519
|
-
Respond to prompts above to complete setup
|
|
520
|
-
</p>
|
|
521
|
-
<button
|
|
522
|
-
onClick={handleComplete}
|
|
523
|
-
className="px-4 py-2 bg-accent-cyan text-bg-deep text-sm font-semibold rounded-lg hover:bg-accent-cyan/90 transition-colors"
|
|
524
|
-
>
|
|
525
|
-
Done - Continue
|
|
526
|
-
</button>
|
|
527
|
-
</div>
|
|
528
|
-
</>
|
|
529
|
-
)}
|
|
530
|
-
|
|
531
|
-
{/* Auth URL Modal */}
|
|
532
|
-
{showAuthModal && authUrl && (
|
|
533
|
-
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm">
|
|
534
|
-
<div className="bg-bg-primary border border-border-subtle rounded-xl p-6 max-w-md w-full mx-4 shadow-2xl">
|
|
535
|
-
<div className="flex items-center gap-3 mb-4">
|
|
536
|
-
<div
|
|
537
|
-
className="w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold"
|
|
538
|
-
style={{ backgroundColor: provider.color }}
|
|
539
|
-
>
|
|
540
|
-
{provider.displayName[0]}
|
|
541
|
-
</div>
|
|
542
|
-
<div>
|
|
543
|
-
<h3 className="text-white font-medium">Login URL Detected</h3>
|
|
544
|
-
<p className="text-sm text-text-muted">We found a login link in the terminal</p>
|
|
545
|
-
</div>
|
|
546
|
-
</div>
|
|
547
|
-
|
|
548
|
-
<p className="text-sm text-text-muted mb-4">
|
|
549
|
-
{provider.displayName} is asking you to sign in. Click below to open the login page.
|
|
550
|
-
</p>
|
|
551
|
-
|
|
552
|
-
<div className="flex gap-3">
|
|
553
|
-
<button
|
|
554
|
-
onClick={handleOpenAuthUrl}
|
|
555
|
-
className="flex-1 py-2 px-4 bg-accent-cyan text-bg-deep font-semibold rounded-lg hover:bg-accent-cyan/90 transition-colors"
|
|
556
|
-
>
|
|
557
|
-
Open Login Page
|
|
558
|
-
</button>
|
|
559
|
-
<button
|
|
560
|
-
onClick={() => {
|
|
561
|
-
setShowAuthModal(false);
|
|
562
|
-
setAuthModalDismissed(true);
|
|
563
|
-
}}
|
|
564
|
-
className="px-4 py-2 bg-bg-hover text-text-secondary rounded-lg hover:bg-bg-tertiary transition-colors"
|
|
565
|
-
>
|
|
566
|
-
Dismiss
|
|
567
|
-
</button>
|
|
568
|
-
</div>
|
|
569
|
-
|
|
570
|
-
<p className="text-xs text-text-muted mt-3">
|
|
571
|
-
Or copy the URL from the terminal and open it manually.
|
|
572
|
-
</p>
|
|
573
|
-
</div>
|
|
574
|
-
</div>
|
|
575
|
-
)}
|
|
576
|
-
</div>
|
|
577
|
-
);
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
// Icons
|
|
581
|
-
function CloseIcon() {
|
|
582
|
-
return (
|
|
583
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
584
|
-
<line x1="18" y1="6" x2="6" y2="18" />
|
|
585
|
-
<line x1="6" y1="6" x2="18" y2="18" />
|
|
586
|
-
</svg>
|
|
587
|
-
);
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
function AlertIcon() {
|
|
591
|
-
return (
|
|
592
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
|
593
|
-
<circle cx="12" cy="12" r="10" />
|
|
594
|
-
<line x1="12" y1="8" x2="12" y2="12" />
|
|
595
|
-
<line x1="12" y1="16" x2="12.01" y2="16" />
|
|
596
|
-
</svg>
|
|
597
|
-
);
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
function CheckIcon({ className, style }: { className?: string; style?: React.CSSProperties }) {
|
|
601
|
-
return (
|
|
602
|
-
<svg className={className} style={style} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
|
|
603
|
-
<polyline points="20 6 9 17 4 12" />
|
|
604
|
-
</svg>
|
|
605
|
-
);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
export default TerminalProviderSetup;
|