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

route remaining catalog type maps through the shared registry

[._.]/ Adam Eivy072b906d1d79
diff --git a/client/src/components/CatalogCastPanel.jsx b/client/src/components/CatalogCastPanel.jsx
index 959a326dff..3a1c20a6fe 100644
--- a/client/src/components/CatalogCastPanel.jsx
+++ b/client/src/components/CatalogCastPanel.jsx
@@ -22,15 +22,7 @@ import {
linkCatalogIngredient,
unlinkCatalogIngredient,
} from '../services/apiCatalog';
-
-const TYPE_BADGE = {
- character: 'bg-blue-500/20 text-blue-300 border-blue-500/40',
- place: 'bg-emerald-500/20 text-emerald-300 border-emerald-500/40',
- object: 'bg-amber-500/20 text-amber-300 border-amber-500/40',
- idea: 'bg-purple-500/20 text-purple-300 border-purple-500/40',
- scene: 'bg-pink-500/20 text-pink-300 border-pink-500/40',
- concept: 'bg-cyan-500/20 text-cyan-300 border-cyan-500/40',
-};
+import { CATALOG_BADGE_BY_ID } from '../lib/catalogTypes';
const ROLE_BY_TYPE = {
character: 'cast-character',
@@ -139,7 +131,7 @@ export default function CatalogCastPanel({ refKind, refId, refLabel }) {
<ul className="space-y-2">
{rows.map((row) => {
const { ingredient, role } = row;
- const badge = TYPE_BADGE[ingredient.type] || 'bg-gray-500/20 text-gray-300 border-gray-500/40';
+ const badge = CATALOG_BADGE_BY_ID[ingredient.type] || 'bg-gray-500/20 text-gray-300 border-gray-500/40';
const text = snippet(ingredient.payload);
return (
<li
diff --git a/client/src/components/QuickIdeaCapture.jsx b/client/src/components/QuickIdeaCapture.jsx
index 482dad7ad3..0e573f67b5 100644
--- a/client/src/components/QuickIdeaCapture.jsx
+++ b/client/src/components/QuickIdeaCapture.jsx
@@ -7,11 +7,8 @@
* scrap+extract LLM round-trip on /catalog/ingest. One click on a type chip,
* one name, one textarea, one submit → POST /api/catalog/ingredients.
*
- * TODO: switch the local TYPES + PRIMARY_CONTENT_KEY + PRIMARY_CONTENT_LABEL
- * tables to the shared registry once `[catalog-shared-type-registry]` lands
- * (PLAN.md "Creative Catalog — extensibility roadmap"). Today these mirror
- * the same tables in `client/src/pages/Catalog.jsx` — adding a 7th type
- * means touching both.
+ * Types, type-chip colors, and the per-type primary content key/label all
+ * come from the shared registry (`client/src/lib/catalogTypes.js`).
*/
import { useState, useRef, useMemo } from 'react';
@@ -19,30 +16,9 @@ import { Link } from 'react-router-dom';
import { Send } from 'lucide-react';
import toast from './ui/Toast';
import { createCatalogIngredient } from '../services/apiCatalog';
+import { CATALOG_TYPES, getCatalogType } from '../lib/catalogTypes';
-const TYPES = [
- { id: 'character', label: 'Character', color: 'bg-blue-500/20 text-blue-300 border-blue-500/40' },
- { id: 'place', label: 'Place', color: 'bg-emerald-500/20 text-emerald-300 border-emerald-500/40' },
- { id: 'object', label: 'Object', color: 'bg-amber-500/20 text-amber-300 border-amber-500/40' },
- { id: 'idea', label: 'Idea', color: 'bg-purple-500/20 text-purple-300 border-purple-500/40' },
- { id: 'scene', label: 'Scene', color: 'bg-pink-500/20 text-pink-300 border-pink-500/40' },
- { id: 'concept', label: 'Concept', color: 'bg-cyan-500/20 text-cyan-300 border-cyan-500/40' },
-];
-
-const PRIMARY_CONTENT_KEY = {
- character: 'physicalDescription',
- place: 'description',
- object: 'description',
- idea: 'summary',
- scene: 'summary',
- concept: 'summary',
-};
-
-const PRIMARY_CONTENT_LABEL = {
- physicalDescription: 'Physical Description',
- description: 'Description',
- summary: 'Summary',
-};
+const TYPES = CATALOG_TYPES;
// Splits a comma-or-space-separated tag string into a clean array. Per-tag
// length is capped at TAG_MAX_CHARS (mirrors the server's BIBLE_LIMITS.TAG_MAX
@@ -68,9 +44,9 @@ export default function QuickIdeaCapture() {
const [isSubmitting, setIsSubmitting] = useState(false);
const submittingRef = useRef(false);
- const contentKey = PRIMARY_CONTENT_KEY[type] || 'description';
- const contentLabel = PRIMARY_CONTENT_LABEL[contentKey] || 'Description';
- const typeMeta = useMemo(() => TYPES.find((t) => t.id === type) || TYPES[0], [type]);
+ const typeMeta = useMemo(() => getCatalogType(type) || TYPES[0], [type]);
+ const contentKey = typeMeta.primaryContentKey || 'description';
+ const contentLabel = typeMeta.primaryContentLabel || 'Description';
const handleSubmit = async (e) => {
e?.preventDefault();
@@ -135,7 +111,7 @@ export default function QuickIdeaCapture() {
aria-checked={active}
onClick={() => setType(t.id)}
className={`px-2 py-1 rounded-full text-xs border transition-colors ${
- active ? t.color : 'border-port-border text-gray-400 hover:text-white'
+ active ? t.badgeColor : 'border-port-border text-gray-400 hover:text-white'
}`}
>
{t.label}
diff --git a/server/lib/catalogBulkParsers.js b/server/lib/catalogBulkParsers.js
index a600129070..985a6cf43b 100644
--- a/server/lib/catalogBulkParsers.js
+++ b/server/lib/catalogBulkParsers.js
@@ -9,36 +9,23 @@
* failure (not on per-row content errors) — those bubble up as the
* `BULK_IMPORT_PARSE_FAILED` error.
*
- * `PRIMARY_CONTENT_KEY_BY_TYPE` mirrors the client-side map in
- * `client/src/pages/Catalog.jsx`. When a markdown body or CSV `description`
- * column is supplied without an explicit field name, it lands in the
- * type-appropriate payload key.
+ * `INGREDIENT_TYPES` + `PRIMARY_CONTENT_KEY_BY_TYPE` derive from the shared
+ * type registry (`catalogTypes.js`, a pure no-side-effect module) so a new
+ * type flows through bulk import/export automatically. A bulk-import row's
+ * body paragraph / CSV `description` column lands in each type's
+ * `primaryContentKey`.
*
* Also exports a minimal `toYamlString()` serializer used by the export
* route — handwritten so we don't pull js-yaml just for the catalog bundle.
*/
-export const INGREDIENT_TYPES = Object.freeze([
- 'character',
- 'place',
- 'object',
- 'idea',
- 'scene',
- 'concept',
-]);
+import { CATALOG_TYPES, INGREDIENT_TYPE_IDS } from './catalogTypes.js';
-// Mirrors PRIMARY_CONTENT_KEY in client/src/pages/Catalog.jsx and
-// CatalogIngest.jsx. When a bulk-import row supplies a body paragraph or a
-// CSV `description` column, it lands here so the entry renders correctly in
-// the catalog UI without forcing the user to hand-wire payload keys.
-export const PRIMARY_CONTENT_KEY_BY_TYPE = Object.freeze({
- character: 'physicalDescription',
- place: 'description',
- object: 'description',
- idea: 'summary',
- scene: 'summary',
- concept: 'summary',
-});
+export const INGREDIENT_TYPES = INGREDIENT_TYPE_IDS;
+
+export const PRIMARY_CONTENT_KEY_BY_TYPE = Object.freeze(
+ Object.fromEntries(CATALOG_TYPES.map((t) => [t.id, t.primaryContentKey])),
+);
const TYPE_LOWER = new Set(INGREDIENT_TYPES);