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
Merge remote-tracking branch 'origin/main' into next/issue-1970
[._.]/ Adam Eivy345679af529a
diff --cc .changelog/NEXT.mdindex 21bdb334cd,4e1574a277..5c0d60ecc5--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@@ -26,12 -34,9 +34,13 @@@## Dev Tools+ - **[issue-1975] View system logs straight from a failed AI run.** Failed runs in **Dev Tools → AI Runs History** now have a **View System Logs** button (both a quick icon on the collapsed row and a labeled button in the expanded error panel) that pops open the relevant PortOS system log — `portos-cos` for CoS-agent runs, `portos-server` for everything else — so an operator who doesn't know where the logs live can read the full error context without leaving the page. The log viewer includes a process picker and a tail-length selector, and is a reusable `ProcessLogModal` that any part of the app can open. (Closes #1975)- **[issue-1946] Download full videos from a YouTube or x.com URL.** A new **Dev Tools → Video Downloader** page lets you paste a YouTube (video/shorts/youtu.be) or x.com/Twitter status URL and download the *full video* (not just the audio, which is #1945's job) via `yt-dlp` — the same host dependency the music-video track import already uses. The clip lands in your video storage as a distinguishable `downloaded-<id>.mp4`, gets an auto-generated thumbnail, and — because it's written as a `source: 'download'` entry into the shared video-history store — also shows up in your media gallery alongside AI-generated renders (no new "library" concept; the existing media asset index picks it up through the same completed-video path it already uses, and prunes it on delete). Download progress streams live (download % → merging → finalizing) with a Cancel button, and the page lists everything you've downloaded (thumbnail, title, source link, age) with delete. x.com/Twitter pulls are best-effort — login-walled or rate-limited posts surface a clear error rather than a generic failure. Long/huge downloads are bounded (≤1h, ≤2GB) so a livestream or archive URL can't eat disk unbounded. `POST /api/devtools/video-download` (`server/services/videoDownload.js`, `server/routes/videoDownload.js`) mirrors #1945's async-job/SSE pattern. (Closes #1946)+## Pipeline++- **[issue-1970] Pipeline image-gen drawers now group their settings into labeled sections.** The "Reference image gen" (NounsStage) and "Comic page image gen" (ComicScriptStage) config drawers previously rendered the shared `ImageGenSettingsForm` as one flat scroll; they now show three organized sections — **Backend**, **Model & LoRA**, and **Prompts & Style** — so the backend picker, per-model controls grid, and prompt/style textareas are visually separated instead of running together. Both drawers open at the `md` size so the per-model controls grid isn't cramped. The organization is opt-in via a new `grouped` prop on `ImageGenSettingsForm`, so the form's in-page host (UniverseBuilder's Batch-render card) keeps its existing flat layout unchanged. All controls and save/apply behavior are preserved — this is layout-only. The Backend section is dropped (leaving just the "no backend configured" warning) when no backend is available, and the Prompts & Style section is dropped when both style fields and the preset picker are hidden, so no empty section card ever shows. (`client/src/components/imageGen/ImageGenSettingsForm.jsx`, `client/src/components/pipeline/stages/NounsStage.jsx`, `client/src/components/pipeline/stages/ComicScriptStage.jsx`) (Closes #1970)+## Architecture- **[issue-1878] CoS runner now wires the process-level `unhandledRejection`/`uncaughtException` net (defense-in-depth).** The main server (`server/index.js`) already registered a process-level net via the shared `setupProcessErrorHandlers()` helper (`server/lib/errorHandler.js`) — but the standalone CoS runner (`server/cos-runner/index.js`), a separate long-lived PM2 process that spawns and supervises child agents, had none, so a stray async handler that rejected/threw outside the request lifecycle would crash it with Node's default unhandled output. The runner now calls the same shared helper, giving it the identical, already-tested convention: log via the emoji-prefixed `console.error` style, log-and-stay-alive on an unhandled rejection, and log-then-exit-cleanly on an uncaught exception (after flushing, so PM2 restarts a process that would otherwise be left in an undefined state and reaps any orphaned agents on boot). Reusing the shared helper (rather than rolling inline handlers) keeps the two long-lived processes consistent and routes arbitrary non-Error throw values through `normalizeError`, so the net can't itself throw on a `reason` with no `.stack`. This is the backstop for the per-handler try/catch wrapping done in #1825 — not a replacement for it. While wiring this up, hardened the shared helper's `uncaughtException` branch, which dereferenced `error.stack` on the raw thrown value — a non-Error throw (`throw null`) made the net itself throw, masking the original exception and skipping the clean exit/flush; it now guards `error instanceof Error` (mirroring the existing `unhandledRejection` branch). A regression test (`server/process-safety-net.test.js`) asserts the shared helper registers both handlers, that both entry processes wire it up, and that the `uncaughtException` listener tolerates a non-Error throw value. (Closes #1878)