@@ -92,10 +92,6 @@ import type {
9292import { useViewQueries , useProjectServers } from "./hooks/useViews" ;
9393import { HostedShellGate } from "./components/hosted/HostedShellGate" ;
9494import { resolveHostedShellGateState } from "./components/hosted/hosted-shell-gate-state" ;
95- import {
96- SharedServerChatPage ,
97- getSharedPathTokenFromLocation ,
98- } from "./components/hosted/SharedServerChatPage" ;
9995import {
10096 ChatboxChatPage ,
10197 getChatboxPathTokenFromLocation ,
@@ -157,17 +153,9 @@ import {
157153 clearChatboxSignInReturnPath ,
158154 readChatboxSession ,
159155 readChatboxSignInReturnPath ,
156+ slugify ,
160157 writeChatboxSignInReturnPath ,
161158} from "./lib/chatbox-session" ;
162- import {
163- clearSharedSignInReturnPath ,
164- readSharedServerSession ,
165- readSharedSignInReturnPath ,
166- slugify ,
167- writeSharedSignInReturnPath ,
168- readPendingServerAdd ,
169- clearPendingServerAdd ,
170- } from "./lib/shared-server-session" ;
171159import {
172160 sanitizeHostedOAuthErrorMessage ,
173161 clearHostedOAuthResumeMarker ,
@@ -428,57 +416,26 @@ export default function App() {
428416 const callbackContext = getHostedOAuthCallbackContext ( ) ;
429417 return callbackContext != null && callbackContext . surface !== "project" ;
430418 } ) ;
431- const [ exitedSharedChat , setExitedSharedChat ] = useState ( false ) ;
432419 const [ exitedChatboxChat , setExitedChatboxChat ] = useState ( false ) ;
433- const sharedPathToken = HOSTED_MODE ? getSharedPathTokenFromLocation ( ) : null ;
434420 const chatboxPathToken = HOSTED_MODE
435421 ? getChatboxPathTokenFromLocation ( )
436422 : null ;
437- const sharedSession = HOSTED_MODE ? readSharedServerSession ( ) : null ;
438423 const chatboxSession = HOSTED_MODE ? readChatboxSession ( ) : null ;
439- const currentHashSlug = window . location . hash
440- . replace ( / ^ # / , "" )
441- . replace ( / ^ \/ + / , "" )
442- . split ( "/" ) [ 0 ] ;
443424 const hostedRouteKind = useMemo ( ( ) => {
444425 if ( ! HOSTED_MODE ) {
445426 return null ;
446427 }
447428
448- if ( sharedPathToken ) {
449- return "shared" as const ;
450- }
451429 if ( chatboxPathToken ) {
452430 return "chatbox" as const ;
453431 }
454432
455- if ( sharedSession && chatboxSession ) {
456- if ( currentHashSlug === slugify ( sharedSession . payload . serverName ) ) {
457- return "shared" as const ;
458- }
459- if ( currentHashSlug === slugify ( chatboxSession . payload . name ) ) {
460- return "chatbox" as const ;
461- }
462- return null ;
463- }
464-
465- if ( sharedSession ) {
466- return "shared" as const ;
467- }
468433 if ( chatboxSession ) {
469434 return "chatbox" as const ;
470435 }
471436
472437 return null ;
473- } , [
474- currentHashSlug ,
475- chatboxPathToken ,
476- chatboxSession ,
477- sharedPathToken ,
478- sharedSession ,
479- ] ) ;
480- const isSharedChatRoute =
481- HOSTED_MODE && ! exitedSharedChat && hostedRouteKind === "shared" ;
438+ } , [ chatboxPathToken , chatboxSession ] ) ;
482439 const isChatboxChatRoute =
483440 HOSTED_MODE && ! exitedChatboxChat && hostedRouteKind === "chatbox" ;
484441
@@ -489,7 +446,7 @@ export default function App() {
489446 setEvaluateRunsFlagsLoaded ( posthog . featureFlags ?. hasLoadedFlags === true ) ;
490447 } ) ;
491448 } , [ posthog ] ) ;
492- const isHostedChatRoute = isSharedChatRoute || isChatboxChatRoute ;
449+ const isHostedChatRoute = isChatboxChatRoute ;
493450 const currentHash = window . location . hash || "#servers" ;
494451 const currentHashRoute = useMemo (
495452 ( ) => resolveHostedNavigation ( currentHash , HOSTED_MODE ) ,
@@ -709,18 +666,16 @@ export default function App() {
709666 // Let AuthKit + Convex auth settle before leaving /callback.
710667 if ( ! isAuthLoading && isAuthenticated ) {
711668 const chatboxReturnPath = readChatboxSignInReturnPath ( ) ;
712- const sharedReturnPath = readSharedSignInReturnPath ( ) ;
713669 const persistedCheckoutIntent = readPersistedCheckoutIntent ( ) ;
714670 const billingReturnPath = persistedCheckoutIntent
715671 ? readBillingSignInReturnPath ( )
716672 : null ;
717673 clearChatboxSignInReturnPath ( ) ;
718- clearSharedSignInReturnPath ( ) ;
719674 clearBillingSignInReturnPath ( ) ;
720675 window . history . replaceState (
721676 { } ,
722677 "" ,
723- chatboxReturnPath ?? sharedReturnPath ?? billingReturnPath ?? "/"
678+ chatboxReturnPath ?? billingReturnPath ?? "/"
724679 ) ;
725680 setCallbackCompleted ( true ) ;
726681 setCallbackRecoveryExpired ( false ) ;
@@ -893,40 +848,6 @@ export default function App() {
893848 isHostedDefaultRoute &&
894849 hostedShellGateState === "auth-loading" ;
895850
896- // Auto-add a shared server when returning from SharedServerChatPage via "Open MCPJam"
897- useEffect ( ( ) => {
898- if ( isHostedChatRoute ) return ;
899- if ( isLoadingRemoteProjects ) return ;
900- if ( isAuthLoading ) return ;
901- // In hosted mode, also wait for the project to resolve. handleConnect
902- // would otherwise build a request with `projectId === "none"` and fail.
903- if ( HOSTED_MODE && ( ! activeProjectId || activeProjectId === "none" ) ) return ;
904-
905- const pending = readPendingServerAdd ( ) ;
906- if ( ! pending ) return ;
907- clearPendingServerAdd ( ) ;
908-
909- if ( projectServers [ pending . serverName ] !== undefined ) {
910- return ; // Server already exists
911- }
912-
913- handleConnect ( {
914- name : pending . serverName ,
915- type : "http" ,
916- url : pending . serverUrl ,
917- useOAuth : pending . useOAuth ,
918- clientId : pending . clientId ?? undefined ,
919- oauthScopes : pending . oauthScopes ?? undefined ,
920- } ) ;
921- } , [
922- isHostedChatRoute ,
923- isLoadingRemoteProjects ,
924- isAuthLoading ,
925- activeProjectId ,
926- projectServers ,
927- handleConnect ,
928- ] ) ;
929-
930851 const previousConnectedServersRef = useRef < Set < string > | null > ( null ) ;
931852 useEffect ( ( ) => {
932853 const connectedServers = new Set (
@@ -1209,17 +1130,6 @@ export default function App() {
12091130 preserveCurrentOrganizationOnNonOrgTarget ?: boolean ;
12101131 }
12111132 ) => {
1212- if ( isSharedChatRoute ) {
1213- const storedSession = readSharedServerSession ( ) ;
1214- if ( storedSession ) {
1215- const expectedHash = slugify ( storedSession . payload . serverName ) ;
1216- if ( window . location . hash !== `#${ expectedHash } ` ) {
1217- window . location . hash = expectedHash ;
1218- }
1219- }
1220- return ;
1221- }
1222-
12231133 if ( isChatboxChatRoute ) {
12241134 const storedSession = readChatboxSession ( ) ;
12251135 if ( storedSession ) {
@@ -1287,7 +1197,6 @@ export default function App() {
12871197 [
12881198 effectiveOrganizations ,
12891199 isChatboxChatRoute ,
1290- isSharedChatRoute ,
12911200 setSelectedMultipleServersToAllServers ,
12921201 ]
12931202 ) ;
@@ -2449,9 +2358,6 @@ export default function App() {
24492358 : undefined
24502359 }
24512360 onSignIn = { ( ) => {
2452- if ( sharedPathToken ) {
2453- writeSharedSignInReturnPath ( window . location . pathname ) ;
2454- }
24552361 if ( chatboxPathToken ) {
24562362 writeChatboxSignInReturnPath ( window . location . pathname ) ;
24572363 }
@@ -2461,12 +2367,7 @@ export default function App() {
24612367 void signOut ( ) ;
24622368 } }
24632369 >
2464- { isSharedChatRoute ? (
2465- < SharedServerChatPage
2466- pathToken = { sharedPathToken }
2467- onExitSharedChat = { ( ) => setExitedSharedChat ( true ) }
2468- />
2469- ) : isChatboxChatRoute ? (
2370+ { isChatboxChatRoute ? (
24702371 < ChatboxChatPage
24712372 pathToken = { chatboxPathToken }
24722373 onExitChatboxChat = { ( ) => setExitedChatboxChat ( true ) }
0 commit comments