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
feat(issue-2953): add the 3D page under Create with a TRELLIS.2 install UI
[._.]/ Adam Eivy59ecf0f2b94f
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex c18281927e..9b6c06906d 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -1,5 +1,9 @@# Unreleased+## 3D++- **[issue-2953] Install image-to-3D models from a new 3D page** — a new **3D** page under Create lists the available image-to-3D models (starting with Microsoft TRELLIS.2) and shows each one's state at a glance: **Ready**, an **Install** button, or a note explaining why your hardware can't run it (e.g. needs an Apple Silicon Mac with enough memory). Installing runs entirely on-device with a live progress log — the same in-app install experience as the image generators — so you never touch a terminal. Reachable from the sidebar, ⌘K, and voice. (Turning one of your rendered images into a 3D mesh from this page lands next.)+## Internal- **[issue-2951] Image-to-3D target registry (foundation)** — added a pluggable `server/services/imageTo3d/targets.js` registry (mirroring `imageGen/modes.js`) that models image→3D models as selectable targets with hardware-gated availability resolution, TRELLIS.2 registered as the first target, and a read-only `GET /api/image-to-3d/targets` endpoint. Backend groundwork for the forthcoming 3D page under Create (#2952 install/runner, #2953 page/viewer, #2954 CUDA lane); no user-visible surface yet.diff --git a/client/src/App.jsx b/client/src/App.jsxindex b3aa8a2d74..d874afbd29 100644--- a/client/src/App.jsx+++ b/client/src/App.jsx@@ -51,6 +51,7 @@ const MediaCollectionSyncView = lazyWithReload(() => import('./pages/MediaCollecconst SyncView = lazyWithReload(() => import('./pages/SyncView'));const MediaModels = lazyWithReload(() => import('./pages/MediaModels'));const ThreejsModels = lazyWithReload(() => import('./pages/ThreejsModels'));+const Media3D = lazyWithReload(() => import('./pages/Media3D'));const ThreejsModelDetail = lazyWithReload(() => import('./pages/ThreejsModelDetail'));const Loras = lazyWithReload(() => import('./pages/Loras'));const LoraTraining = lazyWithReload(() => import('./pages/LoraTraining'));@@ -344,6 +345,7 @@ export default function App() {<Route path="models" element={<MediaModels />} /><Route path="threejs" element={<ThreejsModels />} /><Route path="threejs/:id" element={<ThreejsModelDetail />} />+ <Route path="3d" element={<Media3D />} /><Route path="loras" element={<Loras />} /><Route path="training" element={<LoraTraining />} /><Route path="training/:datasetId" element={<LoraDatasetDetail />} />diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsxindex e379920057..23989759f5 100644--- a/client/src/components/Layout.jsx+++ b/client/src/components/Layout.jsx@@ -94,7 +94,8 @@ import {ChartGantt,Clapperboard,PersonStanding,- Box+ Box,+ Boxes} from 'lucide-react';/* global __APP_VERSION__ */import { safeReadStorage, safeWriteStorage } from '../lib/safeStorage';@@ -219,6 +220,7 @@ const navItems = [icon: Sparkles,defaultTo: '/media',children: [+ { to: '/media/3d', label: '3D', icon: Boxes },{ to: '/authors', label: 'Authors', icon: FilePen },{ to: '/catalog', label: 'Catalog', icon: Sparkles },{ to: '/creative-commission', label: 'Creative Commissions', icon: CalendarClock },diff --git a/client/src/pages/Media3D.jsx b/client/src/pages/Media3D.jsxnew file mode 100644index 0000000000..424bc8b94f--- /dev/null+++ b/client/src/pages/Media3D.jsx@@ -0,0 +1,162 @@+import { useCallback, useEffect, useState } from 'react';+import { Boxes, CheckCircle2, Download, AlertTriangle, Loader2, ExternalLink } from 'lucide-react';+import { getImageTo3dTargets } from '../services/api';+import RuntimeInstallModal from '../components/install/RuntimeInstallModal';++// Human-readable reasons a target can't run on this host, keyed by the stable+// reason code the registry returns (server/services/imageTo3d/targets.js).+const REASON_LABEL = {+ 'requires-apple-silicon': 'Requires an Apple Silicon Mac',+ 'insufficient-memory': 'Needs 24 GB+ of unified memory',+ 'requires-cuda': 'Requires an NVIDIA CUDA GPU',+ 'unknown-target': 'Unavailable',+};++const LANE_LABEL = {+ 'local-mps': 'Runs on-device (Apple Silicon)',+ 'local-cuda': 'Runs on-device (CUDA)',+ 'hosted-api': 'Hosted API',+};++function StatusBadge({ target }) {+ if (!target.available) {+ return (+ <span className="inline-flex items-center gap-1.5 text-xs font-medium text-port-warning">+ <AlertTriangle className="w-3.5 h-3.5" />+ {REASON_LABEL[target.unavailableReason] || 'Unsupported on this host'}+ </span>+ );+ }+ if (target.installed) {+ return (+ <span className="inline-flex items-center gap-1.5 text-xs font-medium text-port-success">+ <CheckCircle2 className="w-3.5 h-3.5" /> Ready+ </span>+ );+ }+ return null;+}++function TargetCard({ target, onInstall }) {+ // Install only applies to targets with a local install concept (installed is a+ // boolean); hosted targets report installed:null and are Ready when available.+ const canInstall = target.available && target.installed === false;++ return (+ <div className="rounded-lg border border-port-border bg-port-card p-4">+ <div className="flex flex-wrap items-start justify-between gap-3">+ <div className="min-w-0">+ <div className="flex items-center gap-2">+ <h2 className="text-sm font-semibold text-white">{target.label}</h2>+ {target.executionLane && (+ <span className="rounded bg-port-bg px-1.5 py-0.5 text-[11px] text-gray-400">+ {LANE_LABEL[target.executionLane] || target.executionLane}+ </span>+ )}+ </div>+ {target.description && (+ <p className="mt-1 text-xs text-gray-400">{target.description}</p>+ )}+ {(target.upstream || target.port) && (+ <div className="mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-gray-500">+ {target.upstream && (+ <a href={target.upstream} target="_blank" rel="noreferrer"+ className="inline-flex items-center gap-1 hover:text-port-accent">+ <ExternalLink className="w-3 h-3" /> Upstream+ </a>+ )}+ {target.port && (+ <a href={target.port} target="_blank" rel="noreferrer"+ className="inline-flex items-center gap-1 hover:text-port-accent">+ <ExternalLink className="w-3 h-3" /> Apple Silicon port+ </a>+ )}+ </div>+ )}+ </div>+ <div className="flex shrink-0 flex-col items-end gap-2">+ <StatusBadge target={target} />+ {canInstall && (+ <button+ onClick={() => onInstall(target)}+ className="inline-flex items-center gap-1.5 rounded-md bg-port-accent px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-600"+ >+ <Download className="w-3.5 h-3.5" /> Install+ </button>+ )}+ </div>+ </div>+ </div>+ );+}++export default function Media3D() {+ const [targets, setTargets] = useState([]);+ const [loading, setLoading] = useState(true);+ const [error, setError] = useState(null);+ // The target whose install modal is open (only local-install targets); null = closed.+ const [installTarget, setInstallTarget] = useState(null);++ const load = useCallback(() => {+ setLoading(true);+ getImageTo3dTargets()+ .then((data) => { setTargets(data?.targets || []); setError(null); })+ .catch((err) => setError(err?.message || 'Failed to load 3D targets'))+ .finally(() => setLoading(false));+ }, []);++ useEffect(() => { load(); }, [load]);++ return (+ <div className="mx-auto max-w-4xl">+ <header className="mb-5">+ <div className="flex items-center gap-2">+ <Boxes className="h-5 w-5 text-port-accent" />+ <h1 className="text-lg font-semibold text-white">3D</h1>+ </div>+ <p className="mt-1 text-sm text-gray-400">+ Turn a rendered image into a 3D mesh. Install and manage the image-to-3D models here;+ generation from an image lands next.+ </p>+ </header>++ {loading && (+ <div className="flex items-center gap-2 text-sm text-gray-400">+ <Loader2 className="h-4 w-4 animate-spin" /> Loading models…+ </div>+ )}++ {error && !loading && (+ <div className="flex items-center justify-between rounded-lg border border-port-error/40 bg-port-error/10 p-4 text-sm text-port-error">+ <span>{error}</span>+ <button onClick={load} className="rounded-md border border-port-error/50 px-3 py-1 text-xs hover:bg-port-error/20">+ Retry+ </button>+ </div>+ )}++ {!loading && !error && (+ <div className="space-y-3">+ {targets.length === 0 && (+ <p className="text-sm text-gray-500">No image-to-3D models are registered.</p>+ )}+ {targets.map((target) => (+ <TargetCard key={target.id} target={target} onInstall={setInstallTarget} />+ ))}+ </div>+ )}++ {/* TRELLIS.2 (and any future local-install target) streams its clone ++ setup.sh install through the shared runtime-install modal. */}+ <RuntimeInstallModal+ open={!!installTarget}+ runtime={installTarget?.id}+ label={installTarget?.label}+ installUrlBase="/api/image-to-3d/trellis2/install"+ description="Cloning the TRELLIS.2 (Apple Silicon) port and installing its Python environment. The model weights are a large download on first run (~15 GB)."+ onClose={() => setInstallTarget(null)}+ onComplete={() => { setInstallTarget(null); load(); }}+ />+ </div>+ );+}diff --git a/client/src/pages/Media3D.test.jsx b/client/src/pages/Media3D.test.jsxnew file mode 100644index 0000000000..c9426887a4--- /dev/null+++ b/client/src/pages/Media3D.test.jsx@@ -0,0 +1,66 @@+import { describe, it, expect, vi, beforeEach } from 'vitest';+import { render, screen, fireEvent } from '@testing-library/react';+import Media3D from './Media3D';++const getImageTo3dTargets = vi.fn();+vi.mock('../services/api', () => ({+ getImageTo3dTargets: (...a) => getImageTo3dTargets(...a),+}));++// Stub the shared install modal so the test doesn't open a real EventSource;+// assert only that it's opened with the chosen target.+vi.mock('../components/install/RuntimeInstallModal', () => ({+ default: ({ open, runtime }) => (open ? <div data-testid="install-modal">installing {runtime}</div> : null),+}));++const target = (over = {}) => ({+ id: 'trellis2',+ label: 'TRELLIS.2',+ description: 'Microsoft TRELLIS.2 — single image to a PBR-textured GLB mesh.',+ executionLane: 'local-mps',+ outputKind: 'glb-mesh',+ available: true,+ installed: false,+ unavailableReason: null,+ upstream: 'https://github.com/microsoft/TRELLIS.2',+ port: 'https://github.com/shivampkumar/trellis-mac',+ ...over,+});++describe('Media3D', () => {+ beforeEach(() => vi.clearAllMocks());++ it('shows an Install button for an available, not-installed target and opens the modal', async () => {+ getImageTo3dTargets.mockResolvedValue({ capabilities: {}, targets: [target()] });+ render(<Media3D />);+ const btn = await screen.findByRole('button', { name: /install/i });+ fireEvent.click(btn);+ expect(await screen.findByTestId('install-modal')).toHaveTextContent('trellis2');+ });++ it('shows Ready and no Install button when the target is installed', async () => {+ getImageTo3dTargets.mockResolvedValue({ targets: [target({ installed: true })] });+ render(<Media3D />);+ expect(await screen.findByText(/ready/i)).toBeInTheDocument();+ expect(screen.queryByRole('button', { name: /install/i })).toBeNull();+ });++ it('shows the unsupported reason and no Install button when the host cannot run it', async () => {+ getImageTo3dTargets.mockResolvedValue({+ targets: [target({ available: false, unavailableReason: 'requires-apple-silicon' })],+ });+ render(<Media3D />);+ expect(await screen.findByText(/requires an apple silicon mac/i)).toBeInTheDocument();+ expect(screen.queryByRole('button', { name: /install/i })).toBeNull();+ });++ it('surfaces a load error with Retry, and recovers on retry', async () => {+ getImageTo3dTargets.mockRejectedValueOnce(new Error('boom'));+ render(<Media3D />);+ expect(await screen.findByText('boom')).toBeInTheDocument();++ getImageTo3dTargets.mockResolvedValueOnce({ targets: [target({ installed: true })] });+ fireEvent.click(screen.getByRole('button', { name: /retry/i }));+ expect(await screen.findByText(/ready/i)).toBeInTheDocument();+ });+});diff --git a/client/src/services/apiCore.js b/client/src/services/apiCore.jsindex 0f7076b2f9..7bfa316218 100644--- a/client/src/services/apiCore.js+++ b/client/src/services/apiCore.js@@ -90,6 +90,10 @@ export async function request(endpoint, options = {}) {// Searchexport const search = (q) => request(`/search?q=${encodeURIComponent(q)}`);+// Image-to-3D: the selectable targets (TRELLIS.2, …) annotated with host+// availability + install status, for the /media/3d management page.+export const getImageTo3dTargets = () => request('/image-to-3d/targets');+// Default export for simplified importsexport default {get: (endpoint, options) => request(endpoint, { method: 'GET', ...options }),diff --git a/server/lib/navManifest.js b/server/lib/navManifest.jsindex 59652436a2..76ad7bd94b 100644--- a/server/lib/navManifest.js+++ b/server/lib/navManifest.js@@ -30,6 +30,7 @@ export const NAV_COMMANDS = [{ id: 'nav.media.timeline', path: '/media/timeline', label: 'Timeline', section: 'Create', aliases: ['timeline', 'video-timeline', 'editor'], keywords: ['edit', 'trim', 'composite', 'stitch', 'cut', 'compose'] },{ id: 'nav.media.models', path: '/media/models', label: 'Media Models', section: 'Create', aliases: ['media-models', 'image-models', 'video-models', 'huggingface'], keywords: ['hf cache', 'model storage', 'disk', 'add model', 'install model', 'custom model'] },{ id: 'nav.media.threejs', path: '/media/threejs', label: 'Three.js Models', section: 'Create', aliases: ['threejs', 'three-js', '3d-models', 'image-to-3d', 'img2threejs'], keywords: ['procedural', '3d', 'mesh', 'model', 'gallery', 'webgl', 'preview'] },+ { id: 'nav.media.3d', path: '/media/3d', label: '3D', section: 'Create', aliases: ['3d', 'image-to-mesh', 'mesh', 'trellis', 'neural-3d'], keywords: ['trellis', 'glb', 'mesh', 'photogrammetry', 'neural', 'image to 3d', 'install', 'model', 'pbr'] },{ id: 'nav.create.authors', path: '/authors', label: 'Authors', section: 'Create', aliases: ['authors', 'author', 'byline', 'author-persona', 'writer-persona'], keywords: ['author', 'byline', 'pen name', 'persona', 'writing style', 'bio', 'headshot', 'cover', 'book author'] },{ id: 'nav.create.universe-builder', path: '/universes', label: 'Universes', section: 'Create', aliases: ['universes', 'universe', 'universe-builder', 'worldbuilder', 'worldbuild', 'world', 'lore', 'universe-canon', 'canon'], keywords: ['style template', 'sci-fi', 'fantasy', 'concept art', 'batch render', 'variations', 'characters', 'settings', 'objects', 'canon entries', 'list', 'manage'] },{ id: 'nav.create.importer', path: '/importer', label: 'Importer', section: 'Create', aliases: ['importer', 'import'], keywords: ['paste', 'screenplay', 'novel', 'short story', 'comic script', 'analyze', 'reverse-engineer', 'extract'] },