Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review: extract max sessions constant, fix JSDoc return type, fix vite config indentation, add TTL to settings cache
Adam Eivy0966858a8741
diff --git a/client/src/pages/Shell.jsx b/client/src/pages/Shell.jsxindex 206e8a753d..a0d8a00887 100644--- a/client/src/pages/Shell.jsx+++ b/client/src/pages/Shell.jsx@@ -7,6 +7,9 @@ import '@xterm/xterm/css/xterm.css';import { useSocket } from '../hooks/useSocket';import { RefreshCw, Power, PowerOff, FolderOpen, ChevronDown, Plus, X, Terminal as TerminalIcon } from 'lucide-react';+// Must match MAX_TOTAL_SESSIONS in server/services/shell.js+const MAX_SESSIONS = 5;+const QUICK_COMMANDS = [{ label: 'claude', command: 'claude --dangerously-skip-permissions' },{ label: 'git status', command: 'git status' },@@ -390,7 +393,7 @@ export default function Shell() {{connected ? 'Connected' : 'Disconnected'}</div>{sessions.length > 0 && (- <span className="text-xs text-gray-500 font-mono">{sessions.length}/5</span>+ <span className="text-xs text-gray-500 font-mono">{sessions.length}/{MAX_SESSIONS}</span>)}<div className="flex items-center gap-2 ml-auto">{connected && (diff --git a/client/vite.config.js b/client/vite.config.jsindex fe1091bfed..9a47a5c1f3 100644--- a/client/vite.config.js+++ b/client/vite.config.js@@ -11,45 +11,45 @@ export default defineConfig(({ mode }) => {const API_TARGET = `http://${API_HOST}:5555`;return {- define: {- __APP_VERSION__: JSON.stringify(rootPkg.version)- },- plugins: [react()],- server: {- host: '0.0.0.0',- port: 5554,- open: false,- proxy: {- '/api': {- target: API_TARGET,- changeOrigin: true- },- '/socket.io': {- target: API_TARGET,- changeOrigin: true,- ws: true- }- }- },- build: {- rollupOptions: {- output: {- manualChunks: {- // Core React dependencies- 'vendor-react': ['react', 'react-dom', 'react-router-dom'],- // Socket and toast dependencies- 'vendor-realtime': ['socket.io-client', 'react-hot-toast'],- // Drag and drop library (only used in CoS)- 'vendor-dnd': ['@dnd-kit/core', '@dnd-kit/sortable', '@dnd-kit/utilities'],- // Icon library (largest dependency)- 'vendor-icons': ['lucide-react']+ define: {+ __APP_VERSION__: JSON.stringify(rootPkg.version)+ },+ plugins: [react()],+ server: {+ host: '0.0.0.0',+ port: 5554,+ open: false,+ proxy: {+ '/api': {+ target: API_TARGET,+ changeOrigin: true+ },+ '/socket.io': {+ target: API_TARGET,+ changeOrigin: true,+ ws: true}}},- // Enable source maps for debugging in production- sourcemap: false,- // Increase chunk size warning limit (icons are large)- chunkSizeWarningLimit: 600- }-};+ build: {+ rollupOptions: {+ output: {+ manualChunks: {+ // Core React dependencies+ 'vendor-react': ['react', 'react-dom', 'react-router-dom'],+ // Socket and toast dependencies+ 'vendor-realtime': ['socket.io-client', 'react-hot-toast'],+ // Drag and drop library (only used in CoS)+ 'vendor-dnd': ['@dnd-kit/core', '@dnd-kit/sortable', '@dnd-kit/utilities'],+ // Icon library (largest dependency)+ 'vendor-icons': ['lucide-react']+ }+ }+ },+ // Enable source maps for debugging in production+ sourcemap: false,+ // Increase chunk size warning limit (icons are large)+ chunkSizeWarningLimit: 600+ }+ };});diff --git a/server/services/subAgentSpawner.js b/server/services/subAgentSpawner.jsindex 7b72798768..f19a3dd0b7 100644--- a/server/services/subAgentSpawner.js+++ b/server/services/subAgentSpawner.js@@ -2405,8 +2405,10 @@ function buildSpawnArgs(config, model) {* is present in spawned agent environments even if PM2 was started without them*/let _claudeSettingsEnvCache = null;+let _claudeSettingsEnvCacheTime = 0;+const SETTINGS_CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutesasync function getClaudeSettingsEnv() {- if (_claudeSettingsEnvCache !== null) return _claudeSettingsEnvCache;+ if (_claudeSettingsEnvCache !== null && (Date.now() - _claudeSettingsEnvCacheTime) < SETTINGS_CACHE_TTL_MS) return _claudeSettingsEnvCache;try {const settingsPath = join(homedir(), '.claude', 'settings.json');if (existsSync(settingsPath)) {@@ -2419,6 +2421,7 @@ async function getClaudeSettingsEnv() {} catch (err) {_claudeSettingsEnvCache = {};}+ _claudeSettingsEnvCacheTime = Date.now();return _claudeSettingsEnvCache;}@@ -2740,7 +2743,7 @@ async function generateJiraTitle(description) {/*** Create a JIRA ticket for a task if the app has JIRA integration enabled.* Non-blocking — returns null on failure.- * @returns {Promise<{ticketId: string, ticketUrl: string}|null>}+ * @returns {Promise<{ticketId: string, ticketUrl: string, summary: string}|null>}*/async function createJiraTicketForTask(task, app) {const jira = app?.jira;