Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
refactor: delete 836 net lines of metadata and dead exports nothing reads
Rahman844eef3628d9
diff --git a/docs/SLICE-CATALOG.md b/docs/SLICE-CATALOG.mdindex b0bac35e..a47585c6 100644--- a/docs/SLICE-CATALOG.md+++ b/docs/SLICE-CATALOG.md@@ -23,7 +23,7 @@ contract, served by `lib/host` (fs/exec/sys) or `MockAdapter`.| `files-manager` | full | infra | Files — VPS file manager || `image-editor` | frontend | ui | Image Editor — layered raster editor || `image-picker` | ui | ui | Image Picker — one-button image/wallpaper chooser (gallery · upload · link · Unsplash · reposition) |-| `managed-apps` | — | — | Managed applications — Hermes + OpenClaw lifecycle, update centre, dashboard proxy. **No `slice.json`** — `scripts/check-slices.mjs` skips it, so it is the one slice with no validated contract |+| `managed-apps` | — | — | Managed applications — Hermes + OpenClaw lifecycle, update centre, dashboard proxy. || `media-studio` | full | ui | Media Studio — photo / image editor || `media-viewer` | full | ui | Preview — media quick-look || `os-settings` | full | ui | Settings — appearance + VPS server |diff --git a/frontend/slices/app-store/slice.json b/frontend/slices/app-store/slice.jsondeleted file mode 100644index d77eb460..00000000--- a/frontend/slices/app-store/slice.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "app-store",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "App Store — discover & install apps",- "description": "OS app store browsing a mock catalog of installable apps with search, category filter and a glossy card grid. Install state is tracked in local component state (no backend).",- "namespace": "@/features/app-store",- "frontend": {- "slicePath": "frontend/slices/app-store",- "configExport": "appStoreApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["button", "scroll-area", "separator", "input", "segmented", "badge", "card", "tooltip"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "store", "apps", "ui"]-}diff --git a/frontend/slices/appshell/index.ts b/frontend/slices/appshell/index.tsindex 63f1537e..0908bd63 100644--- a/frontend/slices/appshell/index.ts+++ b/frontend/slices/appshell/index.ts@@ -74,7 +74,6 @@ export type {// spaces/window-tabs/clipboard/share/lock/profiles/shortcuts/focus-mode/dnd/quick-look).export * from "./lib/commands";export * from "./lib/badges";-export * from "./lib/layouts";export * from "./lib/recents";export { useDockPrefs, setDockPrefs, DOCK_SIZE_PX, type DockSize, type DockPrefs } from "./lib/dock-prefs";export { useShellWallpaper, useShellWallpapers, setShellWallpaper, type ShellWallpapers } from "./lib/wallpaper-prefs";diff --git a/frontend/slices/appshell/lib/badges.ts b/frontend/slices/appshell/lib/badges.tsindex b2b292d2..31328f02 100644--- a/frontend/slices/appshell/lib/badges.ts+++ b/frontend/slices/appshell/lib/badges.ts@@ -54,12 +54,3 @@ export function useBadge(appId: string): AppIconBadge | undefined {() => badges[appId],);}--/** The whole badge map (Settings/debug surfaces). */-export function useBadges(): Record<string, AppIconBadge> {- return useSyncExternalStore(- subscribe,- () => badges,- () => badges,- );-}diff --git a/frontend/slices/appshell/lib/dnd.ts b/frontend/slices/appshell/lib/dnd.tsindex bd5ba796..7e390395 100644--- a/frontend/slices/appshell/lib/dnd.ts+++ b/frontend/slices/appshell/lib/dnd.ts@@ -1,9 +1,15 @@"use client";-// Cross-app drag & drop seam. Sources attach makeDragProps(data) to anything-// draggable; every window's content area is a drop target that routes the-// typed payload to the target app's registered drop handler. Payloads ride a-// custom mime so native browser drags (file uploads) keep working untouched.+// Cross-app drag & drop seam — the RECEIVING half only. Every window's content+// area is a drop target that routes a typed payload to the target app's+// registered drop handler. Payloads ride a custom mime so native browser drags+// (file uploads) keep working untouched.+//+// There is deliberately no producer helper here. One existed (makeDragProps) with+// zero callers, so nothing in the app ever wrote DND_MIME and this whole path was+// unreachable outside tests and the ?e2e=1 dev command — files-manager's own drag+// writes "text/plain" instead. To actually light this up, have a real drag source+// set DND_MIME; until then the read half is dormant by design, not by accident.export const DND_MIME = "application/x-shell-payload";@@ -46,20 +52,6 @@ export function deliverDrop(appId: string, data: DragData): boolean {return true;}-/** Spread these onto any element to make it a cross-app drag source. */-export function makeDragProps(data: DragData): {- draggable: true;- onDragStart: (e: React.DragEvent) => void;-} {- return {- draggable: true,- onDragStart: (e) => {- e.dataTransfer.setData(DND_MIME, JSON.stringify(data));- e.dataTransfer.effectAllowed = "copy";- },- };-}-/** Parse a shell payload off a drag event (null for native/file drags). */export function readDragData(e: React.DragEvent): DragData | null {try {diff --git a/frontend/slices/appshell/lib/layouts.test.ts b/frontend/slices/appshell/lib/layouts.test.tsdeleted file mode 100644index 72bc5991..00000000--- a/frontend/slices/appshell/lib/layouts.test.ts+++ /dev/null@@ -1,42 +0,0 @@-import { beforeEach, describe, expect, it } from "vitest";-import { deleteLayout, listLayouts, restoreLayout, saveLayout } from "./layouts";-import { getCommands } from "./commands";-import { closeAll, openWindow, serialize } from "./store";--describe("saved layouts", () => {- beforeEach(() => {- closeAll();- listLayouts().forEach(deleteLayout);- });-- it("saves, restores, and deletes a named snapshot", () => {- openWindow("files", "Files", { w: 600, h: 400 });- openWindow("docs", "Docs");- const name = saveLayout();- expect(name).toBe("Layout 1");- expect(listLayouts()).toEqual(["Layout 1"]);-- closeAll();- expect(serialize()).toHaveLength(0);-- expect(restoreLayout(name)).toBe(true);- const restored = serialize();- expect(restored.map((w) => w.app).sort()).toEqual(["docs", "files"]);- expect(restored.find((w) => w.app === "files")).toMatchObject({ w: 600, h: 400 });-- deleteLayout(name);- expect(listLayouts()).toEqual([]);- expect(restoreLayout(name)).toBe(false);- });-- it("registers palette commands per layout", () => {- openWindow("files", "Files");- saveLayout("Work");- const ids = getCommands().map((c) => c.id);- expect(ids).toContain("layout:save");- expect(ids).toContain("layout:restore:Work");- expect(ids).toContain("layout:delete:Work");- deleteLayout("Work");- expect(getCommands().map((c) => c.id)).not.toContain("layout:restore:Work");- });-});diff --git a/frontend/slices/appshell/lib/layouts.ts b/frontend/slices/appshell/lib/layouts.tsdeleted file mode 100644index 24cc8f53..00000000--- a/frontend/slices/appshell/lib/layouts.ts+++ /dev/null@@ -1,116 +0,0 @@-"use client";--import { useSyncExternalStore } from "react";-import type { PersistedWindow } from "./types";-import { hydrate, serialize } from "./store";-import { registerCommands } from "./commands";-import { toast } from "./toast";--// Named window layouts — snapshot the current window set (same shape as the-// boot persist) under a name, restore it later from the command palette.-// Persisted to localStorage `sv:layouts`; every saved layout auto-registers-// "Layout: <name>" + delete commands via the dynamic command registry.--const KEY = "sv:layouts";--type LayoutMap = Record<string, PersistedWindow[]>;--function load(): LayoutMap {- if (typeof localStorage === "undefined") return {};- try {- return (JSON.parse(localStorage.getItem(KEY) ?? "{}") as LayoutMap) ?? {};- } catch {- return {};- }-}--let layouts: LayoutMap = load();-let names: string[] = Object.keys(layouts);-const subs = new Set<() => void>();--function commit(next: LayoutMap) {- layouts = next;- names = Object.keys(next);- try {- localStorage.setItem(KEY, JSON.stringify(next));- } catch {- /* ignore quota */- }- subs.forEach((f) => f());- syncLayoutCommands();-}--/** Snapshot the current windows. No name → auto "Layout N". Returns the name. */-export function saveLayout(name?: string): string {- const n = name?.trim() || nextName();- commit({ ...layouts, [n]: serialize() });- toast(`Layout "${n}" saved`);- return n;-}--/** Replace the current window set with a saved layout (apps re-open lazily). */-export function restoreLayout(name: string): boolean {- const snap = layouts[name];- if (!snap) return false;- hydrate(snap);- toast(`Layout "${name}" restored`);- return true;-}--export function deleteLayout(name: string): void {- if (!(name in layouts)) return;- const { [name]: _gone, ...rest } = layouts;- commit(rest);- toast(`Layout "${name}" deleted`);-}--export function listLayouts(): string[] {- return names;-}--export function useLayouts(): string[] {- return useSyncExternalStore(- (cb) => {- subs.add(cb);- return () => {- subs.delete(cb);- };- },- () => names,- () => names,- );-}--function nextName(): string {- let i = 1;- while (`Layout ${i}` in layouts) i++;- return `Layout ${i}`;-}--function syncLayoutCommands() {- registerCommands("layouts", [- {- id: "layout:save",- label: "Save current layout",- hint: "Layout",- keywords: "window arrangement snapshot",- run: () => saveLayout(),- },- ...names.flatMap((n) => [- {- id: `layout:restore:${n}`,- label: `Restore layout: ${n}`,- hint: "Layout",- keywords: "windows arrangement",- run: () => restoreLayout(n),- },- {- id: `layout:delete:${n}`,- label: `Delete layout: ${n}`,- hint: "Layout",- run: () => deleteLayout(n),- },- ]),- ]);-}-syncLayoutCommands();diff --git a/frontend/slices/appshell/lib/profiles.ts b/frontend/slices/appshell/lib/profiles.tsindex 6d698c42..c184544c 100644--- a/frontend/slices/appshell/lib/profiles.ts+++ b/frontend/slices/appshell/lib/profiles.ts@@ -73,19 +73,6 @@ export function listProfiles(): string[] {return names;}-export function useProfiles(): string[] {- return useSyncExternalStore(- (cb) => {- subs.add(cb);- return () => {- subs.delete(cb);- };- },- () => names,- () => names,- );-}-function syncProfileCommands() {registerCommands("profiles", [{diff --git a/frontend/slices/appshell/registry/types.ts b/frontend/slices/appshell/registry/types.tsindex 511eb97d..c870d50a 100644--- a/frontend/slices/appshell/registry/types.ts+++ b/frontend/slices/appshell/registry/types.ts@@ -1,7 +1,6 @@import type { ComponentType, ReactNode } from "react";import type { AppDescriptor } from "../lib/types";import type { ShellCapabilities } from "./capabilities";-import type { ShellId } from "./shells";// Named regions a feature can mount into. The surfaces render <Slot region> at a// fixed spot; which component fills it comes from the registered features. This@@ -28,17 +27,12 @@ export type FeatureDescriptor = {slots?: Partial<Record<SlotRegion, ComponentType>>;/** Optional context provider the feature needs wrapped around the shell. */provider?: ComponentType<{ children: ReactNode }>;- /** System default (search/inspector/notifications/control-center/widgets) vs- * a custom feature added by the host. Documents provenance; default "system". */- kind?: "system" | "custom";};export type Brand = {name: string;/** Glyph/text/element for the menu-bar logo badge. */logo?: ReactNode;- /** Default wallpaper key (overrides the appearance default). */- wallpaper?: string;/** Menu-bar title when no app is focused (macOS shows "Finder"). */idleAppName?: string;};@@ -56,9 +50,6 @@ export type ShellManifest = {routing?: boolean;/** Sync document.title to the focused window ("App — Brand"). Default on. */titleSync?: boolean;- /** Initial shell (macOS/Windows/Dashboard/…). Unset = responsive auto. The- * user's live choice (Settings → Shell) overrides this and persists. */- shell?: ShellId;};/** Identity helper — gives a feature its type + a stable authoring shape. */diff --git a/frontend/slices/appshell/slice.json b/frontend/slices/appshell/slice.jsondeleted file mode 100644index a60a944c..00000000--- a/frontend/slices/appshell/slice.json+++ /dev/null@@ -1,23 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "appshell",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "AppShell — manifest-driven desktop + mobile shell",- "description": "Generic, brand-free OS-style shell framework. One <AppShell manifest> wrapper provider gives a project a macOS-style window manager AND an iOS-style mobile surface, driven entirely by a manifest (brand, apps, features, surface regions, capabilities, persistence, keymap). Features (search, settings, widgets, control-center, inspector, notifications) plug in via extension points. Responsiveness is a single provider + shared primitives. Imports no apps or brand strings — the consumer injects everything.",- "namespace": "@/features/appshell",- "frontend": {- "slicePath": "frontend/slices/appshell"- },- "deps": {- "npm": ["lucide-react", "class-variance-authority", "clsx", "tailwind-merge", "vaul"],- "shadcn": ["button", "tooltip", "scroll-area", "sheet", "drawer", "dialog", "alert-dialog", "dropdown-menu"],- "env": [],- "peers": []- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["shell", "window-manager", "desktop", "mobile", "responsive", "framework", "ui"]-}diff --git a/frontend/slices/assistant/slice.json b/frontend/slices/assistant/slice.jsondeleted file mode 100644index 88ce3fa7..00000000--- a/frontend/slices/assistant/slice.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "assistant",- "version": "0.1.0",- "category": "ai",- "kind": "full",- "title": "Alfa — AI assistant chat",- "description": "OS app: a streaming chat UI for the 'Alfa' assistant. Backed by the /api/assistant SSE route (Anthropic, session-gated, rate-limited). Falls back to a local mock engine when no API key is configured.",- "namespace": "@/features/assistant",- "frontend": {- "slicePath": "frontend/slices/assistant",- "configExport": "assistantApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["button", "textarea", "scroll-area", "separator", "badge", "tooltip"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "ai", "assistant", "chat"]-}diff --git a/frontend/slices/auth/slice.json b/frontend/slices/auth/slice.jsondeleted file mode 100644index 1b06e2bd..00000000--- a/frontend/slices/auth/slice.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "auth",- "version": "0.1.0",- "category": "auth",- "kind": "full",- "title": "Auth — HMAC signed-cookie gate",- "description": "Password sign-in/sign-up screen + AuthGate that gates the OS behind a signed HTTP-only cookie. /api/auth/me verifies the HMAC session and rehydrates the user.",- "namespace": "@/features/auth",- "frontend": {- "slicePath": "frontend/slices/auth",- "configExport": "AuthGate"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["button", "input"],- "env": [- { "name": "SUPER_ADMIN_EMAIL", "scope": "server", "required": false, "description": "Super-admin gate for requireAdmin." }- ],- "peers": []- },- "registers": [],- "audit": ["bp:public-fn-validator", "bp:rbac-coverage"],- "license": "MIT",- "tags": ["auth", "cookie", "login", "session"]-}diff --git a/frontend/slices/camoufox-browser/slice.json b/frontend/slices/camoufox-browser/slice.jsondeleted file mode 100644index cfcbccd5..00000000--- a/frontend/slices/camoufox-browser/slice.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "camoufox-browser",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "Browser — real Firefox over VNC",- "description": "OS app: the browser. A real Camoufox (anti-fingerprinting Firefox) running on a headless X display on the host, shown over noVNC. Replaces the old iframe browser, which could only render the minority of sites that permit framing. The /camoufox-vnc bridge is gated by a verified cockpit session in proxy.ts.",- "namespace": "@/features/camoufox-browser",- "frontend": {- "slicePath": "frontend/slices/camoufox-browser",- "configExport": "camoufoxBrowserApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["button"],- "env": ["CAMOUFOX_NOVNC_URL", "CAMOUFOX_VNC_PASSWD_TEXT"],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "browser", "camoufox", "vnc", "ui"]-}diff --git a/frontend/slices/code-editor/slice.json b/frontend/slices/code-editor/slice.jsondeleted file mode 100644index b31846c5..00000000--- a/frontend/slices/code-editor/slice.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "code-editor",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "Code — overlay syntax editor",- "description": "OS app: a lightweight code editor with a line-number gutter, transparent-textarea-over-highlighted-pre overlay, regex tokenizer for JS/TS/JSON, and best-effort read/write against the OsApi `fs` contract (lib/os-api).",- "namespace": "@/features/code-editor",- "frontend": {- "slicePath": "frontend/slices/code-editor",- "configExport": "codeEditorApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["button", "textarea", "badge", "input", "scroll-area"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "editor", "code", "ui"]-}diff --git a/frontend/slices/create-app/slice.json b/frontend/slices/create-app/slice.jsondeleted file mode 100644index 7d00ed6a..00000000--- a/frontend/slices/create-app/slice.json+++ /dev/null@@ -1,27 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "create-app",- "version": "0.1.0",- "category": "ui",- "kind": "frontend",- "title": "Create App — author an os-rr app from a manifest",- "description": "OS app that authors a new app: pick a name, runtime (html/node/python/shell) that autofills the entry point, a glyph and CSS-gradient accent, with a live glossy icon preview and read-only manifest.json. Persists via api.features.apps.mutations.create so the shell shows it live in the dock.",- "namespace": "@/features/create-app",- "frontend": {- "slicePath": "frontend/slices/create-app",- "configExport": "createAppApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["button", "input", "segmented", "separator", "badge", "scroll-area"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" },- { "slug": "app-store", "range": "^0.1", "reason": "shares glyph keys + icon resolver" }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "apps", "create", "ui"]-}diff --git a/frontend/slices/docs/slice.json b/frontend/slices/docs/slice.jsondeleted file mode 100644index 623faf4c..00000000--- a/frontend/slices/docs/slice.json+++ /dev/null@@ -1,27 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "docs",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "Docs — in-shell documentation index",- "description": "OS app that indexes this instance's documentation: the public /install guide it serves itself, the GitHub repo, the CLI reference, the security model and the deeper architecture docs. Session-aware: a signed-out visitor also gets Sign in / Install your own / GitHub actions, since a signed-out shell is running on mock data and those are the only two useful next steps. Holds the links that used to ship as default quicklinks, so quicklinks can go back to being the owner's own shortcuts.",- "namespace": "@/features/docs",- "registers": ["registry"],- "audit": [],- "frontend": {- "slicePath": "frontend/slices/docs",- "configExport": "docsApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["button"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" },- { "slug": "auth", "range": "^0.1", "reason": "reads session status to show the signed-out actions" }- ]- },- "license": "MIT",- "tags": ["os", "docs", "onboarding", "ui"]-}diff --git a/frontend/slices/files-manager/slice.json b/frontend/slices/files-manager/slice.jsondeleted file mode 100644index fa1f4c48..00000000--- a/frontend/slices/files-manager/slice.json+++ /dev/null@@ -1,53 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "files-manager",- "version": "0.1.0",- "category": "infra",- "kind": "full",- "title": "Files — VPS file manager",- "description": "Finder-style OS app for the VPS filesystem: favorites sidebar, breadcrumb + back/forward history, grid/list view, sort, multi-select, cut/copy/paste, inline rename, new folder, delete, upload, right-click menu, and storage usage. Reads/mutates via the os-api fs contract (mock and live host both writable within OS_FS_WRITE_ROOTS; errors surface inline).",- "namespace": "@/features/files-manager",- "frontend": {- "slicePath": "frontend/slices/files-manager",- "configExport": "filesManagerApp"- },- "deps": {- "npm": [- "lucide-react"- ],- "shadcn": [- "button",- "input",- "scroll-area",- "separator",- "dropdown-menu"- ],- "env": [],- "peers": [- {- "slug": "os-shell",- "range": "^0.1",- "reason": "renders as a window app; openWindow routes file opens to media-viewer/code-editor"- },- {- "slug": "auth",- "range": "^0.1",- "reason": "gated filesystem reads"- }- ]- },- "registers": [- "registry"- ],- "audit": [- "bp:public-fn-validator",- "bp:ui-consistency"- ],- "license": "MIT",- "tags": [- "os",- "files",- "filesystem",- "infra"- ]-}\ No newline at end of filediff --git a/frontend/slices/image-editor/commands/registry.ts b/frontend/slices/image-editor/commands/registry.tsindex 6f045bb7..f27a721a 100644--- a/frontend/slices/image-editor/commands/registry.ts+++ b/frontend/slices/image-editor/commands/registry.ts@@ -10,7 +10,7 @@ import { exportCommands } from "./export.commands";// The single source of truth for every AI-callable editor operation. Add a// command = append to its domain file; it flows into the tools schema + invoke// with no other wiring. Adding a domain = import + spread it here.-export const EDITOR_COMMANDS: EditorCommand[] = [+const EDITOR_COMMANDS: EditorCommand[] = [...documentCommands,...layerCommands,...transformCommands,diff --git a/frontend/slices/image-editor/index.ts b/frontend/slices/image-editor/index.tsindex 60dcc760..f4663b0f 100644--- a/frontend/slices/image-editor/index.ts+++ b/frontend/slices/image-editor/index.ts@@ -7,7 +7,7 @@ export { EditorProvider, useEditor } from "./lib/store";export type { Brush } from "./lib/store";// Model + types.-export { blankDoc, createLayer, ASPECT_PRESETS, FONT_FAMILIES, ADJ_DEFAULT, STYLE_DEFAULT } from "./lib/model";+export { blankDoc, createLayer, ASPECT_PRESETS, FONT_FAMILIES, ADJ_DEFAULT } from "./lib/model";export type {Doc,Layer,@@ -26,7 +26,7 @@ export { BLEND_MODES } from "./lib/types";// Free, in-browser background removal (@imgly) + export helpers.export { removeImageBackground } from "./lib/bg-removal";export type { BgProgress } from "./lib/bg-removal";-export { exportStage, stageToDataURL, downloadDataURL } from "./lib/export";+export { exportStage, stageToDataURL } from "./lib/export";export type { ExportFormat } from "./lib/export";export { imageEditorConfig } from "./config";@@ -34,7 +34,7 @@ export type { ImageEditorConfig } from "./config";// AI function-calling: the command registry + the live-store binding hook. Every// editor operation is exposed as a named, schema'd command an AI can call.-export { EDITOR_COMMANDS, EDITOR_TOOLS, findCommand } from "./commands/registry";+export { EDITOR_TOOLS, findCommand } from "./commands/registry";export { useEditorCommands } from "./commands/use-editor-commands";export type { EditorCommand, AnthropicTool } from "./commands/types";export type { ToolInvocation, ToolOutcome } from "./commands/use-editor-commands";diff --git a/frontend/slices/image-editor/lib/export.ts b/frontend/slices/image-editor/lib/export.tsindex b98870c5..f4ab9590 100644--- a/frontend/slices/image-editor/lib/export.ts+++ b/frontend/slices/image-editor/lib/export.ts@@ -72,7 +72,7 @@ export function stageToDataURL();}-export function downloadDataURL(dataURL: string, filename: string) {+function downloadDataURL(dataURL: string, filename: string) {const a = document.createElement("a");a.href = dataURL;a.download = filename;diff --git a/frontend/slices/image-editor/lib/model.ts b/frontend/slices/image-editor/lib/model.tsindex a6ff923f..8367bbb2 100644--- a/frontend/slices/image-editor/lib/model.ts+++ b/frontend/slices/image-editor/lib/model.ts@@ -19,7 +19,7 @@ export const ADJ_DEFAULT: Adjustments = {sepia: false,};-export const STYLE_DEFAULT: LayerStyle = {+const STYLE_DEFAULT: LayerStyle = {blend: "normal",shadow: { enabled: false, color: "#000000", opacity: 0.5, angle: 90, distance: 8, size: 10 },glow: { enabled: false, color: "#ffd54a", opacity: 0.75, size: 18 },diff --git a/frontend/slices/image-editor/slice.json b/frontend/slices/image-editor/slice.jsondeleted file mode 100644index 3b72cedd..00000000--- a/frontend/slices/image-editor/slice.json+++ /dev/null@@ -1,24 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "image-editor",- "version": "0.2.0",- "category": "ui",- "kind": "frontend",- "title": "Image Editor — layered raster editor",- "description": "Embeddable, layer-based raster image editor (Konva): layers with blend modes + layer styles (shadow/glow/stroke), transforms, crop/resize/aspect presets, paint brushes, adjustments, text layers with fonts, free in-browser background removal (@imgly), PNG/JPEG/WebP export, an AI function-calling command registry (every operation is a schema'd command) with in-editor chat, and a headless server barrel (server.ts) to run commands against documents without a DOM.",- "namespace": "@/features/image-editor",- "frontend": {- "slicePath": "frontend/slices/image-editor",- "configExport": "imageEditorConfig"- },- "deps": {- "npm": ["lucide-react", "konva", "react-konva", "@imgly/background-removal", "class-variance-authority", "radix-ui"],- "shadcn": ["button", "input", "label", "separator", "select", "scroll-area", "switch", "dropdown-menu", "tooltip", "resizable", "popover"],- "env": [],- "peers": []- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["image", "raster", "layers", "konva", "editor", "ai", "ui"]-}diff --git a/frontend/slices/image-picker/slice.json b/frontend/slices/image-picker/slice.jsondeleted file mode 100644index acd6e9dd..00000000--- a/frontend/slices/image-picker/slice.json+++ /dev/null@@ -1,22 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "image-picker",- "version": "0.1.0",- "category": "ui",- "kind": "ui",- "title": "Image Picker — one-button image/wallpaper chooser (gallery · upload · link · Unsplash · reposition)",- "description": "Generic image/wallpaper picker. The headline API is ONE button (ImagePickerButton) that opens a dialog with 4 tabs: Gallery (12 colours + 8 gradients + Notion textures), Upload (drag/click, ≤8MB), Link (paste any https image URL), Unsplash (bundled curated landscapes + live search). On pick, onChange fires with an ImageValue ({ type, value, positionY?, metadata? }). ImageBanner is the optional reposition-able band (page cover / profile header / card hero) with hover Change / Reposition (drag the vertical focal point) / Remove. Not coupled to Notion — drop it anywhere you let a user set an image. The slice imports NO other slice and NO backend — the upload backend and Unsplash search are INJECTED as props (onUpload + searchUnsplash): wire onUpload to the `files` slice and searchUnsplash to a server route via unsplashSearchVia('/api/unsplash') that holds UNSPLASH_ACCESS_KEY server-side (never NEXT_PUBLIC). Ships a curated Unsplash + gallery fallback so it works with zero config. parseImage normalizes legacy raw-string values; imageStyle builds the focal-point CSS.",- "namespace": "@/features/image-picker",- "registers": [],- "audit": [],- "frontend": {- "slicePath": "frontend/slices/image-picker",- "configExport": ""- },- "deps": {- "npm": [],- "shadcn": ["dialog", "button", "input"],- "env": ["UNSPLASH_ACCESS_KEY"],- "peers": []- }-}diff --git a/frontend/slices/managed-apps/feature-app.tsx b/frontend/slices/managed-apps/feature-app.tsxindex 7f0118f4..b7f32f85 100644--- a/frontend/slices/managed-apps/feature-app.tsx+++ b/frontend/slices/managed-apps/feature-app.tsx@@ -1,7 +1,7 @@"use client";import { ExternalLink, RefreshCw, TerminalSquare } from "lucide-react";-import { useCallback, useState } from "react";+import { Suspense, useCallback, useState } from "react";import type { AppProps } from "@/features/appshell";import { Terminal } from "@/features/os-terminal";import type { ManagedAppFeature } from "@/lib/managed-apps/types";@@ -40,7 +40,11 @@ export function ManagedFeatureApp({ feature }: AppProps & { feature: ManagedAppFto "cli" whenever `source` is null and the toggle that could change it onlyrenders when `source` is not. */}{view === "cli" || !source ? (- <div className="min-h-0 flex-1"><Terminal initialCommand={command} /></div>+ <div className="min-h-0 flex-1">+ <Suspense fallback={null}>+ <Terminal initialCommand={command} />+ </Suspense>+ </div>) : (<iframekey={generation}diff --git a/frontend/slices/media-studio/slice.json b/frontend/slices/media-studio/slice.jsondeleted file mode 100644index a88b3bbf..00000000--- a/frontend/slices/media-studio/slice.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "media-studio",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "Media Studio — photo / image editor",- "description": "OS app: a lightweight photo/social studio. Tool rail, a checkerboard canvas stage with live CSS `filter` adjustments and per-layer clip masks, safe-area guides (TikTok/Reels/IG/YouTube), text/shape/sticker/image(URL)/HTML-embed layers, per-layer custom CSS, debounced undo+redo, and JSON/HTML export + import. Client-only, no backend.",- "namespace": "@/features/media-studio",- "frontend": {- "slicePath": "frontend/slices/media-studio",- "configExport": "mediaStudioApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["button", "scroll-area", "separator", "slider", "switch", "segmented", "badge", "tooltip", "input", "textarea"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "media", "image", "editor", "ui"]-}diff --git a/frontend/slices/media-viewer/slice.json b/frontend/slices/media-viewer/slice.jsondeleted file mode 100644index 8420aeec..00000000--- a/frontend/slices/media-viewer/slice.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "media-viewer",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "Preview — media quick-look",- "description": "OS quick-look viewer. Zoomable images with dimensions + checkerboard transparency, an audio player with CSS-bar waveform/transport, a video player with play/pause + scrubber + volume, and PDF/text surfaces. Type-indicator chip, Download, and Open-in-editor handoff (image→media-studio, video/audio→reel-editor; remote files→code-editor). Opened from the launcher; switch samples with prev/next. Fully offline — no external network.",- "namespace": "@/features/media-viewer",- "frontend": {- "slicePath": "frontend/slices/media-viewer",- "configExport": "mediaViewerApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["button", "scroll-area", "separator", "badge", "tooltip", "slider"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "preview", "viewer", "ui"]-}diff --git a/frontend/slices/os-settings/slice.json b/frontend/slices/os-settings/slice.jsondeleted file mode 100644index 19078ef4..00000000--- a/frontend/slices/os-settings/slice.json+++ /dev/null@@ -1,27 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "os-settings",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "Settings — appearance + VPS server",- "description": "OS Tweaks app: theme/style/accent/wallpaper appearance controls, display device override, and VPS server (mock|live) connection settings. UI-only slice backed by the local appearance store; no Convex feature.",- "namespace": "@/features/os-settings",- "frontend": {- "slicePath": "frontend/slices/os-settings",- "configExport": "osSettingsApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["scroll-area", "separator", "switch", "input"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" },- { "slug": "shell-settings", "range": "^0.1", "reason": "composes the portable appearance panel" }- ]- },- "registers": ["registry"],- "audit": ["bp:public-fn-validator", "bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "settings", "appearance", "ui"]-}diff --git a/frontend/slices/os-shell/slice.json b/frontend/slices/os-shell/slice.jsondeleted file mode 100644index 7ffe6974..00000000--- a/frontend/slices/os-shell/slice.json+++ /dev/null@@ -1,30 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "os-shell",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "os-shell — Manef Shell OS consumer of the AppShell framework",- "description": "The mso (Manef Shell OS) consumer slice: shell.manifest.ts declares the brand + built-in app set + shell features, and the barrel re-exports the generic `appshell` framework so app slices import a stable `@/features/os-shell`. No backend — window layout persists to localStorage.",- "namespace": "@/features/os-shell",- "frontend": {- "slicePath": "frontend/slices/os-shell",- "configExport": "default"- },- "deps": {- "npm": ["lucide-react", "class-variance-authority", "clsx", "tailwind-merge"],- "shadcn": ["button", "tooltip", "scroll-area"],- "env": [],- "peers": [- {- "slug": "appshell",- "range": "^0.1",- "reason": "the generic shell framework this slice configures + re-exports"- }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "shell", "consumer", "manifest", "ui"]-}diff --git a/frontend/slices/os-terminal/index.ts b/frontend/slices/os-terminal/index.tsindex 911e1880..7a8efca5 100644--- a/frontend/slices/os-terminal/index.ts+++ b/frontend/slices/os-terminal/index.ts@@ -1,6 +1,20 @@+import { lazy } from "react";import { SquareTerminal, Bot } from "lucide-react";import type { AppDescriptor } from "@/features/os-shell";-export { Terminal } from "./app";++// LAZY, not a plain re-export. shell.manifest.ts imports this barrel eagerly to read+// the two AppDescriptors below, so `export { Terminal } from "./app"` pulled ./app —+// and with it xterm plus its ~3.9 KB stylesheet — into the shell's entry chunk, even+// though `load:` already code-splits the very same module. Every other app barrel+// exports the descriptor only. The single consumer wraps this in <Suspense>.+//+// This is NOT the window-content.tsx case CLAUDE.md warns about: that one must avoid+// Suspense because window opens come from a synchronous external store whose retry+// ping a suspending boundary misses. Here the boundary sits in an ordinary render+// path inside an already-open window.+export const Terminal = lazy(() =>+ import("./app").then((m) => ({ default: m.Terminal })),+);export const osTerminalApp: AppDescriptor = {id: "os-terminal",diff --git a/frontend/slices/os-terminal/slice.json b/frontend/slices/os-terminal/slice.jsondeleted file mode 100644index 991cbce0..00000000--- a/frontend/slices/os-terminal/slice.json+++ /dev/null@@ -1,29 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "os-terminal",- "version": "0.1.0",- "category": "infra",- "kind": "full",- "title": "Terminal — xterm.js pty app",- "description": "OS terminal app built on xterm.js. Phase 0 runs an offline mock shell; Phase 2 proxies ptys to the Control Room agent (allowlist-gated, server-only WS). Adds no new host surface.",- "namespace": "@/features/os-terminal",- "frontend": {- "slicePath": "frontend/slices/os-terminal",- "configExport": "osTerminalApp"- },- "deps": {- "npm": ["@xterm/xterm", "@xterm/addon-fit", "lucide-react"],- "shadcn": [],- "env": [- { "name": "OS_AGENT_URL", "scope": "server", "required": false, "description": "Control Room agent base URL (Phase 2 pty bridge)." },- { "name": "OS_AGENT_SECRET", "scope": "server", "required": false, "description": "Bearer for the agent bridge. NEVER NEXT_PUBLIC_." }- ],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "terminal", "xterm", "infra", "ssh"]-}diff --git a/frontend/slices/quicklinks/slice.json b/frontend/slices/quicklinks/slice.jsondeleted file mode 100644index 321f495a..00000000--- a/frontend/slices/quicklinks/slice.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "quicklinks",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "Quicklinks — website shortcuts with favicons",- "description": "OS app + shell integration for user-curated website shortcuts. Each quicklink is a URL + label; the favicon is derived from the URL. Managed in Settings → Quicklink and surfaced (with favicon) in the dock, Launchpad, mobile app grid, the Today widget and a dedicated Quicklinks window. Opening one pops a new native browser tab. Data persists to localStorage (public config only). The shell consumes the list via the injected useQuickLinks capability so appshell stays brand/host-free.",- "namespace": "@/features/quicklinks",- "registers": ["registry"],- "audit": [],- "frontend": {- "slicePath": "frontend/slices/quicklinks",- "configExport": "quicklinksApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": [],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app + injects useQuickLinks" }- ]- },- "license": "MIT",- "tags": ["os", "shortcuts", "links", "ui"]-}diff --git a/frontend/slices/reel-editor/slice.json b/frontend/slices/reel-editor/slice.jsondeleted file mode 100644index 09a89b20..00000000--- a/frontend/slices/reel-editor/slice.json+++ /dev/null@@ -1,26 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "reel-editor",- "version": "0.3.0",- "category": "ui",- "kind": "frontend",- "title": "Reel — video timeline editor",- "description": "In-browser video editor: real media clips (image/video/audio) on a layered multi-track timeline (top row renders frontmost), unified Canvas-2D draw path shared by the live preview and the realtime WebM exporter (with real mixed audio), per-clip trim/speed/reverse, volume/fades/auto-duck, dissolve/wipe/slide transitions, keyframes with easing + animation presets, text styling, color grading, filmstrip thumbnails + waveforms, config-driven resizable workspace layouts, a project-files quick-import pane, draft auto-save, and an editor settings dialog.",- "namespace": "@/features/reel-editor",- "frontend": {- "slicePath": "frontend/slices/reel-editor",- "configExport": "reelEditorApp"- },- "deps": {- "npm": ["lucide-react", "react-resizable-panels"],- "shadcn": ["button", "input", "slider", "segmented", "tooltip", "dialog", "dropdown-menu", "resizable"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "host seam (lib/host.ts): toasts, inspector, activity, fs api, responsive hook" }- ]- },- "registers": ["registry"],- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "video", "timeline", "editor", "nle", "ui"]-}diff --git a/frontend/slices/shell-settings/slice.json b/frontend/slices/shell-settings/slice.jsondeleted file mode 100644index 7888f111..00000000--- a/frontend/slices/shell-settings/slice.json+++ /dev/null@@ -1,15 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "shell-settings",- "version": "0.1.0",- "category": "ui",- "kind": "full",- "title": "Shell feature — Settings (appearance panels)",- "description": "Portable, brand-free shell settings UI: appearance + display panels plus generic Section/Row building blocks. The consumer composes them and injects an AppearanceAdapter built from its own appearance store, so this slice holds no project-specific options.",- "namespace": "@/features/shell-settings",- "frontend": { "slicePath": "frontend/slices/shell-settings", "configExport": "default" },- "deps": { "npm": ["lucide-react"], "shadcn": ["separator", "switch"], "env": [], "peers": [{ "slug": "appshell", "range": "^0.1", "reason": "sibling shell feature; shares the shell capability model" }] },- "audit": ["bp:ui-consistency"],- "license": "MIT",- "tags": ["shell", "feature", "settings", "appearance"]-}diff --git a/frontend/slices/system-monitor/slice.json b/frontend/slices/system-monitor/slice.jsondeleted file mode 100644index 78438461..00000000--- a/frontend/slices/system-monitor/slice.json+++ /dev/null@@ -1,27 +0,0 @@-{- "$schema": "https://resource.rahmanef.com/slice-schema.json",- "slug": "system-monitor",- "version": "0.1.0",- "category": "infra",- "kind": "full",- "title": "System Monitor — CPU / RAM / disk",- "description": "OS app showing live host telemetry (CPU load, memory, disk, processes) as theme-token meters. Reads the OsApi `sys` contract (lib/os-api) — mock adapter in-browser, HTTP adapter against the Control Room agent.",- "namespace": "@/features/system-monitor",- "frontend": {- "slicePath": "frontend/slices/system-monitor",- "configExport": "systemMonitorApp"- },- "deps": {- "npm": ["lucide-react"],- "shadcn": ["scroll-area"],- "env": [],- "peers": [- { "slug": "os-shell", "range": "^0.1", "reason": "renders as a window app" },- { "slug": "auth", "range": "^0.1", "reason": "gated telemetry reads" }- ]- },- "registers": ["registry"],- "audit": ["bp:public-fn-validator", "bp:ui-consistency"],- "license": "MIT",- "tags": ["os", "telemetry", "monitoring", "infra"]-}diff --git a/lib/models/index.js b/lib/models/index.jsindex d4388535..6722a165 100644--- a/lib/models/index.js+++ b/lib/models/index.js@@ -1,4 +1,4 @@export { getCatalog, listModels } from './catalog.js'export { PROVIDERS, hostOf } from './registry.js'-export { envCredentialStore, memoryCredentialStore, fileCredentialStore } from './store.js'+export { envCredentialStore } from './store.js'export { parseRef, resolveModel } from './resolve.js'diff --git a/lib/models/store.js b/lib/models/store.jsindex e013342f..0b6af87e 100644--- a/lib/models/store.js+++ b/lib/models/store.js@@ -8,9 +8,6 @@// @property {(tenantId:string|undefined, provider:string)=>Promise<void>} [deleteKey]// @property {(tenantId:string|undefined)=>Promise<string[]>} [listProviders]-import { readFile, writeFile, mkdir, chmod, rename } from 'node:fs/promises'-import { homedir } from 'node:os'-import { join, dirname } from 'node:path'import { PROVIDERS } from './registry.js'/**@@ -30,51 +27,3 @@ export function envCredentialStore() {async setKey() { throw new Error('envCredentialStore is read-only') },}}--/**- * In-memory multi-tenant store — tests / ephemeral use. Map<tenant, Map<provider, key>>.- * @returns {CredentialStore}- */-export function memoryCredentialStore() {- const t = new Map()- const k = (id) => id ?? ''- return {- async getKey(id, p) { return t.get(k(id))?.get(p) ?? null },- async setKey(id, p, key) {- let m = t.get(k(id))- if (!m) { m = new Map(); t.set(k(id), m) }- m.set(p, key)- },- async deleteKey(id, p) { t.get(k(id))?.delete(p) },- async listProviders(id) { return [...(t.get(k(id))?.keys() ?? [])] },- }-}--const DEFAULT_CREDS_FILE = join(process.env.MODELS_CREDS_DIR || join(homedir(), '.models-rahmanef'), 'creds.json')--/**- * Persistent multi-tenant store — a local JSON file `{ tenant: { provider: key } }`, mode 0600.- * Lets the CLI / a local server work with no external DB (like hermes' ~/.hermes/auth.json).- * ponytail: whole-file read-modify-write with an atomic tmp+rename — safe for a CLI / single- * writer (no truncated file on crash); add file locking if you get concurrent writers- * (last-writer-wins today).- * @param {string} [filePath]- * @returns {CredentialStore}- */-export function fileCredentialStore(filePath = DEFAULT_CREDS_FILE) {- const k = (id) => id ?? ''- const load = async () => { try { return JSON.parse(await readFile(filePath, 'utf8')) } catch { return {} } }- const save = async (data) => {- await mkdir(dirname(filePath), { recursive: true })- const tmp = filePath + '.tmp'- await writeFile(tmp, JSON.stringify(data, null, 2), { mode: 0o600 })- await chmod(tmp, 0o600).catch(() => {}) // enforce perms even if the tmp pre-existed- await rename(tmp, filePath) // atomic swap on same fs — never leaves a truncated creds file- }- return {- async getKey(id, p) { return (await load())[k(id)]?.[p] ?? null },- async setKey(id, p, key) { const d = await load(); (d[k(id)] ||= {})[p] = key; await save(d) },- async deleteKey(id, p) { const d = await load(); if (d[k(id)]) { delete d[k(id)][p]; await save(d) } },- async listProviders(id) { return Object.keys((await load())[k(id)] || {}) },- }-}diff --git a/package.json b/package.jsonindex dd4edb2c..d9bdd538 100644--- a/package.json+++ b/package.json@@ -13,7 +13,7 @@"typecheck": "tsc --noEmit","test": "vitest run","coverage": "vitest run --coverage",- "check": "node scripts/check-cycles.mjs && node scripts/check-slices.mjs && node scripts/check-contrast.mjs",+ "check": "node scripts/check-cycles.mjs && node scripts/check-contrast.mjs","verify": "bun run typecheck && bun run lint && bun run test && bun run check","smoke": "E2E_BASE_URL=http://localhost:4005 vitest run scripts/e2e/smoke.test.ts"},diff --git a/scripts/check-slices.mjs b/scripts/check-slices.mjsdeleted file mode 100644index 322a039e..00000000--- a/scripts/check-slices.mjs+++ /dev/null@@ -1,67 +0,0 @@-#!/usr/bin/env node-// Validate every frontend/slices/*/slice.json against the project's minimal-// contract: `slug` (kebab-case), `version` (semver), and (when present) a-// well-typed `auth` field. Adapted to the on-disk schema (no top-level `id` —-// the kitab uses `slug`; auth/deps live under sub-objects).-//-// Exits 1 on any violation so CI can wire it later.--import { readdirSync, readFileSync, statSync } from "node:fs";-import { join, resolve as pathResolve } from "node:path";-import { fileURLToPath } from "node:url";--const ROOT = pathResolve(fileURLToPath(import.meta.url), "../..");-const SLICES = join(ROOT, "frontend", "slices");-const KEBAB = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;-const SEMVER = /^\d+\.\d+\.\d+(-[\w.]+)?(\+[\w.]+)?$/;-const ALLOWED_AUTH = new Set(["cookie", "none"]);--function entries(dir) {- try { return readdirSync(dir, { withFileTypes: true }); } catch { return []; }-}--const violations = [];-let checked = 0;-for (const e of entries(SLICES)) {- if (!e.isDirectory()) continue;- const slicePath = join(SLICES, e.name, "slice.json");- if (!statSync(slicePath, { throwIfNoEntry: false })?.isFile()) continue;- checked++;- let json;- try { json = JSON.parse(readFileSync(slicePath, "utf8")); }- catch (err) { violations.push(`${e.name}: invalid JSON — ${err.message}`); continue; }-- // slug — required, kebab-case- if (typeof json.slug !== "string" || !KEBAB.test(json.slug)) {- violations.push(`${e.name}: missing or non-kebab \`slug\` (got ${JSON.stringify(json.slug)})`);- }-- // version — required, semver- if (typeof json.version !== "string" || !SEMVER.test(json.version)) {- violations.push(`${e.name}: missing or non-semver \`version\` (got ${JSON.stringify(json.version)})`);- }-- // auth — optional. If present, must be string + one of allowed values.- if (json.auth !== undefined) {- if (typeof json.auth !== "string" || !ALLOWED_AUTH.has(json.auth)) {- violations.push(`${e.name}: \`auth\` must be one of ${[...ALLOWED_AUTH].join("|")} (got ${JSON.stringify(json.auth)})`);- }- }-- // dependencies — optional. If present at top-level, must be array of strings.- // (Real schema nests under `deps.npm` etc.; we only assert when consumers put- // a flat `dependencies` key per the agent task contract.)- if (json.dependencies !== undefined) {- if (!Array.isArray(json.dependencies) || !json.dependencies.every((d) => typeof d === "string")) {- violations.push(`${e.name}: \`dependencies\` must be an array of strings`);- }- }-}--if (violations.length === 0) {- console.log("check-slices: clean (" + checked + " slice.json validated)");- process.exit(0);-}-console.log("check-slices: " + violations.length + " violation(s)");-for (const v of violations) console.log(" - " + v);-process.exit(1);