Skip to content

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

pick the sprite import source from managed apps instead of a typed path

[._.]/ Adam Eivy3092177653e0
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index d54d77cd7e..1c3f53ddcd 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -84,3 +84,4 @@
- **[issue-2881] Extract a shared cloud-CLI image-provider resolver** — `resolveCloudProviderConfig(settings, mode)` in the new `server/services/imageGen/cloudProviderConfig.js` owns the enable-gate + job-param bundle that seven dispatch sites (the image-gen route, the dispatcher's `generateImage`/`checkConnection`, first-pass gen, LoRA dataset gen, universe batch render, character reference sheets, pipeline visual stages) each duplicated once per cloud backend. `resolveMode` in `visualStageHelpers.js` becomes a candidate walk over an `isModeUsable` predicate instead of a ladder that grew two `if`s per backend, and the two providers' no-image error narrations now share `buildNoImageReason`. Behavior-preserving except that a queued grok render's response now reports `model: "grok-imagegen"` (it previously reported nothing) and a codex queue row records the effective model instead of an unset one — both already the value the provider renders with. The provider-module lifecycle harness (grok.js structurally copying codex.js) stays deferred until a third cloud CLI arrives, per the issue's acceptance criteria.
- **[issue-2847] Confirm and harden the CyberCity intel tab bar** — the hand-rolled `role="tablist"` in `CityIntelPane` stays hand-rolled (its cyan/`font-pixel` HUD skin and severity-tinted count chips would need a one-off variant in the shared `ui/TabPills`, which no other call site would use) and now carries a comment saying so, so future audits skip it. The ARIA it duplicates is corrected in the process: the collapse toggle moves out of the tablist (it was an invalid non-tab child), each tab gains `id`/`aria-controls` paired to a real `role="tabpanel"`, roving `tabIndex` plus Left/Right/Home/End keyboard navigation, and `aria-expanded` on the collapse toggle; `aria-selected` now tracks the selected tab rather than dropping to false while the pane is collapsed. The three buttons are driven from the already-exported `CITY_INTEL_TABS` instead of triplicated markup.
- **[issue-2839] Extract the boot sequence from `server/index.js` into a bootstrap service** — the ~600 lines of inline startup orchestration (data migrations, collection-schema verification, AI Toolkit construction + runner registration, ~40 fire-and-forget service inits/schedulers, the ordered instance/sync/media-queue/DB chain that ends in `httpServer.listen()`, and the graceful-shutdown state machine) move to `server/services/bootstrap.js` as `bootstrapServices()` / `runBootSequence()` / `registerShutdownHandlers()`. `index.js` drops from 1259 to ~460 lines and is now HTTP/Socket.IO construction, route registration, and three calls into the bootstrap service. Boot ordering, the DB fail-fast gate, and shutdown behavior are unchanged; no new LLM calls at boot.
+- **Pick the sprite import source from the managed-apps list instead of typing a path** — the Sprites import panel replaced its free-text "Source root path" input with the shared `AppContextPicker`, loading `GET /api/apps` on open and filtering to non-archived apps that declare a `repoPath`; the selected app's `repoPath` becomes the importer's `sourceRoot`. Sprite pipelines always live in a repo PortOS already manages, so the typed path was a transcription hazard with no upside, and the picker sets up the eventual sync-from-app flow. `AppContextPicker` gains an `emptyRepoText` prop — its hardcoded "using default PortOS context" empty state would be wrong here, since sprite import has no PortOS fallback; the default is unchanged for existing callers.
diff --git a/client/src/components/AppContextPicker.jsx b/client/src/components/AppContextPicker.jsx
index d833583aba..36c20f529c 100644
--- a/client/src/components/AppContextPicker.jsx
+++ b/client/src/components/AppContextPicker.jsx
@@ -11,7 +11,11 @@ export default function AppContextPicker({
className = '',
selectClassName = 'w-full px-3 py-2 bg-port-bg border border-port-border rounded-lg text-white text-sm min-h-[44px]',
showRepoPath = true,
- repoLabel = 'Repository'
+ repoLabel = 'Repository',
+ // Shown in the repo-path box when nothing is selected. Pickers that do NOT
+ // fall back to PortOS (e.g. sprite import, where the app IS the source)
+ // override this — the default text would lie about what happens.
+ emptyRepoText = 'using default PortOS context'
}) {
const selectedApp = apps.find(app => app.id === value);
const sortedApps = [...apps].sort((a, b) =>
@@ -51,7 +55,7 @@ export default function AppContextPicker({
</div>
</div>
) : (
- <div>{repoLabel}: using default PortOS context</div>
+ <div>{repoLabel}: {emptyRepoText}</div>
)}
</div>
)}
diff --git a/client/src/pages/Sprites.jsx b/client/src/pages/Sprites.jsx
index 5c1acb406a..3fa0a8f9ef 100644
--- a/client/src/pages/Sprites.jsx
+++ b/client/src/pages/Sprites.jsx
@@ -3,6 +3,8 @@ import { useParams, useNavigate } from 'react-router-dom';
import { PersonStanding, Package, Download, FolderOpen, X, RefreshCw, Plus } from 'lucide-react';
import toast from '../components/ui/Toast';
import { listSpriteRecords, getSpriteRecord, importSprites, createSpriteRecord } from '../services/apiSprites.js';
+import { getApps } from '../services/apiApps.js';
+import AppContextPicker from '../components/AppContextPicker.jsx';
import ReferenceWorkflow from '../components/sprites/ReferenceWorkflow.jsx';
import WalkWorkflow from '../components/sprites/WalkWorkflow.jsx';
import PublishWorkflow from '../components/sprites/PublishWorkflow.jsx';
@@ -27,16 +29,29 @@ function topLevelGroup(assetPath) {
function ImportPanel({ onImported }) {
const [open, setOpen] = useState(false);
- const [sourceRoot, setSourceRoot] = useState('');
+ const [apps, setApps] = useState([]);
+ const [appId, setAppId] = useState('');
const [includeProps, setIncludeProps] = useState(true);
const [importing, setImporting] = useState(false);
const [importErrors, setImportErrors] = useState([]);
+ // Sprite sources are managed apps (we import/sync from an app's checkout),
+ // so the picker is the source of truth for the path — no free-text root.
+ // Archived apps and apps with no repoPath can't be a source.
+ useEffect(() => {
+ if (!open) return;
+ getApps({ silent: true })
+ .then((list) => setApps((list || []).filter((a) => a.repoPath && !a.archived)))
+ .catch(() => setApps([]));
+ }, [open]);
+
+ const sourceRoot = apps.find((a) => a.id === appId)?.repoPath || '';
+
const runImport = async () => {
setImporting(true);
setImportErrors([]);
try {
- const { results, totals } = await importSprites({ sourceRoot: sourceRoot.trim(), includeProps });
+ const { results, totals } = await importSprites({ sourceRoot, includeProps });
if (totals.errors > 0) {
// Keep the panel open and show WHICH files failed — a count alone
// gives the user nothing to repair.
@@ -74,20 +89,20 @@ function ImportPanel({ onImported }) {
</button>
</div>
<p className="text-xs text-gray-400">
- Point at a sprite-pipeline checkout (expects <code>art-pipeline/characters/</code> and/or <code>game/assets/sprites/</code>).
- Only approved/final assets import — reference candidates and raw run intermediates stay behind.
+ Pick the managed app holding the sprite pipeline (expects <code>art-pipeline/characters/</code> and/or <code>game/assets/sprites/</code>
+ in its repo). Only approved/final assets import — reference candidates and raw run intermediates stay behind.
</p>
- <div>
- <label htmlFor="sprite-import-source" className="block text-xs text-gray-400 mb-1">Source root path</label>
- <input
- id="sprite-import-source"
- type="text"
- value={sourceRoot}
- onChange={(e) => setSourceRoot(e.target.value)}
- placeholder="~/path/to/game-project"
- className="w-full bg-port-bg border border-port-border rounded px-3 py-1.5 text-sm text-white"
- />
- </div>
+ <AppContextPicker
+ apps={apps}
+ value={appId}
+ onChange={setAppId}
+ label="Source app"
+ placeholder="Select an app…"
+ ariaLabel="Sprite source app"
+ repoLabel="Source root"
+ emptyRepoText="pick an app to import from"
+ selectClassName="w-full bg-port-bg border border-port-border rounded px-3 py-1.5 text-sm text-white min-h-[44px]"
+ />
<label htmlFor="sprite-import-props" className="flex items-center gap-2 text-sm text-gray-300">
<input
id="sprite-import-props"
@@ -99,7 +114,7 @@ function ImportPanel({ onImported }) {
</label>
<button
onClick={runImport}
- disabled={importing || !sourceRoot.trim()}
+ disabled={importing || !sourceRoot}
className="flex items-center gap-2 px-3 py-1.5 bg-port-accent hover:bg-blue-600 disabled:opacity-50 text-white rounded text-sm"
>
{importing ? <RefreshCw className="w-4 h-4 animate-spin" /> : <Download className="w-4 h-4" />}