agent-relay 2.0.21 → 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 +21 -1
- package/packages/daemon/dist/router.d.ts +5 -0
- package/packages/daemon/dist/router.js +31 -0
- package/packages/daemon/dist/server.d.ts +5 -0
- package/packages/daemon/dist/server.js +131 -1
- package/packages/daemon/package.json +12 -12
- package/packages/hooks/package.json +4 -4
- package/packages/mcp/dist/client.d.ts +15 -0
- package/packages/mcp/dist/client.js +9 -0
- package/packages/mcp/dist/server.js +13 -1
- package/packages/mcp/dist/tools/index.d.ts +2 -0
- package/packages/mcp/dist/tools/index.js +2 -0
- package/packages/mcp/dist/tools/relay-connected.d.ts +17 -0
- package/packages/mcp/dist/tools/relay-connected.js +40 -0
- package/packages/mcp/dist/tools/relay-remove-agent.d.ts +20 -0
- package/packages/mcp/dist/tools/relay-remove-agent.js +50 -0
- package/packages/mcp/package.json +2 -2
- package/packages/memory/package.json +2 -2
- package/packages/policy/package.json +2 -2
- package/packages/protocol/dist/types.d.ts +46 -1
- package/packages/protocol/package.json +1 -1
- package/packages/resiliency/package.json +1 -1
- package/packages/sdk/dist/client.d.ts +22 -1
- package/packages/sdk/dist/client.js +31 -0
- package/packages/sdk/dist/protocol/index.d.ts +1 -1
- package/packages/sdk/dist/protocol/types.d.ts +35 -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/dist/adapter.d.ts +4 -0
- package/packages/storage/dist/sqlite-adapter.d.ts +10 -0
- package/packages/storage/dist/sqlite-adapter.js +26 -0
- 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/7MZPqYkVGw3EGzVBkVmY9/_buildManifest.js +0 -1
- package/dist/dashboard/out/_next/static/7MZPqYkVGw3EGzVBkVmY9/_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/7MZPqYkVGw3EGzVBkVmY9/_buildManifest.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/7MZPqYkVGw3EGzVBkVmY9/_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/iJ3Uiz3IrqUJL7IxKZHiV/_buildManifest.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/iJ3Uiz3IrqUJL7IxKZHiV/_ssgManifest.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/l-jd878zUJ_IlraqEWMZc/_buildManifest.js +0 -1
- package/packages/dashboard/ui-dist/_next/static/l-jd878zUJ_IlraqEWMZc/_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,564 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Billing Settings Panel
|
|
3
|
-
*
|
|
4
|
-
* Manage subscription, view plans, and access billing portal.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { useState, useEffect, useCallback } from 'react';
|
|
8
|
-
import { cloudApi } from '../../lib/cloudApi';
|
|
9
|
-
|
|
10
|
-
export interface BillingSettingsPanelProps {
|
|
11
|
-
onUpgrade?: () => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface Plan {
|
|
15
|
-
tier: string;
|
|
16
|
-
name: string;
|
|
17
|
-
description: string;
|
|
18
|
-
price: { monthly: number; yearly: number };
|
|
19
|
-
features: string[];
|
|
20
|
-
limits: Record<string, number>;
|
|
21
|
-
recommended?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface Subscription {
|
|
25
|
-
id: string;
|
|
26
|
-
tier: string;
|
|
27
|
-
status: string;
|
|
28
|
-
currentPeriodStart: string;
|
|
29
|
-
currentPeriodEnd: string;
|
|
30
|
-
cancelAtPeriodEnd: boolean;
|
|
31
|
-
interval: 'month' | 'year';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface Invoice {
|
|
35
|
-
id: string;
|
|
36
|
-
number: string;
|
|
37
|
-
amount: number;
|
|
38
|
-
status: string;
|
|
39
|
-
date: string;
|
|
40
|
-
pdfUrl?: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const TIER_COLORS: Record<string, string> = {
|
|
44
|
-
free: 'bg-bg-tertiary border-border-subtle text-text-muted',
|
|
45
|
-
pro: 'bg-accent-cyan/10 border-accent-cyan/30 text-accent-cyan',
|
|
46
|
-
team: 'bg-blue-900/30 border-blue-500/40 text-blue-400',
|
|
47
|
-
enterprise: 'bg-amber-400/10 border-amber-400/30 text-amber-400',
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const TIER_DESCRIPTIONS: Record<string, string> = {
|
|
51
|
-
free: 'Free tier - upgrade to unlock more features',
|
|
52
|
-
pro: 'Professional plan with enhanced features',
|
|
53
|
-
team: 'Team plan with collaboration features',
|
|
54
|
-
enterprise: 'Enterprise plan with dedicated support',
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// Tier ranking for comparison (higher = better plan)
|
|
58
|
-
const TIER_RANK: Record<string, number> = {
|
|
59
|
-
free: 0,
|
|
60
|
-
pro: 1,
|
|
61
|
-
team: 2,
|
|
62
|
-
enterprise: 3,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export function BillingSettingsPanel({ onUpgrade }: BillingSettingsPanelProps) {
|
|
66
|
-
const [plans, setPlans] = useState<Plan[]>([]);
|
|
67
|
-
const [currentTier, setCurrentTier] = useState<string>('free');
|
|
68
|
-
const [subscription, setSubscription] = useState<Subscription | null>(null);
|
|
69
|
-
const [invoices, setInvoices] = useState<Invoice[]>([]);
|
|
70
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
71
|
-
const [error, setError] = useState<string | null>(null);
|
|
72
|
-
const [successMessage, setSuccessMessage] = useState<string | null>(null);
|
|
73
|
-
|
|
74
|
-
// Billing interval toggle
|
|
75
|
-
const [billingInterval, setBillingInterval] = useState<'month' | 'year'>('month');
|
|
76
|
-
|
|
77
|
-
// Action loading states
|
|
78
|
-
const [checkoutLoading, setCheckoutLoading] = useState<string | null>(null);
|
|
79
|
-
const [portalLoading, setPortalLoading] = useState(false);
|
|
80
|
-
const [cancelLoading, setCancelLoading] = useState(false);
|
|
81
|
-
const [resumeLoading, setResumeLoading] = useState(false);
|
|
82
|
-
|
|
83
|
-
// Load billing data
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
async function loadBillingData() {
|
|
86
|
-
setIsLoading(true);
|
|
87
|
-
setError(null);
|
|
88
|
-
|
|
89
|
-
const [plansResult, subscriptionResult, invoicesResult] = await Promise.all([
|
|
90
|
-
cloudApi.getBillingPlans(),
|
|
91
|
-
cloudApi.getSubscription(),
|
|
92
|
-
cloudApi.getInvoices(),
|
|
93
|
-
]);
|
|
94
|
-
|
|
95
|
-
if (plansResult.success) {
|
|
96
|
-
setPlans(plansResult.data.plans);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (subscriptionResult.success) {
|
|
100
|
-
setCurrentTier(subscriptionResult.data.tier);
|
|
101
|
-
setSubscription(subscriptionResult.data.subscription);
|
|
102
|
-
if (subscriptionResult.data.subscription?.interval) {
|
|
103
|
-
setBillingInterval(subscriptionResult.data.subscription.interval);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (invoicesResult.success) {
|
|
108
|
-
setInvoices(invoicesResult.data.invoices);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (!plansResult.success) {
|
|
112
|
-
setError(plansResult.error);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
setIsLoading(false);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
loadBillingData();
|
|
119
|
-
}, []);
|
|
120
|
-
|
|
121
|
-
// Start checkout for plan upgrade
|
|
122
|
-
const handleCheckout = useCallback(async (tier: string) => {
|
|
123
|
-
setCheckoutLoading(tier);
|
|
124
|
-
|
|
125
|
-
const result = await cloudApi.createCheckoutSession(tier, billingInterval);
|
|
126
|
-
|
|
127
|
-
if (result.success && result.data.checkoutUrl) {
|
|
128
|
-
// Redirect to Stripe checkout
|
|
129
|
-
window.location.href = result.data.checkoutUrl;
|
|
130
|
-
} else if (!result.success) {
|
|
131
|
-
setError(result.error);
|
|
132
|
-
setCheckoutLoading(null);
|
|
133
|
-
}
|
|
134
|
-
}, [billingInterval]);
|
|
135
|
-
|
|
136
|
-
// Open billing portal
|
|
137
|
-
const handleOpenPortal = useCallback(async () => {
|
|
138
|
-
setPortalLoading(true);
|
|
139
|
-
|
|
140
|
-
const result = await cloudApi.createBillingPortal();
|
|
141
|
-
|
|
142
|
-
if (result.success && result.data.portalUrl) {
|
|
143
|
-
window.location.href = result.data.portalUrl;
|
|
144
|
-
} else if (!result.success) {
|
|
145
|
-
setError(result.error);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
setPortalLoading(false);
|
|
149
|
-
}, []);
|
|
150
|
-
|
|
151
|
-
// Cancel subscription
|
|
152
|
-
const handleCancel = useCallback(async () => {
|
|
153
|
-
const confirmed = window.confirm(
|
|
154
|
-
'Are you sure you want to cancel your subscription? You will retain access until the end of your billing period.'
|
|
155
|
-
);
|
|
156
|
-
if (!confirmed) return;
|
|
157
|
-
|
|
158
|
-
setCancelLoading(true);
|
|
159
|
-
|
|
160
|
-
const result = await cloudApi.cancelSubscription();
|
|
161
|
-
|
|
162
|
-
if (result.success) {
|
|
163
|
-
setSubscription((prev) =>
|
|
164
|
-
prev ? { ...prev, cancelAtPeriodEnd: true } : null
|
|
165
|
-
);
|
|
166
|
-
setSuccessMessage(result.data.message);
|
|
167
|
-
setTimeout(() => setSuccessMessage(null), 5000);
|
|
168
|
-
} else {
|
|
169
|
-
setError(result.error);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
setCancelLoading(false);
|
|
173
|
-
}, []);
|
|
174
|
-
|
|
175
|
-
// Resume subscription
|
|
176
|
-
const handleResume = useCallback(async () => {
|
|
177
|
-
setResumeLoading(true);
|
|
178
|
-
|
|
179
|
-
const result = await cloudApi.resumeSubscription();
|
|
180
|
-
|
|
181
|
-
if (result.success) {
|
|
182
|
-
setSubscription((prev) =>
|
|
183
|
-
prev ? { ...prev, cancelAtPeriodEnd: false } : null
|
|
184
|
-
);
|
|
185
|
-
setSuccessMessage(result.data.message);
|
|
186
|
-
setTimeout(() => setSuccessMessage(null), 3000);
|
|
187
|
-
} else {
|
|
188
|
-
setError(result.error);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
setResumeLoading(false);
|
|
192
|
-
}, []);
|
|
193
|
-
|
|
194
|
-
if (isLoading) {
|
|
195
|
-
return (
|
|
196
|
-
<div className="flex items-center justify-center h-64">
|
|
197
|
-
<LoadingSpinner />
|
|
198
|
-
<span className="ml-3 text-text-muted">Loading billing information...</span>
|
|
199
|
-
</div>
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return (
|
|
204
|
-
<div className="space-y-8">
|
|
205
|
-
{/* Messages */}
|
|
206
|
-
{error && (
|
|
207
|
-
<div className="p-3 bg-error/10 border border-error/30 rounded-lg text-error text-sm">
|
|
208
|
-
{error}
|
|
209
|
-
<button
|
|
210
|
-
onClick={() => setError(null)}
|
|
211
|
-
className="ml-2 text-error/70 hover:text-error"
|
|
212
|
-
>
|
|
213
|
-
×
|
|
214
|
-
</button>
|
|
215
|
-
</div>
|
|
216
|
-
)}
|
|
217
|
-
|
|
218
|
-
{successMessage && (
|
|
219
|
-
<div className="p-3 bg-success/10 border border-success/30 rounded-lg text-success text-sm">
|
|
220
|
-
{successMessage}
|
|
221
|
-
</div>
|
|
222
|
-
)}
|
|
223
|
-
|
|
224
|
-
{/* Current Plan */}
|
|
225
|
-
<div>
|
|
226
|
-
<h3 className="text-sm font-semibold text-text-muted uppercase tracking-wide mb-4">
|
|
227
|
-
Current Plan
|
|
228
|
-
</h3>
|
|
229
|
-
<div className={`p-4 md:p-6 rounded-lg border-2 ${TIER_COLORS[currentTier]}`}>
|
|
230
|
-
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
231
|
-
<div>
|
|
232
|
-
<h4 className="text-lg md:text-xl font-bold text-text-primary capitalize">
|
|
233
|
-
{currentTier} Plan
|
|
234
|
-
</h4>
|
|
235
|
-
{subscription ? (
|
|
236
|
-
<p className="text-xs md:text-sm text-text-secondary mt-1">
|
|
237
|
-
{subscription.cancelAtPeriodEnd ? (
|
|
238
|
-
<span className="text-amber-400">
|
|
239
|
-
Cancels on {new Date(subscription.currentPeriodEnd).toLocaleDateString()}
|
|
240
|
-
</span>
|
|
241
|
-
) : (
|
|
242
|
-
<>
|
|
243
|
-
Renews on {new Date(subscription.currentPeriodEnd).toLocaleDateString()}
|
|
244
|
-
<span className="text-text-muted ml-2">
|
|
245
|
-
({subscription.interval === 'year' ? 'Yearly' : 'Monthly'})
|
|
246
|
-
</span>
|
|
247
|
-
</>
|
|
248
|
-
)}
|
|
249
|
-
</p>
|
|
250
|
-
) : (
|
|
251
|
-
<p className="text-xs md:text-sm text-text-muted mt-1">
|
|
252
|
-
{TIER_DESCRIPTIONS[currentTier] || TIER_DESCRIPTIONS.free}
|
|
253
|
-
</p>
|
|
254
|
-
)}
|
|
255
|
-
</div>
|
|
256
|
-
|
|
257
|
-
<div className="flex flex-wrap gap-2">
|
|
258
|
-
{subscription && !subscription.cancelAtPeriodEnd && (
|
|
259
|
-
<button
|
|
260
|
-
onClick={handleCancel}
|
|
261
|
-
disabled={cancelLoading}
|
|
262
|
-
className="px-3 md:px-4 py-2 bg-bg-hover text-text-secondary rounded-lg text-xs md:text-sm font-medium hover:text-text-primary disabled:opacity-50 transition-colors"
|
|
263
|
-
>
|
|
264
|
-
{cancelLoading ? 'Canceling...' : 'Cancel Plan'}
|
|
265
|
-
</button>
|
|
266
|
-
)}
|
|
267
|
-
{subscription?.cancelAtPeriodEnd && (
|
|
268
|
-
<button
|
|
269
|
-
onClick={handleResume}
|
|
270
|
-
disabled={resumeLoading}
|
|
271
|
-
className="px-3 md:px-4 py-2 bg-success/20 text-success rounded-lg text-xs md:text-sm font-medium hover:bg-success/30 disabled:opacity-50 transition-colors"
|
|
272
|
-
>
|
|
273
|
-
{resumeLoading ? 'Resuming...' : 'Resume Plan'}
|
|
274
|
-
</button>
|
|
275
|
-
)}
|
|
276
|
-
{subscription && (
|
|
277
|
-
<button
|
|
278
|
-
onClick={handleOpenPortal}
|
|
279
|
-
disabled={portalLoading}
|
|
280
|
-
className="px-3 md:px-4 py-2 bg-accent-cyan text-bg-deep rounded-lg text-xs md:text-sm font-medium hover:bg-accent-cyan/90 disabled:opacity-50 transition-colors"
|
|
281
|
-
>
|
|
282
|
-
{portalLoading ? 'Opening...' : 'Manage Billing'}
|
|
283
|
-
</button>
|
|
284
|
-
)}
|
|
285
|
-
</div>
|
|
286
|
-
</div>
|
|
287
|
-
</div>
|
|
288
|
-
</div>
|
|
289
|
-
|
|
290
|
-
{/* Billing Interval Toggle */}
|
|
291
|
-
<div className="flex items-center justify-center gap-4">
|
|
292
|
-
<span
|
|
293
|
-
className={`text-sm font-medium ${
|
|
294
|
-
billingInterval === 'month' ? 'text-text-primary' : 'text-text-muted'
|
|
295
|
-
}`}
|
|
296
|
-
>
|
|
297
|
-
Monthly
|
|
298
|
-
</span>
|
|
299
|
-
<button
|
|
300
|
-
onClick={() => setBillingInterval((prev) => (prev === 'month' ? 'year' : 'month'))}
|
|
301
|
-
className="relative w-14 h-7 bg-bg-tertiary rounded-full transition-colors"
|
|
302
|
-
>
|
|
303
|
-
<span
|
|
304
|
-
className={`absolute top-1 w-5 h-5 bg-accent-cyan rounded-full transition-transform ${
|
|
305
|
-
billingInterval === 'year' ? 'translate-x-8' : 'translate-x-1'
|
|
306
|
-
}`}
|
|
307
|
-
/>
|
|
308
|
-
</button>
|
|
309
|
-
<span
|
|
310
|
-
className={`text-sm font-medium ${
|
|
311
|
-
billingInterval === 'year' ? 'text-text-primary' : 'text-text-muted'
|
|
312
|
-
}`}
|
|
313
|
-
>
|
|
314
|
-
Yearly
|
|
315
|
-
<span className="ml-1 text-xs text-success">(Save 20%)</span>
|
|
316
|
-
</span>
|
|
317
|
-
</div>
|
|
318
|
-
|
|
319
|
-
{/* Available Plans */}
|
|
320
|
-
<div>
|
|
321
|
-
<h3 className="text-sm font-semibold text-text-muted uppercase tracking-wide mb-4">
|
|
322
|
-
Available Plans
|
|
323
|
-
</h3>
|
|
324
|
-
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
325
|
-
{plans
|
|
326
|
-
.filter((p) => p.tier !== 'free')
|
|
327
|
-
.map((plan) => {
|
|
328
|
-
// Only show recommended styling for upgrades, not downgrades
|
|
329
|
-
const isUpgrade = (TIER_RANK[plan.tier] || 0) > (TIER_RANK[currentTier] || 0);
|
|
330
|
-
const showRecommended = plan.recommended && isUpgrade;
|
|
331
|
-
const isDowngrade = (TIER_RANK[plan.tier] || 0) < (TIER_RANK[currentTier] || 0);
|
|
332
|
-
|
|
333
|
-
return (
|
|
334
|
-
<div
|
|
335
|
-
key={plan.tier}
|
|
336
|
-
className={`relative p-6 rounded-lg border ${
|
|
337
|
-
showRecommended
|
|
338
|
-
? 'border-accent-cyan shadow-glow-cyan'
|
|
339
|
-
: 'border-border-subtle'
|
|
340
|
-
} bg-bg-tertiary`}
|
|
341
|
-
>
|
|
342
|
-
{showRecommended && (
|
|
343
|
-
<div className="absolute -top-3 left-1/2 -translate-x-1/2 px-3 py-1 bg-accent-cyan text-bg-deep text-xs font-bold rounded-full">
|
|
344
|
-
Most Popular
|
|
345
|
-
</div>
|
|
346
|
-
)}
|
|
347
|
-
|
|
348
|
-
<h4 className="text-lg font-bold text-text-primary">{plan.name}</h4>
|
|
349
|
-
<p className="text-xs text-text-muted mt-1 mb-4">{plan.description}</p>
|
|
350
|
-
|
|
351
|
-
<div className="mb-4">
|
|
352
|
-
<span className="text-3xl font-bold text-text-primary">
|
|
353
|
-
${billingInterval === 'year' ? plan.price.yearly : plan.price.monthly}
|
|
354
|
-
</span>
|
|
355
|
-
<span className="text-text-muted">
|
|
356
|
-
/{billingInterval === 'year' ? 'year' : 'month'}
|
|
357
|
-
</span>
|
|
358
|
-
</div>
|
|
359
|
-
|
|
360
|
-
<ul className="space-y-2 mb-6">
|
|
361
|
-
{plan.features.slice(0, 5).map((feature, i) => (
|
|
362
|
-
<li key={i} className="flex items-start gap-2 text-sm text-text-secondary">
|
|
363
|
-
<CheckIcon className="text-success shrink-0 mt-0.5" />
|
|
364
|
-
{feature}
|
|
365
|
-
</li>
|
|
366
|
-
))}
|
|
367
|
-
</ul>
|
|
368
|
-
|
|
369
|
-
{currentTier === plan.tier ? (
|
|
370
|
-
<button
|
|
371
|
-
disabled
|
|
372
|
-
className="w-full py-2.5 bg-bg-hover text-text-muted rounded-lg text-sm font-medium cursor-default"
|
|
373
|
-
>
|
|
374
|
-
Current Plan
|
|
375
|
-
</button>
|
|
376
|
-
) : (
|
|
377
|
-
<button
|
|
378
|
-
onClick={() => handleCheckout(plan.tier)}
|
|
379
|
-
disabled={checkoutLoading !== null}
|
|
380
|
-
className={`w-full py-2.5 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 ${
|
|
381
|
-
showRecommended
|
|
382
|
-
? 'bg-accent-cyan text-bg-deep hover:bg-accent-cyan/90'
|
|
383
|
-
: 'bg-bg-hover text-text-primary hover:bg-bg-active'
|
|
384
|
-
}`}
|
|
385
|
-
>
|
|
386
|
-
{checkoutLoading === plan.tier
|
|
387
|
-
? 'Loading...'
|
|
388
|
-
: isDowngrade
|
|
389
|
-
? 'Downgrade'
|
|
390
|
-
: 'Upgrade'}
|
|
391
|
-
</button>
|
|
392
|
-
)}
|
|
393
|
-
</div>
|
|
394
|
-
);
|
|
395
|
-
})}
|
|
396
|
-
</div>
|
|
397
|
-
</div>
|
|
398
|
-
|
|
399
|
-
{/* Enterprise CTA */}
|
|
400
|
-
<div className="p-4 md:p-6 bg-gradient-to-r from-amber-400/10 to-accent-purple/10 border border-amber-400/20 rounded-lg">
|
|
401
|
-
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
402
|
-
<div>
|
|
403
|
-
<h4 className="text-base md:text-lg font-bold text-text-primary">Enterprise</h4>
|
|
404
|
-
<p className="text-xs md:text-sm text-text-secondary mt-1">
|
|
405
|
-
Custom solutions for large teams with dedicated support, SLA, and custom integrations.
|
|
406
|
-
</p>
|
|
407
|
-
</div>
|
|
408
|
-
<a
|
|
409
|
-
href="mailto:enterprise@agent-relay.com"
|
|
410
|
-
className="px-4 md:px-6 py-2 md:py-2.5 bg-amber-400 text-bg-deep rounded-lg text-xs md:text-sm font-bold hover:bg-amber-300 transition-colors text-center shrink-0"
|
|
411
|
-
>
|
|
412
|
-
Contact Sales
|
|
413
|
-
</a>
|
|
414
|
-
</div>
|
|
415
|
-
</div>
|
|
416
|
-
|
|
417
|
-
{/* Invoices */}
|
|
418
|
-
{invoices.length > 0 && (
|
|
419
|
-
<div>
|
|
420
|
-
<h3 className="text-sm font-semibold text-text-muted uppercase tracking-wide mb-4">
|
|
421
|
-
Billing History
|
|
422
|
-
</h3>
|
|
423
|
-
|
|
424
|
-
{/* Desktop Table */}
|
|
425
|
-
<div className="hidden md:block bg-bg-tertiary rounded-lg overflow-hidden">
|
|
426
|
-
<table className="w-full">
|
|
427
|
-
<thead>
|
|
428
|
-
<tr className="border-b border-border-subtle">
|
|
429
|
-
<th className="text-left px-4 py-3 text-xs font-semibold text-text-muted uppercase">
|
|
430
|
-
Invoice
|
|
431
|
-
</th>
|
|
432
|
-
<th className="text-left px-4 py-3 text-xs font-semibold text-text-muted uppercase">
|
|
433
|
-
Date
|
|
434
|
-
</th>
|
|
435
|
-
<th className="text-left px-4 py-3 text-xs font-semibold text-text-muted uppercase">
|
|
436
|
-
Amount
|
|
437
|
-
</th>
|
|
438
|
-
<th className="text-left px-4 py-3 text-xs font-semibold text-text-muted uppercase">
|
|
439
|
-
Status
|
|
440
|
-
</th>
|
|
441
|
-
<th className="text-right px-4 py-3 text-xs font-semibold text-text-muted uppercase">
|
|
442
|
-
|
|
443
|
-
</th>
|
|
444
|
-
</tr>
|
|
445
|
-
</thead>
|
|
446
|
-
<tbody>
|
|
447
|
-
{invoices.map((invoice) => (
|
|
448
|
-
<tr key={invoice.id} className="border-b border-border-subtle last:border-0">
|
|
449
|
-
<td className="px-4 py-3 text-sm text-text-primary font-medium">
|
|
450
|
-
{invoice.number}
|
|
451
|
-
</td>
|
|
452
|
-
<td className="px-4 py-3 text-sm text-text-secondary">
|
|
453
|
-
{new Date(invoice.date).toLocaleDateString()}
|
|
454
|
-
</td>
|
|
455
|
-
<td className="px-4 py-3 text-sm text-text-primary">
|
|
456
|
-
${(invoice.amount / 100).toFixed(2)}
|
|
457
|
-
</td>
|
|
458
|
-
<td className="px-4 py-3">
|
|
459
|
-
<span
|
|
460
|
-
className={`text-xs px-2 py-1 rounded-full ${
|
|
461
|
-
invoice.status === 'paid'
|
|
462
|
-
? 'bg-success/20 text-success'
|
|
463
|
-
: invoice.status === 'open'
|
|
464
|
-
? 'bg-amber-400/20 text-amber-400'
|
|
465
|
-
: 'bg-error/20 text-error'
|
|
466
|
-
}`}
|
|
467
|
-
>
|
|
468
|
-
{invoice.status}
|
|
469
|
-
</span>
|
|
470
|
-
</td>
|
|
471
|
-
<td className="px-4 py-3 text-right">
|
|
472
|
-
{invoice.pdfUrl && (
|
|
473
|
-
<a
|
|
474
|
-
href={invoice.pdfUrl}
|
|
475
|
-
target="_blank"
|
|
476
|
-
rel="noopener noreferrer"
|
|
477
|
-
className="text-xs text-accent-cyan hover:underline"
|
|
478
|
-
>
|
|
479
|
-
Download
|
|
480
|
-
</a>
|
|
481
|
-
)}
|
|
482
|
-
</td>
|
|
483
|
-
</tr>
|
|
484
|
-
))}
|
|
485
|
-
</tbody>
|
|
486
|
-
</table>
|
|
487
|
-
</div>
|
|
488
|
-
|
|
489
|
-
{/* Mobile Card Layout */}
|
|
490
|
-
<div className="md:hidden space-y-3">
|
|
491
|
-
{invoices.map((invoice) => (
|
|
492
|
-
<div key={invoice.id} className="bg-bg-tertiary rounded-lg p-4">
|
|
493
|
-
<div className="flex items-center justify-between mb-2">
|
|
494
|
-
<span className="text-sm font-medium text-text-primary">{invoice.number}</span>
|
|
495
|
-
<span
|
|
496
|
-
className={`text-xs px-2 py-1 rounded-full ${
|
|
497
|
-
invoice.status === 'paid'
|
|
498
|
-
? 'bg-success/20 text-success'
|
|
499
|
-
: invoice.status === 'open'
|
|
500
|
-
? 'bg-amber-400/20 text-amber-400'
|
|
501
|
-
: 'bg-error/20 text-error'
|
|
502
|
-
}`}
|
|
503
|
-
>
|
|
504
|
-
{invoice.status}
|
|
505
|
-
</span>
|
|
506
|
-
</div>
|
|
507
|
-
<div className="flex items-center justify-between text-xs">
|
|
508
|
-
<span className="text-text-muted">{new Date(invoice.date).toLocaleDateString()}</span>
|
|
509
|
-
<span className="text-text-primary font-medium">${(invoice.amount / 100).toFixed(2)}</span>
|
|
510
|
-
</div>
|
|
511
|
-
{invoice.pdfUrl && (
|
|
512
|
-
<a
|
|
513
|
-
href={invoice.pdfUrl}
|
|
514
|
-
target="_blank"
|
|
515
|
-
rel="noopener noreferrer"
|
|
516
|
-
className="mt-3 block text-center text-xs text-accent-cyan py-2 border border-accent-cyan/30 rounded-lg hover:bg-accent-cyan/10 transition-colors"
|
|
517
|
-
>
|
|
518
|
-
Download PDF
|
|
519
|
-
</a>
|
|
520
|
-
)}
|
|
521
|
-
</div>
|
|
522
|
-
))}
|
|
523
|
-
</div>
|
|
524
|
-
</div>
|
|
525
|
-
)}
|
|
526
|
-
</div>
|
|
527
|
-
);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// Icons
|
|
531
|
-
function LoadingSpinner() {
|
|
532
|
-
return (
|
|
533
|
-
<svg className="animate-spin h-5 w-5 text-accent-cyan" viewBox="0 0 24 24">
|
|
534
|
-
<circle
|
|
535
|
-
cx="12"
|
|
536
|
-
cy="12"
|
|
537
|
-
r="10"
|
|
538
|
-
stroke="currentColor"
|
|
539
|
-
strokeWidth="2"
|
|
540
|
-
fill="none"
|
|
541
|
-
strokeDasharray="32"
|
|
542
|
-
strokeLinecap="round"
|
|
543
|
-
/>
|
|
544
|
-
</svg>
|
|
545
|
-
);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
function CheckIcon({ className = '' }: { className?: string }) {
|
|
549
|
-
return (
|
|
550
|
-
<svg
|
|
551
|
-
width="14"
|
|
552
|
-
height="14"
|
|
553
|
-
viewBox="0 0 24 24"
|
|
554
|
-
fill="none"
|
|
555
|
-
stroke="currentColor"
|
|
556
|
-
strokeWidth="3"
|
|
557
|
-
strokeLinecap="round"
|
|
558
|
-
strokeLinejoin="round"
|
|
559
|
-
className={className}
|
|
560
|
-
>
|
|
561
|
-
<polyline points="20 6 9 17 4 12" />
|
|
562
|
-
</svg>
|
|
563
|
-
);
|
|
564
|
-
}
|