@agent-relay/dashboard 2.0.82 → 2.0.84

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.
Files changed (228) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/chunks/1028-da5d75e35d1420f1.js +1 -0
  3. package/out/_next/static/chunks/1528-78b17000a7e10bc6.js +2 -0
  4. package/out/_next/static/chunks/1695-4a5d33ba715e09b4.js +1 -0
  5. package/out/_next/static/chunks/1705-36c2180d00a4a569.js +1 -0
  6. package/out/_next/static/chunks/1dd3208c-e1f87c7b3dc1a820.js +1 -0
  7. package/out/_next/static/chunks/3663-47290254b8f6f5dd.js +1 -0
  8. package/out/_next/static/chunks/3677-4b225baf4801d9b9.js +73 -0
  9. package/out/_next/static/chunks/5118-7e8ada2df38eef07.js +1 -0
  10. package/out/_next/static/chunks/5888-15cbe97c90ed5fae.js +1 -0
  11. package/out/_next/static/chunks/6773-a45343a98df3abb5.js +1 -0
  12. package/out/_next/static/chunks/6940-b824612b605e79b3.js +9 -0
  13. package/out/_next/static/chunks/7894-f4a15249082a680d.js +1 -0
  14. package/out/_next/static/chunks/9175-b3617c1e5cbfed0e.js +1 -0
  15. package/out/_next/static/chunks/9372-1a804b8d08c7a236.js +1 -0
  16. package/out/_next/static/chunks/{ab6c8a12-0a58072fbb505134.js → ab6c8a12-91438a812d94ecf0.js} +1 -1
  17. package/out/_next/static/chunks/app/_not-found/page-8e8842f82d204726.js +1 -0
  18. package/out/_next/static/chunks/app/about/page-b78577a7da8fa459.js +1 -0
  19. package/out/_next/static/chunks/app/app/[[...slug]]/page-3dffd65b6344f53e.js +1 -0
  20. package/out/_next/static/chunks/app/app/onboarding/page-b89be9aa6264a5e1.js +1 -0
  21. package/out/_next/static/chunks/app/blog/go-to-bed-wake-up-to-a-finished-product/page-fbd00893ef69e499.js +1 -0
  22. package/out/_next/static/chunks/app/blog/let-them-cook-multi-agent-orchestration/page-de2ea13649d0b6d3.js +1 -0
  23. package/out/_next/static/chunks/app/blog/page-a08e263c57a156fa.js +1 -0
  24. package/out/_next/static/chunks/app/careers/page-02228e1d6969b232.js +1 -0
  25. package/out/_next/static/chunks/app/changelog/page-1b5c1d79efc6e53a.js +1 -0
  26. package/out/_next/static/chunks/app/cloud/link/page-99654edffffb3af2.js +1 -0
  27. package/out/_next/static/chunks/app/complete-profile/page-59d146e5ddeafc5c.js +1 -0
  28. package/out/_next/static/chunks/app/connect-repos/page-995e16a976a6632c.js +1 -0
  29. package/out/_next/static/chunks/app/contact/page-273396a5ad57bcee.js +1 -0
  30. package/out/_next/static/chunks/app/dev/cli-tools/page-a71b80dcb2d5fc8d.js +1 -0
  31. package/out/_next/static/chunks/app/dev/log-viewer/page-46a6151ae1be0796.js +1 -0
  32. package/out/_next/static/chunks/app/docs/page-7c7cb603b24b7c40.js +1 -0
  33. package/out/_next/static/chunks/app/history/page-0c5cab1dab4e8886.js +1 -0
  34. package/out/_next/static/chunks/app/layout-96d72ba8ef8a43a0.js +1 -0
  35. package/out/_next/static/chunks/app/login/page-0ccbab34213df842.js +1 -0
  36. package/out/_next/static/chunks/app/metrics/page-8616272aeab9c8b0.js +1 -0
  37. package/out/_next/static/chunks/app/page-09ce10603ad9a251.js +1 -0
  38. package/out/_next/static/chunks/app/pricing/page-91c975079120c941.js +1 -0
  39. package/out/_next/static/chunks/app/privacy/{page-c21d51ac2dee3a88.js → page-a49ab271cc686644.js} +1 -1
  40. package/out/_next/static/chunks/app/providers/{page-59114505f4353512.js → page-d775d6eb5bc29e96.js} +1 -1
  41. package/out/_next/static/chunks/app/providers/setup/[provider]/page-ec4ef3cd80de807e.js +1 -0
  42. package/out/_next/static/chunks/app/security/page-d9da9bd9191e8f95.js +1 -0
  43. package/out/_next/static/chunks/app/signup/page-930eca0bf5fd299d.js +1 -0
  44. package/out/_next/static/chunks/app/terms/page-3e4827620b98613c.js +1 -0
  45. package/out/_next/static/chunks/framework-648e1ae7da590300.js +1 -0
  46. package/out/_next/static/chunks/{main-acb1b24265295d6a.js → main-2b1990080c292d92.js} +1 -1
  47. package/out/_next/static/chunks/main-app-9f6b7ff9e754a8f5.js +1 -0
  48. package/out/_next/static/chunks/pages/_app-a077b72e02273ab1.js +1 -0
  49. package/out/_next/static/chunks/pages/_error-84001666436a04e4.js +1 -0
  50. package/out/_next/static/chunks/{webpack-dd93b81e2659669c.js → webpack-7586035f1585f2db.js} +1 -1
  51. package/out/_next/static/css/eb9fc69d1e3d2bed.css +1 -0
  52. package/out/_next/static/{IxfA6RZu4trcsEMYlkQra → g3G0LMdB7lxcrU5mdM54m}/_buildManifest.js +1 -1
  53. package/out/about.html +2 -2
  54. package/out/about.txt +2 -2
  55. package/out/app/onboarding.html +1 -1
  56. package/out/app/onboarding.txt +2 -2
  57. package/out/app.html +1 -1
  58. package/out/app.txt +2 -2
  59. package/out/blog/go-to-bed-wake-up-to-a-finished-product.html +3 -3
  60. package/out/blog/go-to-bed-wake-up-to-a-finished-product.txt +1 -1
  61. package/out/blog/let-them-cook-multi-agent-orchestration.html +2 -2
  62. package/out/blog/let-them-cook-multi-agent-orchestration.txt +2 -2
  63. package/out/blog.html +2 -2
  64. package/out/blog.txt +1 -1
  65. package/out/careers.html +2 -2
  66. package/out/careers.txt +2 -2
  67. package/out/changelog.html +2 -2
  68. package/out/changelog.txt +2 -2
  69. package/out/cloud/link.html +1 -1
  70. package/out/cloud/link.txt +2 -2
  71. package/out/complete-profile.html +2 -2
  72. package/out/complete-profile.txt +2 -2
  73. package/out/connect-repos.html +1 -1
  74. package/out/connect-repos.txt +2 -2
  75. package/out/contact.html +2 -2
  76. package/out/contact.txt +2 -2
  77. package/out/dev/cli-tools.html +1 -0
  78. package/out/dev/cli-tools.txt +7 -0
  79. package/out/dev/log-viewer.html +23 -0
  80. package/out/dev/log-viewer.txt +7 -0
  81. package/out/docs.html +2 -2
  82. package/out/docs.txt +2 -2
  83. package/out/history.html +1 -1
  84. package/out/history.txt +2 -2
  85. package/out/index.html +1 -1
  86. package/out/index.txt +2 -2
  87. package/out/login.html +2 -2
  88. package/out/login.txt +2 -2
  89. package/out/metrics.html +1 -1
  90. package/out/metrics.txt +2 -2
  91. package/out/pricing.html +2 -2
  92. package/out/pricing.txt +2 -2
  93. package/out/privacy.html +2 -2
  94. package/out/privacy.txt +2 -2
  95. package/out/providers/setup/claude.html +1 -1
  96. package/out/providers/setup/claude.txt +2 -2
  97. package/out/providers/setup/codex.html +1 -1
  98. package/out/providers/setup/codex.txt +2 -2
  99. package/out/providers/setup/cursor.html +1 -1
  100. package/out/providers/setup/cursor.txt +2 -2
  101. package/out/providers.html +1 -1
  102. package/out/providers.txt +2 -2
  103. package/out/security.html +2 -2
  104. package/out/security.txt +2 -2
  105. package/out/signup.html +2 -2
  106. package/out/signup.txt +2 -2
  107. package/out/terms.html +2 -2
  108. package/out/terms.txt +2 -2
  109. package/package.json +5 -1
  110. package/src/adapters/DashboardConfigProvider.tsx +56 -0
  111. package/src/adapters/cloudFetchAdapter.ts +278 -0
  112. package/src/adapters/index.ts +3 -0
  113. package/src/adapters/types.ts +508 -0
  114. package/src/app/app/[[...slug]]/DashboardPageClient.tsx +67 -18
  115. package/src/app/app/onboarding/page.tsx +870 -170
  116. package/src/app/cloud/link/page.tsx +14 -6
  117. package/src/app/connect-repos/page.tsx +9 -3
  118. package/src/app/dev/cli-tools/page.tsx +130 -0
  119. package/src/app/dev/log-viewer/MockLogViewer.tsx +132 -0
  120. package/src/app/dev/log-viewer/fixtures.ts +110 -0
  121. package/src/app/dev/log-viewer/page.tsx +288 -0
  122. package/src/app/history/page.tsx +28 -12
  123. package/src/app/page.tsx +1 -1
  124. package/src/app/providers/setup/[provider]/ProviderSetupClient.tsx +209 -59
  125. package/src/components/AgentCard.tsx +4 -4
  126. package/src/components/AgentLogPreview.tsx +2 -38
  127. package/src/components/App.tsx +441 -2624
  128. package/src/components/CliToolHarness.test.tsx +83 -0
  129. package/src/components/CliToolHarness.tsx +292 -0
  130. package/src/components/CoordinatorPanel.tsx +13 -6
  131. package/src/components/LogViewer.tsx +2 -42
  132. package/src/components/ProviderAuthFlow.tsx +201 -81
  133. package/src/components/ProvisioningProgress.tsx +1 -1
  134. package/src/components/ReactionChips.tsx +2 -1
  135. package/src/components/SpawnModal.test.tsx +51 -18
  136. package/src/components/SpawnModal.tsx +175 -207
  137. package/src/components/TerminalProviderSetup.tsx +1 -1
  138. package/src/components/ThreadPanel.tsx +2 -0
  139. package/src/components/WorkspaceContext.tsx +7 -19
  140. package/src/components/XTermLogViewer.tsx +190 -27
  141. package/src/components/channels/ChannelMessageList.tsx +94 -4
  142. package/src/components/channels/ChannelViewV1.tsx +35 -11
  143. package/src/components/channels/api.ts +21 -20
  144. package/src/components/channels/types.ts +16 -0
  145. package/src/components/hooks/index.ts +0 -19
  146. package/src/components/hooks/useMessages.test.ts +80 -0
  147. package/src/components/hooks/useMessages.ts +13 -4
  148. package/src/components/hooks/useOrchestrator.ts +1 -1
  149. package/src/components/hooks/usePresence.ts +45 -6
  150. package/src/components/hooks/useThread.ts +83 -46
  151. package/src/components/hooks/useTrajectory.ts +62 -5
  152. package/src/components/hooks/useWebSocket.test.ts +358 -0
  153. package/src/components/hooks/useWebSocket.ts +243 -5
  154. package/src/components/index.ts +2 -14
  155. package/src/components/layout/Header.tsx +9 -15
  156. package/src/components/layout/Sidebar.tsx +1 -8
  157. package/src/components/settings/SettingsPage.tsx +108 -47
  158. package/src/components/settings/index.ts +0 -3
  159. package/src/landing/blogData.ts +1 -1
  160. package/src/lib/agent-merge.test.ts +2 -2
  161. package/src/lib/api.ts +8 -38
  162. package/src/lib/identity.test.ts +139 -0
  163. package/src/lib/identity.ts +48 -0
  164. package/src/lib/relaycastMessageAdapters.test.ts +182 -0
  165. package/src/lib/relaycastMessageAdapters.ts +105 -0
  166. package/src/lib/sanitize-logs.test.ts +227 -0
  167. package/src/lib/sanitize-logs.ts +202 -0
  168. package/src/providers/AgentProvider.tsx +799 -0
  169. package/src/providers/ChannelProvider.tsx +528 -0
  170. package/src/providers/CloudWorkspaceProvider.tsx +402 -0
  171. package/src/providers/MessageProvider.tsx +875 -0
  172. package/src/providers/RelayConfigProvider.tsx +94 -0
  173. package/src/providers/SendProvider.tsx +497 -0
  174. package/src/providers/SettingsProvider.tsx +247 -0
  175. package/src/providers/index.ts +26 -0
  176. package/src/types/index.ts +10 -10
  177. package/out/_next/static/chunks/11-9a2993a37266dcb3.js +0 -9
  178. package/out/_next/static/chunks/118-ae2b650136a5a5fc.js +0 -1
  179. package/out/_next/static/chunks/1dd3208c-40ab0fc0f60392b8.js +0 -1
  180. package/out/_next/static/chunks/202-fc0763dd7488e58f.js +0 -1
  181. package/out/_next/static/chunks/259-83b77fa1b91ba5aa.js +0 -1
  182. package/out/_next/static/chunks/407-0c82986cf79c8ecb.js +0 -1
  183. package/out/_next/static/chunks/528-f5f676996d613c25.js +0 -2
  184. package/out/_next/static/chunks/663-ddb04081febc3678.js +0 -1
  185. package/out/_next/static/chunks/687-88b6b139a6bb0e2e.js +0 -1
  186. package/out/_next/static/chunks/695-51d25b1988644374.js +0 -1
  187. package/out/_next/static/chunks/773-54a2641043c81e55.js +0 -1
  188. package/out/_next/static/chunks/app/_not-found/page-6da9b72091e5b511.js +0 -1
  189. package/out/_next/static/chunks/app/about/page-fff7c6457683f243.js +0 -1
  190. package/out/_next/static/chunks/app/app/[[...slug]]/page-f7eca1b66fb4249b.js +0 -1
  191. package/out/_next/static/chunks/app/app/onboarding/page-129abc5da2e67971.js +0 -1
  192. package/out/_next/static/chunks/app/blog/go-to-bed-wake-up-to-a-finished-product/page-5d5f28fd126b692f.js +0 -1
  193. package/out/_next/static/chunks/app/blog/let-them-cook-multi-agent-orchestration/page-b194f207fbd91862.js +0 -1
  194. package/out/_next/static/chunks/app/blog/page-b9bd9d8703fca76a.js +0 -1
  195. package/out/_next/static/chunks/app/careers/page-a4bd8d5f4de8f4eb.js +0 -1
  196. package/out/_next/static/chunks/app/changelog/page-9a1f6ad1743d63c5.js +0 -1
  197. package/out/_next/static/chunks/app/cloud/link/page-0844c5699b027c3b.js +0 -1
  198. package/out/_next/static/chunks/app/complete-profile/page-39ed5a67916beb87.js +0 -1
  199. package/out/_next/static/chunks/app/connect-repos/page-297eddee0c39f2a3.js +0 -1
  200. package/out/_next/static/chunks/app/contact/page-3c1dd8690217fade.js +0 -1
  201. package/out/_next/static/chunks/app/docs/page-1875e981f2c3fd13.js +0 -1
  202. package/out/_next/static/chunks/app/history/page-2d5c5695c9e8b40c.js +0 -1
  203. package/out/_next/static/chunks/app/layout-0a4b99656da25511.js +0 -1
  204. package/out/_next/static/chunks/app/login/page-f69c076f5a6fc520.js +0 -1
  205. package/out/_next/static/chunks/app/metrics/page-bebbee055669a17e.js +0 -1
  206. package/out/_next/static/chunks/app/page-0ee604f7070d14c0.js +0 -1
  207. package/out/_next/static/chunks/app/pricing/page-eeae7d594af333b6.js +0 -1
  208. package/out/_next/static/chunks/app/providers/setup/[provider]/page-daf9b3e05e77ae19.js +0 -1
  209. package/out/_next/static/chunks/app/security/page-cd562730fe84a0a2.js +0 -1
  210. package/out/_next/static/chunks/app/signup/page-c242ca08101a84ff.js +0 -1
  211. package/out/_next/static/chunks/app/terms/page-c7001720e7941dc6.js +0 -1
  212. package/out/_next/static/chunks/framework-3664cab31236a9fa.js +0 -1
  213. package/out/_next/static/chunks/main-app-7f73a939a312a228.js +0 -1
  214. package/out/_next/static/chunks/pages/_app-10a93ab5b7c32eb3.js +0 -1
  215. package/out/_next/static/chunks/pages/_error-2d792b2a41857be4.js +0 -1
  216. package/out/_next/static/css/8968d98ed4c4d33f.css +0 -1
  217. package/src/components/BillingResult.tsx +0 -447
  218. package/src/components/CloudSessionProvider.tsx +0 -130
  219. package/src/components/SessionExpiredModal.tsx +0 -128
  220. package/src/components/WorkspaceStatusIndicator.tsx +0 -396
  221. package/src/components/hooks/useSession.ts +0 -209
  222. package/src/components/hooks/useWorkspaceMembers.ts +0 -132
  223. package/src/components/hooks/useWorkspaceStatus.ts +0 -237
  224. package/src/components/settings/BillingSettingsPanel.tsx +0 -564
  225. package/src/components/settings/TeamSettingsPanel.tsx +0 -560
  226. package/src/components/settings/WorkspaceSettingsPanel.tsx +0 -1368
  227. package/src/lib/cloudApi.ts +0 -893
  228. /package/out/_next/static/{IxfA6RZu4trcsEMYlkQra → g3G0LMdB7lxcrU5mdM54m}/_ssgManifest.js +0 -0
@@ -1,447 +0,0 @@
1
- /**
2
- * Billing Result Component
3
- *
4
- * Premium success/cancel pages after Stripe checkout.
5
- * Features celebratory animations, confetti, and polished micro-interactions.
6
- */
7
-
8
- import React, { useEffect, useState, useMemo } from 'react';
9
- import { cloudApi } from '../lib/cloudApi';
10
-
11
- interface DeferredWorkspace {
12
- workspaceId: string;
13
- workspaceName: string;
14
- agentCount: number;
15
- }
16
-
17
- export interface BillingResultProps {
18
- type: 'success' | 'canceled';
19
- sessionId?: string;
20
- deferredWorkspaces?: DeferredWorkspace[];
21
- onClose: () => void;
22
- }
23
-
24
- interface SubscriptionInfo {
25
- plan: string;
26
- status: string;
27
- }
28
-
29
- // Confetti particle component
30
- function Confetti() {
31
- const particles = useMemo(() => {
32
- return Array.from({ length: 50 }, (_, i) => ({
33
- id: i,
34
- x: Math.random() * 100,
35
- delay: Math.random() * 0.5,
36
- duration: 2 + Math.random() * 2,
37
- size: 4 + Math.random() * 8,
38
- color: ['#00d9ff', '#00b8d9', '#4ade80', '#facc15', '#f472b6', '#a78bfa'][Math.floor(Math.random() * 6)],
39
- rotation: Math.random() * 360,
40
- }));
41
- }, []);
42
-
43
- return (
44
- <div className="fixed inset-0 pointer-events-none overflow-hidden z-50">
45
- {particles.map((p) => (
46
- <div
47
- key={p.id}
48
- className="absolute animate-confetti-fall"
49
- style={{
50
- left: `${p.x}%`,
51
- top: '-20px',
52
- width: p.size,
53
- height: p.size * 0.6,
54
- backgroundColor: p.color,
55
- transform: `rotate(${p.rotation}deg)`,
56
- animationDelay: `${p.delay}s`,
57
- animationDuration: `${p.duration}s`,
58
- borderRadius: '2px',
59
- }}
60
- />
61
- ))}
62
- <style>{`
63
- @keyframes confetti-fall {
64
- 0% {
65
- transform: translateY(0) rotate(0deg) scale(1);
66
- opacity: 1;
67
- }
68
- 100% {
69
- transform: translateY(100vh) rotate(720deg) scale(0.5);
70
- opacity: 0;
71
- }
72
- }
73
- .animate-confetti-fall {
74
- animation: confetti-fall linear forwards;
75
- }
76
- `}</style>
77
- </div>
78
- );
79
- }
80
-
81
- // Animated checkmark with draw effect
82
- function AnimatedCheckmark() {
83
- return (
84
- <div className="relative w-20 h-20">
85
- {/* Glow ring */}
86
- <div className="absolute inset-0 rounded-full bg-gradient-to-r from-emerald-400 to-cyan-400 opacity-20 animate-pulse-slow" />
87
-
88
- {/* Main circle with gradient border */}
89
- <div className="absolute inset-1 rounded-full bg-gradient-to-br from-emerald-400 via-emerald-500 to-cyan-500 p-0.5 animate-scale-in">
90
- <div className="w-full h-full rounded-full bg-bg-primary flex items-center justify-center">
91
- <svg
92
- className="w-10 h-10"
93
- viewBox="0 0 24 24"
94
- fill="none"
95
- >
96
- <path
97
- d="M5 12l5 5L19 7"
98
- stroke="url(#check-gradient)"
99
- strokeWidth="3"
100
- strokeLinecap="round"
101
- strokeLinejoin="round"
102
- className="animate-draw-check"
103
- style={{
104
- strokeDasharray: 30,
105
- strokeDashoffset: 30,
106
- }}
107
- />
108
- <defs>
109
- <linearGradient id="check-gradient" x1="5" y1="12" x2="19" y2="7">
110
- <stop stopColor="#34d399" />
111
- <stop offset="1" stopColor="#22d3ee" />
112
- </linearGradient>
113
- </defs>
114
- </svg>
115
- </div>
116
- </div>
117
-
118
- {/* Sparkle particles */}
119
- <div className="absolute -top-1 -right-1 w-3 h-3 bg-yellow-400 rounded-full animate-sparkle" style={{ animationDelay: '0.5s' }} />
120
- <div className="absolute top-0 -left-2 w-2 h-2 bg-cyan-400 rounded-full animate-sparkle" style={{ animationDelay: '0.7s' }} />
121
- <div className="absolute -bottom-1 right-2 w-2 h-2 bg-emerald-400 rounded-full animate-sparkle" style={{ animationDelay: '0.9s' }} />
122
-
123
- <style>{`
124
- @keyframes scale-in {
125
- 0% { transform: scale(0); opacity: 0; }
126
- 50% { transform: scale(1.1); }
127
- 100% { transform: scale(1); opacity: 1; }
128
- }
129
- @keyframes draw-check {
130
- to { stroke-dashoffset: 0; }
131
- }
132
- @keyframes sparkle {
133
- 0%, 100% { transform: scale(0); opacity: 0; }
134
- 50% { transform: scale(1); opacity: 1; }
135
- }
136
- @keyframes pulse-slow {
137
- 0%, 100% { transform: scale(1); opacity: 0.2; }
138
- 50% { transform: scale(1.2); opacity: 0.4; }
139
- }
140
- .animate-scale-in {
141
- animation: scale-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
142
- }
143
- .animate-draw-check {
144
- animation: draw-check 0.4s ease-out 0.4s forwards;
145
- }
146
- .animate-sparkle {
147
- animation: sparkle 1s ease-in-out infinite;
148
- }
149
- .animate-pulse-slow {
150
- animation: pulse-slow 2s ease-in-out infinite;
151
- }
152
- `}</style>
153
- </div>
154
- );
155
- }
156
-
157
- // Premium loading spinner
158
- function LoadingSpinner() {
159
- return (
160
- <div className="relative w-20 h-20">
161
- {/* Outer rotating ring */}
162
- <div className="absolute inset-0 rounded-full border-2 border-transparent border-t-accent-cyan border-r-accent-cyan/50 animate-spin" />
163
-
164
- {/* Inner pulsing core */}
165
- <div className="absolute inset-3 rounded-full bg-gradient-to-br from-accent-cyan/20 to-transparent animate-pulse" />
166
-
167
- {/* Center dot */}
168
- <div className="absolute inset-0 flex items-center justify-center">
169
- <div className="w-3 h-3 rounded-full bg-accent-cyan animate-ping" />
170
- </div>
171
-
172
- {/* Orbiting particles */}
173
- <div className="absolute inset-0 animate-spin" style={{ animationDuration: '3s' }}>
174
- <div className="absolute top-0 left-1/2 -translate-x-1/2 w-2 h-2 rounded-full bg-accent-cyan/80" />
175
- </div>
176
- <div className="absolute inset-0 animate-spin" style={{ animationDuration: '4s', animationDirection: 'reverse' }}>
177
- <div className="absolute bottom-1 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full bg-cyan-300/60" />
178
- </div>
179
- </div>
180
- );
181
- }
182
-
183
- // Benefit item with staggered animation
184
- function BenefitItem({ children, delay }: { children: React.ReactNode; delay: number }) {
185
- return (
186
- <li
187
- className="flex items-center gap-3 opacity-0 animate-slide-in-left"
188
- style={{ animationDelay: `${delay}s`, animationFillMode: 'forwards' }}
189
- >
190
- <div className="w-5 h-5 rounded-full bg-gradient-to-br from-emerald-400 to-cyan-400 flex items-center justify-center flex-shrink-0">
191
- <svg className="w-3 h-3 text-white" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3">
192
- <path d="M20 6L9 17l-5-5" strokeLinecap="round" strokeLinejoin="round" />
193
- </svg>
194
- </div>
195
- <span className="text-text-secondary">{children}</span>
196
- <style>{`
197
- @keyframes slide-in-left {
198
- from {
199
- opacity: 0;
200
- transform: translateX(-20px);
201
- }
202
- to {
203
- opacity: 1;
204
- transform: translateX(0);
205
- }
206
- }
207
- .animate-slide-in-left {
208
- animation: slide-in-left 0.4s ease-out forwards;
209
- }
210
- `}</style>
211
- </li>
212
- );
213
- }
214
-
215
- export function BillingResult({ type, sessionId, onClose }: BillingResultProps) {
216
- const [subscription, setSubscription] = useState<SubscriptionInfo | null>(null);
217
- const [isLoading, setIsLoading] = useState(type === 'success');
218
- const [error, setError] = useState<string | null>(null);
219
- const [showConfetti, setShowConfetti] = useState(false);
220
-
221
- useEffect(() => {
222
- if (type !== 'success') return;
223
-
224
- const fetchSubscription = async () => {
225
- try {
226
- await new Promise(resolve => setTimeout(resolve, 1500));
227
-
228
- const result = await cloudApi.getSubscription();
229
- if (result.success && result.data) {
230
- setSubscription({
231
- plan: result.data.subscription?.tier || 'pro',
232
- status: result.data.subscription?.status || 'active',
233
- });
234
- // Trigger confetti after successful load
235
- setTimeout(() => setShowConfetti(true), 200);
236
- }
237
- } catch (err) {
238
- setError('Could not verify subscription. Please check your billing settings.');
239
- } finally {
240
- setIsLoading(false);
241
- }
242
- };
243
-
244
- fetchSubscription();
245
- }, [type, sessionId]);
246
-
247
- const planName = subscription?.plan === 'pro' ? 'Pro' : subscription?.plan === 'team' ? 'Team' : subscription?.plan === 'enterprise' ? 'Enterprise' : 'Premium';
248
-
249
- if (type === 'success') {
250
- return (
251
- <div className="min-h-screen bg-bg-deep flex items-center justify-center p-4 overflow-hidden">
252
- {/* Background gradient orbs */}
253
- <div className="fixed inset-0 overflow-hidden pointer-events-none">
254
- <div className="absolute top-1/4 -left-32 w-96 h-96 bg-accent-cyan/10 rounded-full blur-3xl animate-float" />
255
- <div className="absolute bottom-1/4 -right-32 w-96 h-96 bg-emerald-500/10 rounded-full blur-3xl animate-float" style={{ animationDelay: '1s' }} />
256
- </div>
257
-
258
- {showConfetti && <Confetti />}
259
-
260
- <div
261
- className="relative max-w-md w-full bg-bg-primary/95 backdrop-blur-xl rounded-3xl border border-border-subtle p-10 text-center shadow-2xl opacity-0 animate-fade-scale-in"
262
- style={{ animationFillMode: 'forwards' }}
263
- >
264
- {/* Decorative top gradient line */}
265
- <div className="absolute top-0 left-8 right-8 h-1 rounded-full bg-gradient-to-r from-transparent via-accent-cyan to-transparent" />
266
-
267
- {isLoading ? (
268
- <div className="py-8">
269
- <div className="flex justify-center mb-8">
270
- <LoadingSpinner />
271
- </div>
272
- <h1 className="text-2xl font-bold text-text-primary mb-3 tracking-tight">
273
- Processing your upgrade
274
- </h1>
275
- <p className="text-text-muted">
276
- Confirming your subscription...
277
- </p>
278
- </div>
279
- ) : error ? (
280
- <div className="py-4">
281
- <div className="w-16 h-16 mx-auto mb-6 rounded-full bg-amber-500/20 flex items-center justify-center">
282
- <svg className="w-8 h-8 text-amber-400" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
283
- <circle cx="12" cy="12" r="10" />
284
- <line x1="12" y1="8" x2="12" y2="12" />
285
- <line x1="12" y1="16" x2="12.01" y2="16" />
286
- </svg>
287
- </div>
288
- <h1 className="text-2xl font-bold text-text-primary mb-3">
289
- Almost there!
290
- </h1>
291
- <p className="text-text-muted mb-8">{error}</p>
292
- <button
293
- onClick={onClose}
294
- className="group w-full py-4 px-6 bg-gradient-to-r from-accent-cyan to-cyan-400 text-bg-deep font-bold rounded-2xl transition-all duration-300 hover:shadow-[0_0_30px_rgba(0,217,255,0.4)] hover:scale-[1.02] active:scale-[0.98]"
295
- >
296
- Go to Billing Settings
297
- </button>
298
- </div>
299
- ) : (
300
- <>
301
- <div className="flex justify-center mb-6">
302
- <AnimatedCheckmark />
303
- </div>
304
-
305
- <h1
306
- className="text-3xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-text-primary via-accent-cyan to-emerald-400 mb-3 tracking-tight opacity-0 animate-fade-in"
307
- style={{ animationDelay: '0.3s', animationFillMode: 'forwards' }}
308
- >
309
- Welcome to {planName}!
310
- </h1>
311
-
312
- <p
313
- className="text-text-muted mb-8 opacity-0 animate-fade-in"
314
- style={{ animationDelay: '0.5s', animationFillMode: 'forwards' }}
315
- >
316
- Your subscription is active. Time to supercharge your workflow.
317
- </p>
318
-
319
- <div
320
- className="bg-gradient-to-br from-bg-secondary to-bg-deep rounded-2xl p-5 mb-8 text-left border border-border-subtle/50 opacity-0 animate-fade-in"
321
- style={{ animationDelay: '0.6s', animationFillMode: 'forwards' }}
322
- >
323
- <h3 className="text-xs font-bold text-accent-cyan uppercase tracking-wider mb-4">Your new powers</h3>
324
- <ul className="space-y-3 text-sm">
325
- <BenefitItem delay={0.8}>Expanded workspace & repository limits</BenefitItem>
326
- <BenefitItem delay={0.9}>More compute hours for your agents</BenefitItem>
327
- <BenefitItem delay={1.0}>Increased concurrent agent capacity</BenefitItem>
328
- <BenefitItem delay={1.1}>Priority support & faster responses</BenefitItem>
329
- </ul>
330
- </div>
331
-
332
- <button
333
- onClick={onClose}
334
- className="group w-full py-4 px-6 bg-gradient-to-r from-accent-cyan via-cyan-400 to-emerald-400 text-bg-deep font-bold rounded-2xl transition-all duration-300 hover:shadow-[0_0_40px_rgba(0,217,255,0.5)] hover:scale-[1.02] active:scale-[0.98] opacity-0 animate-fade-in"
335
- style={{ animationDelay: '1.2s', animationFillMode: 'forwards' }}
336
- >
337
- <span className="flex items-center justify-center gap-2">
338
- Launch Dashboard
339
- <svg className="w-5 h-5 transition-transform group-hover:translate-x-1" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
340
- <path d="M5 12h14M12 5l7 7-7 7" strokeLinecap="round" strokeLinejoin="round" />
341
- </svg>
342
- </span>
343
- </button>
344
- </>
345
- )}
346
- </div>
347
-
348
- <style>{`
349
- @keyframes fade-scale-in {
350
- from {
351
- opacity: 0;
352
- transform: scale(0.95) translateY(10px);
353
- }
354
- to {
355
- opacity: 1;
356
- transform: scale(1) translateY(0);
357
- }
358
- }
359
- @keyframes fade-in {
360
- from { opacity: 0; }
361
- to { opacity: 1; }
362
- }
363
- @keyframes float {
364
- 0%, 100% { transform: translateY(0) scale(1); }
365
- 50% { transform: translateY(-20px) scale(1.05); }
366
- }
367
- .animate-fade-scale-in {
368
- animation: fade-scale-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
369
- }
370
- .animate-fade-in {
371
- animation: fade-in 0.5s ease-out forwards;
372
- }
373
- .animate-float {
374
- animation: float 6s ease-in-out infinite;
375
- }
376
- `}</style>
377
- </div>
378
- );
379
- }
380
-
381
- // Canceled flow
382
- return (
383
- <div className="min-h-screen bg-bg-deep flex items-center justify-center p-4">
384
- {/* Subtle background */}
385
- <div className="fixed inset-0 overflow-hidden pointer-events-none">
386
- <div className="absolute top-1/3 left-1/4 w-64 h-64 bg-text-muted/5 rounded-full blur-3xl" />
387
- </div>
388
-
389
- <div
390
- className="relative max-w-md w-full bg-bg-primary/95 backdrop-blur-xl rounded-3xl border border-border-subtle p-10 text-center shadow-xl opacity-0 animate-fade-scale-in"
391
- style={{ animationFillMode: 'forwards' }}
392
- >
393
- <div className="w-16 h-16 mx-auto mb-6 rounded-full bg-bg-secondary border border-border-subtle flex items-center justify-center">
394
- <svg className="w-7 h-7 text-text-muted" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
395
- <path d="M18 6L6 18M6 6l12 12" strokeLinecap="round" strokeLinejoin="round" />
396
- </svg>
397
- </div>
398
-
399
- <h1 className="text-2xl font-bold text-text-primary mb-3">
400
- No problem!
401
- </h1>
402
- <p className="text-text-muted mb-8 leading-relaxed">
403
- Checkout was canceled and you haven't been charged.
404
- You can upgrade anytime when you're ready.
405
- </p>
406
-
407
- <div className="space-y-3">
408
- <button
409
- onClick={onClose}
410
- className="group w-full py-4 px-6 bg-gradient-to-r from-accent-cyan to-cyan-400 text-bg-deep font-bold rounded-2xl transition-all duration-300 hover:shadow-[0_0_30px_rgba(0,217,255,0.4)] hover:scale-[1.02] active:scale-[0.98]"
411
- >
412
- <span className="flex items-center justify-center gap-2">
413
- Return to Dashboard
414
- <svg className="w-5 h-5 transition-transform group-hover:translate-x-1" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
415
- <path d="M5 12h14M12 5l7 7-7 7" strokeLinecap="round" strokeLinejoin="round" />
416
- </svg>
417
- </span>
418
- </button>
419
- <button
420
- onClick={() => {
421
- window.location.href = '/?settings=billing';
422
- }}
423
- className="w-full py-4 px-6 bg-bg-secondary text-text-primary font-semibold rounded-2xl border border-border-subtle transition-all duration-300 hover:border-accent-cyan/50 hover:bg-bg-secondary/80"
424
- >
425
- View Plans
426
- </button>
427
- </div>
428
- </div>
429
-
430
- <style>{`
431
- @keyframes fade-scale-in {
432
- from {
433
- opacity: 0;
434
- transform: scale(0.95) translateY(10px);
435
- }
436
- to {
437
- opacity: 1;
438
- transform: scale(1) translateY(0);
439
- }
440
- }
441
- .animate-fade-scale-in {
442
- animation: fade-scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
443
- }
444
- `}</style>
445
- </div>
446
- );
447
- }
@@ -1,130 +0,0 @@
1
- /**
2
- * Cloud Session Provider
3
- *
4
- * Wraps the dashboard app to provide cloud session management.
5
- * Automatically detects session expiration and prompts re-login.
6
- *
7
- * Usage:
8
- * ```tsx
9
- * <CloudSessionProvider>
10
- * <App />
11
- * </CloudSessionProvider>
12
- * ```
13
- */
14
-
15
- import React, { createContext, useContext, useCallback } from 'react';
16
- import { useSession, type UseSessionReturn, type SessionError } from './hooks/useSession';
17
- import { SessionExpiredModal } from './SessionExpiredModal';
18
-
19
- // Context type
20
- interface CloudSessionContextValue extends UseSessionReturn {
21
- /** Whether this is a cloud-hosted dashboard */
22
- isCloudMode: boolean;
23
- }
24
-
25
- // Create context with undefined default
26
- const CloudSessionContext = createContext<CloudSessionContextValue | undefined>(undefined);
27
-
28
- export interface CloudSessionProviderProps {
29
- /** Child components */
30
- children: React.ReactNode;
31
- /** Whether this dashboard is running in cloud mode (default: auto-detect) */
32
- cloudMode?: boolean;
33
- /** Session check interval in ms (default: 60000) */
34
- checkInterval?: number;
35
- /** Callback when session expires */
36
- onSessionExpired?: (error: SessionError) => void;
37
- }
38
-
39
- /**
40
- * Auto-detect if running in cloud mode
41
- * Cloud mode is detected by checking for cloud-specific environment markers
42
- */
43
- function detectCloudMode(): boolean {
44
- if (typeof window === 'undefined') return false;
45
-
46
- // Check for cloud URL patterns
47
- const hostname = window.location.hostname;
48
- if (hostname.includes('agent-relay.com')) return true;
49
- if (hostname.includes('agentrelay.cloud')) return true;
50
-
51
- // Check for cloud mode flag in meta tags
52
- const cloudMeta = document.querySelector('meta[name="agent-relay-cloud"]');
53
- if (cloudMeta?.getAttribute('content') === 'true') return true;
54
-
55
- // Check for cloud mode in local storage (for development)
56
- if (localStorage.getItem('agent-relay-cloud-mode') === 'true') return true;
57
-
58
- return false;
59
- }
60
-
61
- export function CloudSessionProvider({
62
- children,
63
- cloudMode,
64
- checkInterval = 60000,
65
- onSessionExpired,
66
- }: CloudSessionProviderProps) {
67
- const isCloudMode = cloudMode ?? detectCloudMode();
68
-
69
- // Use session hook only in cloud mode
70
- const session = useSession({
71
- checkOnMount: isCloudMode,
72
- checkInterval: isCloudMode ? checkInterval : 0,
73
- onExpired: onSessionExpired,
74
- });
75
-
76
- // Handle login redirect
77
- const handleLogin = useCallback(() => {
78
- session.redirectToLogin();
79
- }, [session]);
80
-
81
- // Handle modal dismiss (optional - keeps modal closable for some use cases)
82
- const handleDismiss = useCallback(() => {
83
- session.clearExpired();
84
- }, [session]);
85
-
86
- // Context value
87
- const contextValue: CloudSessionContextValue = {
88
- ...session,
89
- isCloudMode,
90
- };
91
-
92
- return (
93
- <CloudSessionContext.Provider value={contextValue}>
94
- {children}
95
-
96
- {/* Session Expired Modal - only shown in cloud mode */}
97
- {isCloudMode && (
98
- <SessionExpiredModal
99
- isOpen={session.isExpired}
100
- error={session.error}
101
- onLogin={handleLogin}
102
- onDismiss={handleDismiss}
103
- />
104
- )}
105
- </CloudSessionContext.Provider>
106
- );
107
- }
108
-
109
- /**
110
- * Hook to access cloud session context
111
- *
112
- * @throws Error if used outside of CloudSessionProvider
113
- */
114
- export function useCloudSession(): CloudSessionContextValue {
115
- const context = useContext(CloudSessionContext);
116
- if (!context) {
117
- throw new Error('useCloudSession must be used within a CloudSessionProvider');
118
- }
119
- return context;
120
- }
121
-
122
- /**
123
- * Hook to optionally access cloud session context
124
- * Returns undefined if not within a CloudSessionProvider
125
- */
126
- export function useCloudSessionOptional(): CloudSessionContextValue | undefined {
127
- return useContext(CloudSessionContext);
128
- }
129
-
130
- export default CloudSessionProvider;