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
keep the app-tab constants importable from a node-env server test
[._.]/ Adam Eivy264e1603002e
diff --git a/client/src/components/apps/constants.js b/client/src/components/apps/constants.jsindex 4db0c407e4..343173db37 100644--- a/client/src/components/apps/constants.js+++ b/client/src/components/apps/constants.js@@ -1,4 +1,7 @@-import { PORTOS_APP_ID } from '../../services/apiCore.js';+// From lib/, NOT services/apiCore.js: this file is imported by a node-env server+// test (streamingDetect's DESKTOP_TYPES parity check), where apiCore's React+// dependency doesn't resolve.+import { PORTOS_APP_ID } from '../../lib/appIdentity.js';export const NON_PM2_TYPES = new Set(['ios-native', 'macos-native', 'xcode', 'swift']);diff --git a/client/src/lib/README.md b/client/src/lib/README.mdindex a15f581cee..47f1e58763 100644--- a/client/src/lib/README.md+++ b/client/src/lib/README.md@@ -81,6 +81,7 @@ grep -i "what you want to do" client/src/lib/README.md| Module | Purpose ||---|---|| `a11yKeyboard.js` | `clickableProps(handler, { role?, disabled? })` → `{ role, tabIndex, onKeyDown }` and `onActivateKeyDown(handler)` — make a non-`<button>` element with an `onClick` keyboard-accessible (Enter/Space activation, focusable, `role="button"`). Spread `clickableProps` next to the existing `onClick`. Use instead of hand-rolling `role`/`tabIndex`/`onKeyDown` on clickable `<div>`/`<span>`/`<li>`. |+| `appIdentity.js` | `PORTOS_APP_ID` — stable id of the baseline PortOS app (mirrors `server/lib/appIdentity.js`). Dependency-free so a module reachable from a node-env server test (e.g. `components/apps/constants.js`) can identify PortOS without importing `services/apiCore.js`, which pulls in React via `ui/Toast`. `apiCore.js` re-exports it, so `import { PORTOS_APP_ID } from '../services/api'` still works. || `applyManuscriptEdits.js` | `applyEditsToContent(content, edits, anchorQuote)` — PREVIEW-ONLY client mirror of the server's accept splice (`server/services/pipeline/manuscriptFix.js`): locate each `find` (nearest the anchor when recurring), drop overlaps, replace bottom-up. Powers the Manuscript editor's whole-manuscript impact preview. || `audioRecorder.js` | `startMemoRecording()` → `{ stream, stop, cancel }` handle whose `stop()` resolves to `{ audioBase64, mimeType, peak, durationMs }` (16 kHz mono WAV, base64); the live `stream` lets a tuner tap the same mic. `createStreamAnalyser(stream, { fftSize })` → `{ analyser, context, close }` taps an `AnalyserNode` off an existing stream (no second getUserMedia). Plus `blobToWav16k`, `encodePcmToWav`, `pickRecordingMimeType`, `arrayBufferToBase64`. Standalone one-shot memo capture for catalog voice ingest — NOT the live voice-agent recorder in `services/voiceClient.js`. || `bareUrl.js` | `parseBareUrl(text)` — the normalized URL when a capture's entire text is a URL, else null. Client mirror of the authoritative `server/lib/bareUrl.js` (parity enforced by `server/lib/bareUrl.mirror.test.js`), so the brain capture boxes preview the exact filing decision the server will make. Use this — not the looser `utils/urlNormalize.js` `isUrl` — anywhere the answer must match the server. |diff --git a/client/src/lib/appIdentity.js b/client/src/lib/appIdentity.jsnew file mode 100644index 0000000000..4f1e977a4a--- /dev/null+++ b/client/src/lib/appIdentity.js@@ -0,0 +1,18 @@+/**+ * The managed-apps registry's baseline identity — PortOS itself. Mirrors+ * `server/lib/appIdentity.js`.+ *+ * Split out of `services/apiCore.js` for the same reason the server split it out+ * of `services/apps.js`: a module that only needs to SAY "this record is PortOS"+ * shouldn't have to import the API client — which pulls in `ui/Toast` and+ * therefore React. `client/src/components/apps/constants.js` is imported by a+ * node-env SERVER test (`server/services/streamingDetect.test.js`, the+ * DESKTOP_TYPES parity check), where that React import fails to resolve.+ * `apiCore.js` re-exports the constant, so every existing+ * `import { PORTOS_APP_ID } from '../services/api'` is unchanged.+ *+ * Data only, no dependencies — keep it that way.+ */++/** Stable id of the baseline PortOS app — always present, never deletable. */+export const PORTOS_APP_ID = 'portos-default';diff --git a/client/src/lib/index.js b/client/src/lib/index.jsindex a7e16f749f..69c432623d 100644--- a/client/src/lib/index.js+++ b/client/src/lib/index.js@@ -57,6 +57,7 @@ export * from './goalFeatureMap.js';// === Generic UI / collection utilities ===export * from './a11yKeyboard.js';+export * from './appIdentity.js';export * from './applyManuscriptEdits.js';export * from './audioRecorder.js';export * from './bareUrl.js';diff --git a/client/src/services/apiCore.js b/client/src/services/apiCore.jsindex 0f7076b2f9..4e53f2098c 100644--- a/client/src/services/apiCore.js+++ b/client/src/services/apiCore.js@@ -2,8 +2,10 @@ import toast from '../components/ui/Toast';export const API_BASE = '/api'; // exported for sub-modules that use fetch() directly-// Stable ID for the PortOS baseline app (mirrors server PORTOS_APP_ID)-export const PORTOS_APP_ID = 'portos-default';+// Stable ID for the PortOS baseline app (mirrors server PORTOS_APP_ID). Defined+// in the dependency-free lib/appIdentity.js and re-exported here so callers that+// only need the id don't drag this module's React import along with it.+export { PORTOS_APP_ID } from '../lib/appIdentity.js';// Bounce to /login when the auth gate (server: lib/authGate.js) rejects a// request with 401 + AUTH_REQUIRED. Shared by request() AND the streaming-fetch