import { createTopologySceneConfig, TOPOLOGY_CAMERA_BASE, TOPOLOGY_MINIMAP_BASE, TOPOLOGY_SCENE_BASE, TOPOLOGY_SIGNAL_BASE, type TopologyCameraConfig, type TopologyMiniMapConfig, type TopologyPageConfig, type TopologySceneConfig, type TopologySignalConfig, } from "../topology/sceneConfig.ts"; export interface TopologyScenePresetOptions extends Omit { viewportFit?: boolean; connectorRouting?: TopologySceneConfig["connectorRouting"]; } export interface TopologyPagePresetOptions { scene?: TopologyScenePresetOptions; camera?: Partial; signal?: Partial; minimap?: Partial; } export interface TopologyPresetCatalogEntry { id: string; label: string; summary: string; role: | "intro" | "main" | "timeline" | "dossier" | "incident" | "architecture" | "knowledge" | "infrastructure" | "delivery"; transition?: { entersFrom?: string; handoffTo?: string; reversible?: boolean; }; } export function createTopologyScenePreset( options: TopologyScenePresetOptions, ): TopologySceneConfig { return createTopologySceneConfig({ ...TOPOLOGY_SCENE_BASE, ...options, }); } export function createTopologyPagePreset( options: TopologyPagePresetOptions, ): TopologyPageConfig { return { scene: createTopologyScenePreset(options.scene ?? TOPOLOGY_SCENE_BASE), camera: { ...TOPOLOGY_CAMERA_BASE, ...options.camera, }, signal: { ...TOPOLOGY_SIGNAL_BASE, ...options.signal, }, minimap: { ...TOPOLOGY_MINIMAP_BASE, ...options.minimap, }, }; } export const TOPOLOGY_SCENE_PRESETS = { homepageOpening: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "ring", columns: 42, rows: 30, originQ: -20, originR: -15, showGridNodes: false, gridActivity: true, ambientSignals: false, }), underConstruction: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "viewport-fit", topologyLayout: "ring", showGridNodes: false, gridActivity: true, ambientSignals: false, }), intro: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "viewport-fit", topologyLayout: "ring", showGridNodes: false, gridActivity: true, ambientSignals: false, }), operationalDashboard: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "fan", connectorRouting: "straight", columns: 32, rows: 32, originQ: -16, originR: -16, showGridNodes: false, gridActivity: true, ambientSignals: false, }), organizationDossier: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "radial-sectors", radius: 40, columns: 32, rows: 24, originQ: -16, originR: -12, showGridNodes: false, gridActivity: true, ambientSignals: false, }), personalKnowledge: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "orbital-clusters", radius: 38, columns: 30, rows: 22, originQ: -15, originR: -11, showGridNodes: false, gridActivity: true, ambientSignals: false, }), systemArchitecture: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "cascade-tree", radius: 38, columns: 30, rows: 22, originQ: -15, originR: -11, showGridNodes: false, gridActivity: true, ambientSignals: false, }), mainSite: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", columns: 42, rows: 30, originQ: -20, originR: -15, showGridNodes: false, gridActivity: true, ambientSignals: false, }), timeline: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "linear", radius: 38, columns: 32, rows: 32, originQ: -16, originR: -16, showGridNodes: false, gridActivity: true, ambientSignals: false, }), experienceMap: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "fishspine", radius: 40, columns: 38, rows: 24, originQ: -18, originR: -12, showGridNodes: false, gridActivity: true, ambientSignals: false, }), dependencyMap: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "fan", connectorRouting: "straight", radius: 36, columns: 30, rows: 18, originQ: -14, originR: -9, showGridNodes: false, gridActivity: true, ambientSignals: false, }), matrixLayout: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "matrix", connectorRouting: "obstacle-aware", radius: 36, columns: 30, rows: 18, originQ: -14, originR: -9, showGridNodes: false, gridActivity: true, ambientSignals: false, }), truthTable: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "world-grid", topologyLayout: "matrix", connectorRouting: "obstacle-aware", radius: 36, columns: 48, rows: 40, originQ: -24, originR: -20, showGridNodes: false, gridActivity: true, ambientSignals: false, }), dossier: createTopologyScenePreset({ ...TOPOLOGY_SCENE_BASE, layout: "viewport-fit", topologyLayout: "custom", radius: 34, columns: 24, rows: 16, originQ: -10, originR: -7, showGridNodes: false, gridActivity: true, ambientSignals: false, }), } as const; export const TOPOLOGY_PRESET_CATALOG = [ { id: "homepageOpening", label: "Homepage Opening", summary: "Intro scene, full-grid reveal, logo animation, and handoff into the main site.", role: "intro", transition: { handoffTo: "mainSite", reversible: false, }, }, { id: "underConstruction", label: "Under Construction", summary: "Full-screen topology scene with the GH logo entrance animation and a centered construction state.", role: "intro", transition: { handoffTo: "homepageOpening", reversible: true, }, }, { id: "operationalDashboard", label: "Operational Dashboard", summary: "Persistent operations shell for service topology and operator context.", role: "main", transition: { entersFrom: "homepageOpening", reversible: true, }, }, { id: "organization", label: "Organization", summary: "World-grid organization dossier with services, people, and stats clusters.", role: "dossier", transition: { reversible: true, }, }, { id: "personalKnowledge", label: "Personal Knowledge", summary: "First-person dossier for identity, work, current focus, writing, and links.", role: "knowledge", transition: { reversible: true, }, }, { id: "systemArchitecture", label: "System Architecture", summary: "Layered architecture shell for edge, delivery, application, data, infrastructure, and external systems.", role: "architecture", transition: { reversible: true, }, }, { id: "timeline", label: "Timeline", summary: "Horizontal chronology-first shell for experience, history, and progression pages.", role: "timeline", transition: { reversible: true, }, }, { id: "experienceMap", label: "Experience Map", summary: "Horizontal experience and history composition for profile-style pages.", role: "dossier", transition: { reversible: true, }, }, { id: "dependencyMap", label: "Dependency Map", summary: "System relationships and dependency-heavy operational layouts.", role: "architecture", transition: { reversible: true, }, }, { id: "matrixLayout", label: "Matrix Layout", summary: "Comparative and classification-driven matrix layouts.", role: "knowledge", transition: { reversible: true, }, }, { id: "truthTable", label: "Truth Table", summary: "Boolean truth table for (a && b) || !(c && d).", role: "knowledge", transition: { reversible: true, }, }, { id: "dossier", label: "Dossier", summary: "Split-view profile composition for people, organizations, and records.", role: "dossier", transition: { reversible: true, }, }, ] as const satisfies readonly TopologyPresetCatalogEntry[]; export const TOPOLOGY_PRESET_CATALOG_BY_ID = Object.fromEntries( TOPOLOGY_PRESET_CATALOG.map((preset) => [preset.id, preset]), ) as Record; export function getTopologyPresetCatalogEntry(id: string) { return TOPOLOGY_PRESET_CATALOG_BY_ID[id]; } export const TOPOLOGY_PAGE_PRESETS = { homepageOpening: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.homepageOpening, camera: { persistence: "none", safeAreaRatio: 0.12, transitionDuration: 360, zoomStep: 0.08, }, signal: { transitionSpeed: 1.6, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), underConstruction: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.underConstruction, camera: { persistence: "none", safeAreaRatio: 0.1, transitionDuration: 360, zoomStep: 0.08, }, signal: { transitionSpeed: 1.6, }, minimap: { enabled: false, interactive: false, showControls: false, }, }), intro: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.homepageOpening, camera: { persistence: "none", safeAreaRatio: 0.08, transitionDuration: 420, }, signal: { transitionSpeed: 1.65, }, minimap: { enabled: false, interactive: false, showControls: false, }, }), operationalDashboard: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.operationalDashboard, camera: { persistence: "session", safeAreaRatio: 0.14, transitionDuration: 300, }, signal: { transitionSpeed: 1.42, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), organization: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.organizationDossier, camera: { persistence: "session", safeAreaRatio: 0.16, transitionDuration: 260, }, signal: { transitionSpeed: 1.35, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), personalKnowledge: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.personalKnowledge, camera: { persistence: "session", safeAreaRatio: 0.16, transitionDuration: 260, }, signal: { transitionSpeed: 1.35, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), systemArchitecture: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.systemArchitecture, camera: { persistence: "session", safeAreaRatio: 0.16, transitionDuration: 260, }, signal: { transitionSpeed: 1.35, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), mainSite: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.mainSite, camera: { persistence: "session", safeAreaRatio: 0.16, }, signal: { transitionSpeed: 1.35, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), timeline: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.timeline, camera: { persistence: "session", safeAreaRatio: 0.14, transitionDuration: 280, }, signal: { transitionSpeed: 1.28, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), experienceMap: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.experienceMap, camera: { persistence: "session", safeAreaRatio: 0.14, transitionDuration: 240, }, signal: { transitionSpeed: 1.25, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), dependencyMap: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.dependencyMap, camera: { persistence: "session", safeAreaRatio: 0.16, transitionDuration: 280, }, signal: { transitionSpeed: 1.3, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), matrixLayout: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.matrixLayout, camera: { persistence: "session", safeAreaRatio: 0.16, transitionDuration: 280, }, signal: { transitionSpeed: 1.3, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), truthTable: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.truthTable, camera: { persistence: "session", safeAreaRatio: 0.16, transitionDuration: 280, }, signal: { transitionSpeed: 1.3, }, minimap: { enabled: true, interactive: true, showControls: true, }, }), dossier: createTopologyPagePreset({ scene: TOPOLOGY_SCENE_PRESETS.dossier, camera: { persistence: "session", safeAreaRatio: 0.16, transitionDuration: 260, }, signal: { transitionSpeed: 1.35, }, minimap: { enabled: true, interactive: true, showControls: false, }, }), } as const;