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: fix CLAUDECODE env stripping, add update lock, icons/colors, heart rate aggregation, key repeat guard, unused var
Adam Eivye7a4b1ee121a
diff --git a/client/src/components/insights/GenomeHealthTab.jsx b/client/src/components/insights/GenomeHealthTab.jsxindex 1882ac7e0a..ea8ff9a3b5 100644--- a/client/src/components/insights/GenomeHealthTab.jsx+++ b/client/src/components/insights/GenomeHealthTab.jsx@@ -1,5 +1,5 @@import { useState, useEffect } from 'react';-import { ChevronDown, ChevronRight, Dna, Heart, Zap, Activity, TestTube, Droplets, Sun, Leaf } from 'lucide-react';+import { ChevronDown, ChevronRight, Dna, Heart, HeartPulse, Zap, Activity, TestTube, Droplet, Droplets, Sun, Leaf, Sparkles, Apple, Coffee, Shield, ShieldCheck, ShieldAlert, Flame, Brain, BrainCog, Moon, Dumbbell, Salad, Eye, Bone, Pill, Ribbon, Wind, Scissors, Ear } from 'lucide-react';import { Link } from 'react-router-dom';import { getGenomeHealthCorrelations } from '../../services/api';import InsightCard from './InsightCard';@@ -9,14 +9,20 @@ import EmptyState from './EmptyState';// Map string icon names from server to Lucide componentsconst ICON_MAP = {- Heart,- Zap,- Activity,- TestTube,- Droplets,- Sun,- Leaf,- Dna+ Heart, HeartPulse, Zap, Activity, TestTube, Droplet, Droplets, Sun, Leaf, Dna,+ Sparkles, Apple, Coffee, Shield, ShieldCheck, ShieldAlert, Flame, Brain, BrainCog,+ Moon, Dumbbell, Salad, Eye, Bone, Pill, Ribbon, Wind, Scissors, Ear+};++// Server sends single-word Tailwind color names; map to class with shade+const COLOR_CLASS_MAP = {+ rose: 'text-rose-400', red: 'text-red-400', purple: 'text-purple-400',+ blue: 'text-blue-400', emerald: 'text-emerald-400', amber: 'text-amber-400',+ green: 'text-green-400', orange: 'text-orange-400', indigo: 'text-indigo-400',+ cyan: 'text-cyan-400', violet: 'text-violet-400', sky: 'text-sky-400',+ yellow: 'text-yellow-400', lime: 'text-lime-400', pink: 'text-pink-400',+ teal: 'text-teal-400', stone: 'text-stone-400', fuchsia: 'text-fuchsia-400',+ slate: 'text-slate-400', zinc: 'text-zinc-400', gray: 'text-gray-400'};// Map marker status to confidence level key@@ -39,7 +45,7 @@ function CategorySection({ category }) {className="w-full flex items-center justify-between px-4 py-3 bg-port-card hover:bg-port-border/20 transition-colors"><div className="flex items-center gap-3">- <Icon size={18} className={category.color ? `text-${category.color}` : 'text-port-accent'} />+ <Icon size={18} className={COLOR_CLASS_MAP[category.color] ?? 'text-port-accent'} /><span className="text-sm font-semibold text-white">{category.label}</span><span className="text-xs text-gray-500 bg-gray-800 px-2 py-0.5 rounded-full">{category.markers.length} markersdiff --git a/client/src/components/meatspace/ActivityBloodCorrelation.jsx b/client/src/components/meatspace/ActivityBloodCorrelation.jsxindex 3018a43227..02458e3018 100644--- a/client/src/components/meatspace/ActivityBloodCorrelation.jsx+++ b/client/src/components/meatspace/ActivityBloodCorrelation.jsx@@ -6,7 +6,6 @@ import {const PREFERRED_MARKERS = ['cholesterol', 'glucose', 'ldl', 'hdl', 'triglycerides'];function compute30DayRollingAvg(dailyData, testDate) {- const cutoff = new Date(testDate);const windowStart = new Date(testDate);windowStart.setDate(windowStart.getDate() - 30);const startStr = windowStart.toISOString().split('T')[0];diff --git a/client/src/hooks/useCmdKSearch.js b/client/src/hooks/useCmdKSearch.jsindex 35627237e0..8aba80fd57 100644--- a/client/src/hooks/useCmdKSearch.js+++ b/client/src/hooks/useCmdKSearch.js@@ -5,7 +5,7 @@ export function useCmdKSearch() {useEffect(() => {const handler = (e) => {- if ((e.metaKey || e.ctrlKey) && e.key === 'k') {+ if ((e.metaKey || e.ctrlKey) && e.key === 'k' && !e.repeat) {e.preventDefault();setOpen(prev => !prev);}diff --git a/package-lock.json b/package-lock.jsonindex de00865620..8c00b6ea07 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "portos",- "version": "1.14.3",+ "version": "1.14.4","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "portos",- "version": "1.14.3",+ "version": "1.14.4","license": "MIT","dependencies": {"express": "^4.21.2",diff --git a/package.json b/package.jsonindex cf20df1db2..4dfd7623bb 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "portos",- "version": "1.14.3",+ "version": "1.14.4","private": true,"description": "Local dev machine App OS portal","author": "Adam Eivy (@antic|@atomantic)",diff --git a/server/cos-runner/index.js b/server/cos-runner/index.jsindex 4ebd9a5213..4f4a665235 100644--- a/server/cos-runner/index.js+++ b/server/cos-runner/index.js@@ -434,7 +434,7 @@ app.post('/spawn', async (req, res) => {cwd,shell: false,stdio: ['pipe', 'pipe', 'pipe'],- env: { ...process.env, ...envVars, CLAUDECODE: undefined },+ env: (() => { const e = { ...process.env, ...envVars }; delete e.CLAUDECODE; return e; })(),windowsHide: true});@@ -712,7 +712,7 @@ app.post('/run', async (req, res) => {cwd,shell: false,stdio: ['pipe', 'pipe', 'pipe'],- env: { ...process.env, ...envVars, CLAUDECODE: undefined },+ env: (() => { const e = { ...process.env, ...envVars }; delete e.CLAUDECODE; return e; })(),windowsHide: true});diff --git a/server/services/appUpdater.js b/server/services/appUpdater.jsindex 57a878218e..dd6feeb15e 100644--- a/server/services/appUpdater.js+++ b/server/services/appUpdater.js@@ -31,6 +31,9 @@ function runCommand(cmd, args, cwd) {});}+// Per-app lock to prevent concurrent updates+const updatingApps = new Set();+/*** Run a full update cycle for an app:* 1. git pull --rebase --autostash@@ -43,6 +46,20 @@ function runCommand(cmd, args, cwd) {* @returns {Promise<{success: boolean, steps: object[]}>}*/export async function updateApp(app, emit) {+ const dir = app.repoPath;+ if (updatingApps.has(dir)) {+ return { success: false, steps: [{ step: 'lock', success: false, message: 'Update already in progress' }] };+ }+ updatingApps.add(dir);++ try {+ return await _doUpdate(app, emit);+ } finally {+ updatingApps.delete(dir);+ }+}++async function _doUpdate(app, emit) {const dir = app.repoPath;const steps = [];@@ -58,10 +75,11 @@ export async function updateApp(app, emit) {const subDir = sub ? join(dir, sub) : dir;if (existsSync(join(subDir, 'package.json'))) {const label = sub || 'root';- emit('npm-install', 'running', `Installing ${label} dependencies...`);+ const stepId = `npm-install:${label}`;+ emit(stepId, 'running', `Installing ${label} dependencies...`);await runCommand('npm', ['install'], subDir);- emit('npm-install', 'done', `${label} dependencies installed`);- steps.push({ step: `npm-install:${label}`, success: true });+ emit(stepId, 'done', `${label} dependencies installed`);+ steps.push({ step: stepId, success: true });}}diff --git a/server/services/appleHealthQuery.js b/server/services/appleHealthQuery.jsindex cfbfc9cc5a..72265c7ce8 100644--- a/server/services/appleHealthQuery.js+++ b/server/services/appleHealthQuery.js@@ -140,11 +140,16 @@ export async function getDailyAggregates(metricName, from, to) {// Sum qty per dayvalue = points.reduce((sum, p) => sum + (p.qty ?? 0), 0);} else if (metricName === 'heart_rate') {- // Average of Avg values+ // Average of Avg values (JSON ingest) or qty values (XML ingest)const avgPoints = points.filter(p => p.Avg !== undefined);- value = avgPoints.length > 0- ? avgPoints.reduce((sum, p) => sum + p.Avg, 0) / avgPoints.length- : null;+ const qtyPoints = points.filter(p => p.qty !== undefined);+ if (avgPoints.length > 0) {+ value = avgPoints.reduce((sum, p) => sum + p.Avg, 0) / avgPoints.length;+ } else if (qtyPoints.length > 0) {+ value = qtyPoints.reduce((sum, p) => sum + p.qty, 0) / qtyPoints.length;+ } else {+ value = null;+ }} else if (metricName === 'heart_rate_variability_sdnn') {// Average qty per dayconst qtyPoints = points.filter(p => p.qty !== undefined);@@ -152,9 +157,19 @@ export async function getDailyAggregates(metricName, from, to) {? qtyPoints.reduce((sum, p) => sum + p.qty, 0) / qtyPoints.length: null;} else if (metricName === 'sleep_analysis') {- // Take totalSleep directly from the most recent point- const sleepPoint = points.find(p => p.totalSleep !== undefined);- value = sleepPoint?.totalSleep ?? null;+ // Return full sleep summary with stage breakdown from most recent aggregated point+ const sleepPoint = [...points].reverse().find(p => p.totalSleep !== undefined);+ if (sleepPoint) {+ results.push({+ date: dateStr,+ value: Math.round((sleepPoint.totalSleep ?? 0) * 100) / 100,+ deep: sleepPoint.deep ?? 0,+ rem: sleepPoint.rem ?? 0,+ core: sleepPoint.core ?? 0,+ awake: sleepPoint.awake ?? 0+ });+ }+ continue;} else {// Default: average qtyconst qtyPoints = points.filter(p => p.qty !== undefined);diff --git a/server/services/brain.js b/server/services/brain.jsindex 085dcd2ab9..455bc5c0f4 100644--- a/server/services/brain.js+++ b/server/services/brain.js@@ -55,7 +55,7 @@ async function callAI(promptStageName, variables, providerOverride, modelOverridlet output = '';const child = spawn(provider.command, args, {- env: { ...process.env, ...provider.envVars, CLAUDECODE: undefined },+ env: (() => { const e = { ...process.env, ...provider.envVars }; delete e.CLAUDECODE; return e; })(),shell: false,windowsHide: true});diff --git a/server/services/digital-twin.js b/server/services/digital-twin.jsindex f0887920c9..bb80f62cca 100644--- a/server/services/digital-twin.js+++ b/server/services/digital-twin.js@@ -326,7 +326,7 @@ async function callProviderAI(provider, model, prompt, { temperature = 0.3, max_let resolved = false;const child = spawn(provider.command, args, {- env: { ...process.env, ...provider.envVars, CLAUDECODE: undefined },+ env: (() => { const e = { ...process.env, ...provider.envVars }; delete e.CLAUDECODE; return e; })(),shell: false,stdio: ['pipe', 'pipe', 'pipe'],windowsHide: truediff --git a/server/services/runner.js b/server/services/runner.jsindex f7e6d60692..0769122146 100644--- a/server/services/runner.js+++ b/server/services/runner.js@@ -70,7 +70,7 @@ export async function executeCliRun(runId, provider, prompt, workspacePath, onDaconst childProcess = spawn(provider.command, args, {cwd: workspacePath,- env: { ...process.env, ...provider.envVars, CLAUDECODE: undefined },+ env: (() => { const e = { ...process.env, ...provider.envVars }; delete e.CLAUDECODE; return e; })(),windowsHide: true});diff --git a/server/services/subAgentSpawner.js b/server/services/subAgentSpawner.jsindex f19d6bf95a..862863429a 100644--- a/server/services/subAgentSpawner.js+++ b/server/services/subAgentSpawner.js@@ -1883,12 +1883,7 @@ async function spawnDirectly(agentId, task, prompt, workspacePath, model, providshell: false,stdio: ['pipe', 'pipe', 'pipe'],windowsHide: true,- env: {- ...process.env,- ...provider.envVars,- // Strip Claude Code session markers so child CLI processes don't detect nesting- CLAUDECODE: undefined- }+ env: (() => { const e = { ...process.env, ...provider.envVars }; delete e.CLAUDECODE; return e; })()});registerSpawnedAgent(claudeProcess.pid, {