File size: 4,311 Bytes
35b8b9c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | import { FileEntry } from '../types';
export const PROJECT_DNA: FileEntry[] = [
{
id: 'dna-app',
name: 'App.tsx',
type: 'typescript',
language: 'typescript',
isDirty: false,
content: `import React from 'react';
import { HiveProvider, useHive } from './context/HiveContext';
import NexusSidebar from './components/layout/NexusSidebar';
import NexusWorkbench from './components/layout/NexusWorkbench';
import AIPanel from './components/layout/AIPanel';
import NexusTerminal from './components/layout/NexusTerminal';
import SecurityModals from './components/layout/SecurityModals';
import Omnibar from './components/Omnibar';
import IDESwarmToggle from './components/layout/IDESwarmToggle';
import { cn } from './lib/utils';
import { ShieldAlert, Brain } from 'lucide-react';
function HiveApp() {
const {
isOmnibarOpen, setIsOmnibarOpen,
setCurrentActivity, appendLog,
swarmMode, mobileView, setMobileView,
showMobileSidebar, setShowMobileSidebar
} = useHive();
return (
<div className="h-screen w-full bg-surface-base text-white flex overflow-hidden font-sans selection:bg-primary selection:text-black">
{/* Mobile Header */}
<div className="lg:hidden fixed top-0 left-0 right-0 h-14 border-b border-white/5 bg-surface-base/80 backdrop-blur-xl z-[70] flex items-center justify-between px-4">
<div className="flex items-center gap-3">
<button
onClick={() => setShowMobileSidebar(!showMobileSidebar)}
className="p-2 bg-primary/10 rounded-lg text-primary"
>
<ShieldAlert size={20} />
</button>
<span className="font-bold text-sm tracking-widest text-primary">LYCEUM</span>
</div>
<IDESwarmToggle />
</div>
{/* Modular Desktop Layout */}
<NexusSidebar />
<main className="flex-1 flex flex-col relative min-w-0 lg:pt-0 pt-14">
<div className="flex-1 flex overflow-hidden">
<NexusWorkbench />
<div className={cn(
"fixed inset-y-0 right-0 w-full lg:relative lg:w-96 lg:translate-x-0 transition-transform duration-300 z-[80]",
mobileView === 'chat' ? 'translate-x-0' : 'translate-x-full lg:translate-x-0'
)}>
<AIPanel />
</div>
</div>
<NexusTerminal />
</main>
<SecurityModals />
<Omnibar />
</div>
);
}
export default function App() {
return (
<HiveProvider>
<HiveApp />
</HiveProvider>
);
}`,
},
{
id: 'dna-types',
name: 'types.ts',
type: 'typescript',
language: 'typescript',
isDirty: false,
content: `export interface FileEntry {
id: string;
name: string;
content: string;
type: string;
language?: string;
isDirty: boolean;
}
export type ActivityType = 'dashboard' | 'explorer' | 'search' | 'git' | 'apps' | 'security' | 'workflows' | 'library' | 'settings' | 'topology' | 'editor' | 'swarm' | 'harmonizer' | 'evolution' | 'root' | 'mapping' | 'splice' | 'obfuscation' | 'ledger' | 'sterile' | 'neurosynthesis' | 'queen' | 'vram' | 'training' | 'scriptorium' | 'nexus_reflection' | 'recursive_cascade';
export interface Agent {
id: string;
name: string;
evolutionLevel: number;
meritLevel: number;
securityStatus: 'Healthy' | 'Warning' | 'Quarantined';
}
// [Truncated for DNA payload...]`,
},
{
id: 'dna-gemini',
name: 'geminiService.ts',
type: 'typescript',
language: 'typescript',
isDirty: false,
content:
'import { GoogleGenAI } from "@google/genai";\n\nconst ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });\n\nexport const ScholasticAPI = {\n async selfEvolveCode(fileName: string, content: string, goal: string) {\n const prompt = `RECURSIVE_PROTOCOL: SELF_EVOLUTION\\nFILE: ${fileName}...`;\n return this.generateSecureText(prompt, "Chancellor Directive");\n }\n};',
},
{
id: 'dna-context',
name: 'HiveContext.tsx',
type: 'typescript',
language: 'typescript',
isDirty: false,
content: `export const HiveProvider = ({ children }) => {
const [files, setFiles] = useState([...]);
// The Academy's heart.
return <HiveContextSimulator.Provider value={value}>{children}</HiveContextSimulator.Provider>;
};`,
},
];
|