diff --git a/server/constants/config.js b/server/constants/config.js new file mode 100644 index 0000000..6741c35 --- /dev/null +++ b/server/constants/config.js @@ -0,0 +1,5 @@ +/** + * Environment Flag: Is Platform + * Indicates if the app is running in Platform mode (hosted) or OSS mode (self-hosted) + */ +export const IS_PLATFORM = import.meta.env.VITE_IS_PLATFORM === 'true'; \ No newline at end of file diff --git a/shared/modelConstants.js b/shared/modelConstants.js index 335d1ad..a327c9f 100644 --- a/shared/modelConstants.js +++ b/shared/modelConstants.js @@ -62,11 +62,4 @@ export const CODEX_MODELS = { ], DEFAULT: 'gpt-5.2' -}; - - -/** - * Environment Flag: Is Platform - * Indicates if the app is running in Platform mode (hosted) or OSS mode (self-hosted) - */ -export const IS_PLATFORM = import.meta.env.VITE_IS_PLATFORM === 'true'; \ No newline at end of file +}; \ No newline at end of file diff --git a/src/components/LoginModal.jsx b/src/components/LoginModal.jsx index 963efa4..811daf2 100644 --- a/src/components/LoginModal.jsx +++ b/src/components/LoginModal.jsx @@ -1,6 +1,6 @@ import { X } from 'lucide-react'; import StandaloneShell from './StandaloneShell'; -import { IS_PLATFORM } from '../../shared/modelConstants'; +import { IS_PLATFORM } from '../constants/config'; /** * Reusable login modal component for Claude, Cursor, and Codex CLI authentication diff --git a/src/components/Onboarding.jsx b/src/components/Onboarding.jsx index 02a0050..17125ae 100644 --- a/src/components/Onboarding.jsx +++ b/src/components/Onboarding.jsx @@ -6,7 +6,7 @@ import CodexLogo from './CodexLogo'; import LoginModal from './LoginModal'; import { authenticatedFetch } from '../utils/api'; import { useAuth } from '../contexts/AuthContext'; -import { IS_PLATFORM } from '../../shared/modelConstants'; +import { IS_PLATFORM } from '../constants/config'; const Onboarding = ({ onComplete }) => { const [currentStep, setCurrentStep] = useState(0); diff --git a/src/components/ProtectedRoute.jsx b/src/components/ProtectedRoute.jsx index 1a09d26..507efa8 100644 --- a/src/components/ProtectedRoute.jsx +++ b/src/components/ProtectedRoute.jsx @@ -4,7 +4,7 @@ import SetupForm from './SetupForm'; import LoginForm from './LoginForm'; import Onboarding from './Onboarding'; import { MessageSquare } from 'lucide-react'; -import { IS_PLATFORM } from '../../shared/modelConstants'; +import { IS_PLATFORM } from '../constants/config'; const LoadingScreen = () => (
diff --git a/src/components/Shell.jsx b/src/components/Shell.jsx index 5a6d72a..0bf78fd 100644 --- a/src/components/Shell.jsx +++ b/src/components/Shell.jsx @@ -5,7 +5,7 @@ import { WebglAddon } from '@xterm/addon-webgl'; import { WebLinksAddon } from '@xterm/addon-web-links'; import '@xterm/xterm/css/xterm.css'; import { useTranslation } from 'react-i18next'; -import { IS_PLATFORM } from '../../shared/modelConstants'; +import { IS_PLATFORM } from '../constants/config'; const xtermStyles = ` .xterm .xterm-screen { diff --git a/src/components/Sidebar.jsx b/src/components/Sidebar.jsx index a8d1299..a495cfc 100644 --- a/src/components/Sidebar.jsx +++ b/src/components/Sidebar.jsx @@ -16,7 +16,7 @@ import ProjectCreationWizard from './ProjectCreationWizard'; import { api } from '../utils/api'; import { useTaskMaster } from '../contexts/TaskMasterContext'; import { useTasksSettings } from '../contexts/TasksSettingsContext'; -import { IS_PLATFORM } from '../../shared/modelConstants'; +import { IS_PLATFORM } from '../constants/config'; // Move formatTimeAgo outside component to avoid recreation on every render const formatTimeAgo = (dateString, currentTime, t) => { diff --git a/src/constants/config.ts b/src/constants/config.ts new file mode 100644 index 0000000..6741c35 --- /dev/null +++ b/src/constants/config.ts @@ -0,0 +1,5 @@ +/** + * Environment Flag: Is Platform + * Indicates if the app is running in Platform mode (hosted) or OSS mode (self-hosted) + */ +export const IS_PLATFORM = import.meta.env.VITE_IS_PLATFORM === 'true'; \ No newline at end of file diff --git a/src/contexts/AuthContext.jsx b/src/contexts/AuthContext.jsx index d90a3e3..d974c7d 100644 --- a/src/contexts/AuthContext.jsx +++ b/src/contexts/AuthContext.jsx @@ -1,6 +1,6 @@ import React, { createContext, useContext, useEffect, useState } from 'react'; import { api } from '../utils/api'; -import { IS_PLATFORM } from '../../shared/modelConstants'; +import { IS_PLATFORM } from '../constants/config'; const AuthContext = createContext({ user: null, diff --git a/src/contexts/WebSocketContext.tsx b/src/contexts/WebSocketContext.tsx index 5e48c7e..34bbd8b 100644 --- a/src/contexts/WebSocketContext.tsx +++ b/src/contexts/WebSocketContext.tsx @@ -1,6 +1,6 @@ import { createContext, useContext, useEffect, useRef, useState } from 'react'; import { useAuth } from './AuthContext'; -import { IS_PLATFORM } from '../../shared/modelConstants'; +import { IS_PLATFORM } from '../constants/config'; type WebSocketContextType = { ws: WebSocket | null;