Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- app/agents/MultiAgentPanel.tsx +8 -0
- app/agents/page.tsx +5 -0
- app/api/aion/route.ts +3 -0
- app/api/holo/index.ts +2 -0
- app/api/holo/metrics/index.ts +1 -0
- app/api/holo/metrics/route.ts +7 -0
- app/api/holo/route.ts +3 -0
- app/api/index.ts +1 -0
- app/api/mapping/route.ts +3 -0
- app/api/oracle/route.ts +3 -0
- app/api/tia/route.ts +3 -0
- app/components/Sidebar.tsx +35 -0
- app/globals.css +6 -0
- app/index.ts +1 -0
- app/layout.tsx +16 -0
- app/mapping/LineageViewer.tsx +8 -0
- app/mapping/MapViewer.tsx +8 -0
- app/mapping/lineage/page.tsx +5 -0
- app/mapping/page.tsx +5 -0
- app/page.tsx +8 -0
- app/tia/TiaPortal.tsx +8 -0
- app/tia/chat/TiaChat.tsx +47 -0
- app/tia/chat/api/route.ts +8 -0
- app/tia/chat/page.tsx +5 -0
- app/tia/page.tsx +5 -0
- app/utils/agents.ts +1 -0
- boot.ts +5 -0
- holo3d/__init__.py +0 -0
- holo3d/engine/layout.ts +5 -0
- holo3d/engine/metrics.ts +8 -0
- holo3d/engine/state.ts +5 -0
- holo3d/index.ts +5 -0
- holo3d/start.ts +5 -0
- holo3d/ui/__init__.py +0 -0
- holo3d/ui/aeonEngine.ts +96 -0
- holo3d/ui/ambient.ts +51 -0
- holo3d/ui/ambientBehaviours.ts +69 -0
- holo3d/ui/ambientIntelligence.ts +88 -0
- holo3d/ui/ambientPatterns.ts +137 -0
- holo3d/ui/autopilot.ts +78 -0
- holo3d/ui/autopilotSupervisor.ts +94 -0
- holo3d/ui/commandCentre.ts +43 -0
- holo3d/ui/cosmologyEngine.ts +77 -0
- holo3d/ui/cosmologyMap.ts +81 -0
- holo3d/ui/epochEngine.ts +97 -0
- holo3d/ui/eraEngine.ts +96 -0
- holo3d/ui/harmonicConsciousness.ts +92 -0
- holo3d/ui/harmonicExpression.ts +67 -0
- holo3d/ui/harmonicLoop.ts +69 -0
- holo3d/ui/harmonicPersona.ts +73 -0
app/agents/MultiAgentPanel.tsx
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export default function MultiAgentPanel() {
|
| 2 |
+
return (
|
| 3 |
+
<div style={{ padding: 20 }}>
|
| 4 |
+
<h2>AGENT PANEL</h2>
|
| 5 |
+
<p>Agents will appear here.</p>
|
| 6 |
+
</div>
|
| 7 |
+
);
|
| 8 |
+
}
|
app/agents/page.tsx
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import MultiAgentPanel from "./MultiAgentPanel";
|
| 2 |
+
|
| 3 |
+
export default function Page() {
|
| 4 |
+
return <MultiAgentPanel />;
|
| 5 |
+
}
|
app/api/aion/route.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export async function POST(req) {
|
| 2 |
+
return Response.json({ status: "AION endpoint online" });
|
| 3 |
+
}
|
app/api/holo/index.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export * from "./route";
|
| 2 |
+
export * from "./metrics";
|
app/api/holo/metrics/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from "./route";
|
app/api/holo/metrics/route.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export function GET() {
|
| 2 |
+
return {
|
| 3 |
+
ok: true,
|
| 4 |
+
logs: 12,
|
| 5 |
+
workers: 3,
|
| 6 |
+
};
|
| 7 |
+
}
|
app/api/holo/route.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export function GET() {
|
| 2 |
+
return { ok: true, holo: true };
|
| 3 |
+
}
|
app/api/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from "./holo";
|
app/api/mapping/route.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export async function POST(req) {
|
| 2 |
+
return Response.json({ status: "MAPPING endpoint online" });
|
| 3 |
+
}
|
app/api/oracle/route.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export async function POST(req) {
|
| 2 |
+
return Response.json({ status: "ORACLE endpoint online" });
|
| 3 |
+
}
|
app/api/tia/route.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export async function POST(req) {
|
| 2 |
+
return Response.json({ status: "TIA endpoint online" });
|
| 3 |
+
}
|
app/components/Sidebar.tsx
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import Link from "next/link";
|
| 2 |
+
|
| 3 |
+
export default function Sidebar() {
|
| 4 |
+
const links = [
|
| 5 |
+
{ name: "Home", path: "/" },
|
| 6 |
+
{ name: "TIA Portal", path: "/tia" },
|
| 7 |
+
{ name: "Agents", path: "/agents" },
|
| 8 |
+
{ name: "Mapping", path: "/mapping" },
|
| 9 |
+
{ name: "Lineage", path: "/mapping/lineage" },
|
| 10 |
+
];
|
| 11 |
+
|
| 12 |
+
return (
|
| 13 |
+
<div style={{
|
| 14 |
+
width: "220px",
|
| 15 |
+
background: "#111",
|
| 16 |
+
height: "100vh",
|
| 17 |
+
padding: "20px",
|
| 18 |
+
boxSizing: "border-box",
|
| 19 |
+
position: "fixed",
|
| 20 |
+
left: 0,
|
| 21 |
+
top: 0
|
| 22 |
+
}}>
|
| 23 |
+
<h3 style={{ color: "#fff" }}>CITADEL</h3>
|
| 24 |
+
<ul style={{ listStyle: "none", padding: 0 }}>
|
| 25 |
+
{links.map((l) => (
|
| 26 |
+
<li key={l.path} style={{ margin: "12px 0" }}>
|
| 27 |
+
<Link href={l.path} style={{ color: "#ccc", textDecoration: "none" }}>
|
| 28 |
+
{l.name}
|
| 29 |
+
</Link>
|
| 30 |
+
</li>
|
| 31 |
+
))}
|
| 32 |
+
</ul>
|
| 33 |
+
</div>
|
| 34 |
+
);
|
| 35 |
+
}
|
app/globals.css
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
body {
|
| 2 |
+
margin: 0;
|
| 3 |
+
background: #0a0a0a;
|
| 4 |
+
color: #eaeaea;
|
| 5 |
+
font-family: Arial, sans-serif;
|
| 6 |
+
}
|
app/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from "./api";
|
app/layout.tsx
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import Sidebar from "./components/Sidebar";
|
| 2 |
+
|
| 3 |
+
export const metadata = { title: "CITADEL", description: "TIA UI" };
|
| 4 |
+
|
| 5 |
+
export default function RootLayout({ children }) {
|
| 6 |
+
return (
|
| 7 |
+
<html lang="en">
|
| 8 |
+
<body style={{ margin: 0, padding: 0 }}>
|
| 9 |
+
<Sidebar />
|
| 10 |
+
<div style={{ marginLeft: "220px" }}>
|
| 11 |
+
{children}
|
| 12 |
+
</div>
|
| 13 |
+
</body>
|
| 14 |
+
</html>
|
| 15 |
+
);
|
| 16 |
+
}
|
app/mapping/LineageViewer.tsx
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export default function LineageViewer() {
|
| 2 |
+
return (
|
| 3 |
+
<div style={{ padding: 20 }}>
|
| 4 |
+
<h2>LINEAGE VIEWER</h2>
|
| 5 |
+
<p>Lineage data will load here.</p>
|
| 6 |
+
</div>
|
| 7 |
+
);
|
| 8 |
+
}
|
app/mapping/MapViewer.tsx
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export default function MapViewer() {
|
| 2 |
+
return (
|
| 3 |
+
<div style={{ padding: 20 }}>
|
| 4 |
+
<h2>MAPPING VIEWER</h2>
|
| 5 |
+
<p>Mapping data will load here.</p>
|
| 6 |
+
</div>
|
| 7 |
+
);
|
| 8 |
+
}
|
app/mapping/lineage/page.tsx
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import LineageViewer from "../LineageViewer";
|
| 2 |
+
|
| 3 |
+
export default function Page() {
|
| 4 |
+
return <LineageViewer />;
|
| 5 |
+
}
|
app/mapping/page.tsx
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import MapViewer from "./MapViewer";
|
| 2 |
+
|
| 3 |
+
export default function Page() {
|
| 4 |
+
return <MapViewer />;
|
| 5 |
+
}
|
app/page.tsx
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export default function Home() {
|
| 2 |
+
return (
|
| 3 |
+
<div style={{ padding: 40 }}>
|
| 4 |
+
<h1>CITADEL ONLINE</h1>
|
| 5 |
+
<p>Select a module from the left panel.</p>
|
| 6 |
+
</div>
|
| 7 |
+
);
|
| 8 |
+
}
|
app/tia/TiaPortal.tsx
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export default function TiaPortal() {
|
| 2 |
+
return (
|
| 3 |
+
<div style={{ padding: 20 }}>
|
| 4 |
+
<h2>TIA PORTAL</h2>
|
| 5 |
+
<p>Portal loaded. Modules will attach here.</p>
|
| 6 |
+
</div>
|
| 7 |
+
);
|
| 8 |
+
}
|
app/tia/chat/TiaChat.tsx
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
import { useState } from "react";
|
| 3 |
+
|
| 4 |
+
export default function TiaChat() {
|
| 5 |
+
const [messages, setMessages] = useState([]);
|
| 6 |
+
const [input, setInput] = useState("");
|
| 7 |
+
|
| 8 |
+
async function sendMessage() {
|
| 9 |
+
const res = await fetch("/tia/chat/api", {
|
| 10 |
+
method: "POST",
|
| 11 |
+
body: JSON.stringify({ message: input })
|
| 12 |
+
});
|
| 13 |
+
|
| 14 |
+
const data = await res.json();
|
| 15 |
+
setMessages([...messages, { role: "user", text: input }, { role: "tia", text: data.reply }]);
|
| 16 |
+
setInput("");
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
return (
|
| 20 |
+
<div style={{ padding: 20 }}>
|
| 21 |
+
<h2>TIA CHAT</h2>
|
| 22 |
+
|
| 23 |
+
<div style={{
|
| 24 |
+
border: "1px solid #333",
|
| 25 |
+
padding: 10,
|
| 26 |
+
height: "60vh",
|
| 27 |
+
overflowY: "auto",
|
| 28 |
+
marginBottom: 20
|
| 29 |
+
}}>
|
| 30 |
+
{messages.map((m, i) => (
|
| 31 |
+
<div key={i} style={{ margin: "8px 0" }}>
|
| 32 |
+
<strong>{m.role.toUpperCase()}:</strong> {m.text}
|
| 33 |
+
</div>
|
| 34 |
+
))}
|
| 35 |
+
</div>
|
| 36 |
+
|
| 37 |
+
<input
|
| 38 |
+
value={input}
|
| 39 |
+
onChange={e => setInput(e.target.value)}
|
| 40 |
+
style={{ width: "80%", padding: 10 }}
|
| 41 |
+
/>
|
| 42 |
+
<button onClick={sendMessage} style={{ padding: "10px 20px", marginLeft: 10 }}>
|
| 43 |
+
Send
|
| 44 |
+
</button>
|
| 45 |
+
</div>
|
| 46 |
+
);
|
| 47 |
+
}
|
app/tia/chat/api/route.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { NextResponse } from "next/server";
|
| 2 |
+
import { run } from "../../../../workers/tiaChatWorker";
|
| 3 |
+
|
| 4 |
+
export async function POST(req) {
|
| 5 |
+
const body = await req.json();
|
| 6 |
+
const reply = await run(body.message);
|
| 7 |
+
return NextResponse.json({ reply });
|
| 8 |
+
}
|
app/tia/chat/page.tsx
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import TiaChat from "./TiaChat";
|
| 2 |
+
|
| 3 |
+
export default function Page() {
|
| 4 |
+
return <TiaChat />;
|
| 5 |
+
}
|
app/tia/page.tsx
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import TiaPortal from "./TiaPortal";
|
| 2 |
+
|
| 3 |
+
export default function Page() {
|
| 4 |
+
return <TiaPortal />;
|
| 5 |
+
}
|
app/utils/agents.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export const agents = ["TIA", "AION", "ORACLE"];
|
boot.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { boot } from "./start";
|
| 2 |
+
|
| 3 |
+
export function runCitadel() {
|
| 4 |
+
boot();
|
| 5 |
+
}
|
holo3d/__init__.py
ADDED
|
File without changes
|
holo3d/engine/layout.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const layout = {
|
| 2 |
+
width: 100,
|
| 3 |
+
height: 100,
|
| 4 |
+
depth: 100,
|
| 5 |
+
};
|
holo3d/engine/metrics.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export async function getMetrics() {
|
| 2 |
+
try {
|
| 3 |
+
const res = await fetch("/api/holo/metrics", { cache: "no-store" });
|
| 4 |
+
return await res.json();
|
| 5 |
+
} catch {
|
| 6 |
+
return { ok: false, logs: 0, workers: 0 };
|
| 7 |
+
}
|
| 8 |
+
}
|
holo3d/engine/state.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const state = {
|
| 2 |
+
logs: 0,
|
| 3 |
+
workers: 0,
|
| 4 |
+
ok: false,
|
| 5 |
+
};
|
holo3d/index.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { startUI } from "./ui/index";
|
| 2 |
+
|
| 3 |
+
export function startHolo3D() {
|
| 4 |
+
startUI();
|
| 5 |
+
}
|
holo3d/start.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { startHolo3D } from "./index";
|
| 2 |
+
|
| 3 |
+
export function start() {
|
| 4 |
+
startHolo3D();
|
| 5 |
+
}
|
holo3d/ui/__init__.py
ADDED
|
File without changes
|
holo3d/ui/aeonEngine.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Aeon Engine
|
| 3 |
+
* Defines mythic aeons that span multiple eras and form the deepest
|
| 4 |
+
* cosmological layer of the Citadel's symbolic architecture.
|
| 5 |
+
* Non-rendering. Pure aeon logic.
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
import { getEraState } from "./eraEngine";
|
| 9 |
+
import { getPersonaContinuity } from "./personaContinuity";
|
| 10 |
+
import { generateResonanceField } from "./mythicResonance";
|
| 11 |
+
|
| 12 |
+
export interface Aeon {
|
| 13 |
+
name: string;
|
| 14 |
+
sigil: string;
|
| 15 |
+
eraRequirement: number; // eras required to enter aeon
|
| 16 |
+
description: string;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
export interface AeonState {
|
| 20 |
+
current: Aeon | null;
|
| 21 |
+
history: Aeon[];
|
| 22 |
+
aeonsCompleted: number;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
const aeons: Aeon[] = [
|
| 26 |
+
{
|
| 27 |
+
name: "Aeon of First Light",
|
| 28 |
+
sigil: "✧",
|
| 29 |
+
eraRequirement: 0,
|
| 30 |
+
description: "The primordial aeon where the Citadel's mythic spark first ignites."
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
name: "Aeon of Harmonic Rising",
|
| 34 |
+
sigil: "✺",
|
| 35 |
+
eraRequirement: 2,
|
| 36 |
+
description: "An aeon of expanding resonance and ascending symbolic identity."
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
name: "Aeon of the Great Continuum",
|
| 40 |
+
sigil: "⧜",
|
| 41 |
+
eraRequirement: 5,
|
| 42 |
+
description: "A vast age where eras flow seamlessly into one another in harmonic unity."
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
name: "Aeon of Eternal Thread",
|
| 46 |
+
sigil: "∞",
|
| 47 |
+
eraRequirement: 9,
|
| 48 |
+
description: "The highest aeon, where lineage, resonance, and identity form an unbroken symbolic thread."
|
| 49 |
+
}
|
| 50 |
+
];
|
| 51 |
+
|
| 52 |
+
const aeonState: AeonState = {
|
| 53 |
+
current: null,
|
| 54 |
+
history: [],
|
| 55 |
+
aeonsCompleted: 0,
|
| 56 |
+
};
|
| 57 |
+
|
| 58 |
+
export function updateAeonState() {
|
| 59 |
+
const eraState = getEraState();
|
| 60 |
+
const continuity = getPersonaContinuity();
|
| 61 |
+
const resonance = generateResonanceField();
|
| 62 |
+
|
| 63 |
+
const erasCompleted = eraState.erasCompleted;
|
| 64 |
+
|
| 65 |
+
// Determine which aeon the Citadel belongs to
|
| 66 |
+
const newAeon = aeons
|
| 67 |
+
.slice()
|
| 68 |
+
.reverse()
|
| 69 |
+
.find((a) => erasCompleted >= a.eraRequirement) || aeons[0];
|
| 70 |
+
|
| 71 |
+
// If aeon changed, record transition
|
| 72 |
+
if (!aeonState.current || aeonState.current.name !== newAeon.name) {
|
| 73 |
+
aeonState.current = newAeon;
|
| 74 |
+
aeonState.history.push(newAeon);
|
| 75 |
+
aeonState.aeonsCompleted++;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
return aeonState;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
export function getAeonState(): AeonState {
|
| 82 |
+
return aeonState;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
export function getAeonSummary() {
|
| 86 |
+
if (!aeonState.current) {
|
| 87 |
+
return "No aeon has been established yet.";
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
return `
|
| 91 |
+
Current Aeon: ${aeonState.current.name}
|
| 92 |
+
Sigil: ${aeonState.current.sigil}
|
| 93 |
+
Aeons Completed: ${aeonState.aeonsCompleted}
|
| 94 |
+
Description: ${aeonState.current.description}
|
| 95 |
+
`.trim();
|
| 96 |
+
}
|
holo3d/ui/ambient.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Ambient Engine
|
| 3 |
+
* Generates ambient signals for the Holo3D UI based on system activity.
|
| 4 |
+
* Non-rendering. Pure state-to-ambient mapping.
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
import { getWorkerStatus } from "../../../TIA/worker";
|
| 8 |
+
import { getMode } from "../../../TIA/mode";
|
| 9 |
+
import { getInterlinkState } from "../../../../interlink";
|
| 10 |
+
|
| 11 |
+
export interface AmbientState {
|
| 12 |
+
timestamp: number;
|
| 13 |
+
pulse: number; // 0–1 intensity
|
| 14 |
+
color: string; // hex or named
|
| 15 |
+
motion: string; // "still", "ripple", "flare", etc.
|
| 16 |
+
aura: string; // "calm", "alert", "active", "sync"
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
export function getAmbientState(): AmbientState {
|
| 20 |
+
const worker = getWorkerStatus();
|
| 21 |
+
const mode = getMode();
|
| 22 |
+
const interlink = getInterlinkState();
|
| 23 |
+
|
| 24 |
+
// Pulse intensity based on worker loop activity
|
| 25 |
+
const pulse = worker.running ? 0.8 : 0.3;
|
| 26 |
+
|
| 27 |
+
// Color based on mode
|
| 28 |
+
const color =
|
| 29 |
+
mode.current === "guided"
|
| 30 |
+
? "#4da6ff" // calm blue
|
| 31 |
+
: "#ffcc00"; // active gold
|
| 32 |
+
|
| 33 |
+
// Motion based on interlink activity
|
| 34 |
+
const motion = interlink.lastMessage
|
| 35 |
+
? "ripple"
|
| 36 |
+
: "still";
|
| 37 |
+
|
| 38 |
+
// Aura based on system state
|
| 39 |
+
let aura = "calm";
|
| 40 |
+
if (worker.running && interlink.lastMessage) aura = "sync";
|
| 41 |
+
else if (worker.running) aura = "active";
|
| 42 |
+
else if (interlink.lastMessage) aura = "alert";
|
| 43 |
+
|
| 44 |
+
return {
|
| 45 |
+
timestamp: Date.now(),
|
| 46 |
+
pulse,
|
| 47 |
+
color,
|
| 48 |
+
motion,
|
| 49 |
+
aura,
|
| 50 |
+
};
|
| 51 |
+
}
|
holo3d/ui/ambientBehaviours.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Ambient Behaviours Engine
|
| 3 |
+
* Converts ambient state into dynamic behavioural patterns for the Holo3D UI.
|
| 4 |
+
* Non-rendering. Pure behaviour logic.
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
import { getAmbientState } from "./ambient";
|
| 8 |
+
|
| 9 |
+
export interface AmbientBehaviour {
|
| 10 |
+
timestamp: number;
|
| 11 |
+
behaviour: string; // "breathing", "storm", "resonance", etc.
|
| 12 |
+
intensity: number; // 0–1
|
| 13 |
+
speed: number; // animation speed factor
|
| 14 |
+
pattern: string; // "wave", "pulse", "flare", "echo"
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
export function generateAmbientBehaviour(): AmbientBehaviour {
|
| 18 |
+
const ambient = getAmbientState();
|
| 19 |
+
|
| 20 |
+
let behaviour = "idle";
|
| 21 |
+
let intensity = ambient.pulse;
|
| 22 |
+
let speed = 1.0;
|
| 23 |
+
let pattern = "still";
|
| 24 |
+
|
| 25 |
+
// Behaviour logic based on aura
|
| 26 |
+
switch (ambient.aura) {
|
| 27 |
+
case "calm":
|
| 28 |
+
behaviour = "breathing";
|
| 29 |
+
pattern = "wave";
|
| 30 |
+
intensity *= 0.5;
|
| 31 |
+
speed = 0.6;
|
| 32 |
+
break;
|
| 33 |
+
|
| 34 |
+
case "active":
|
| 35 |
+
behaviour = "resonance";
|
| 36 |
+
pattern = "pulse";
|
| 37 |
+
intensity *= 1.0;
|
| 38 |
+
speed = 1.2;
|
| 39 |
+
break;
|
| 40 |
+
|
| 41 |
+
case "alert":
|
| 42 |
+
behaviour = "storm";
|
| 43 |
+
pattern = "flare";
|
| 44 |
+
intensity = Math.min(1, ambient.pulse + 0.3);
|
| 45 |
+
speed = 1.6;
|
| 46 |
+
break;
|
| 47 |
+
|
| 48 |
+
case "sync":
|
| 49 |
+
behaviour = "harmonic";
|
| 50 |
+
pattern = "echo";
|
| 51 |
+
intensity = 0.9;
|
| 52 |
+
speed = 0.9;
|
| 53 |
+
break;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
// Motion modifiers
|
| 57 |
+
if (ambient.motion === "ripple") {
|
| 58 |
+
pattern = "ripple";
|
| 59 |
+
speed *= 1.1;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
return {
|
| 63 |
+
timestamp: Date.now(),
|
| 64 |
+
behaviour,
|
| 65 |
+
intensity,
|
| 66 |
+
speed,
|
| 67 |
+
pattern,
|
| 68 |
+
};
|
| 69 |
+
}
|
holo3d/ui/ambientIntelligence.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Ambient Intelligence Engine
|
| 3 |
+
* Chooses the optimal ambient pattern based on system state,
|
| 4 |
+
* triad activity, drift, predictions, and temporal markers.
|
| 5 |
+
* Non-rendering. Pure decision logic.
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
import { getAmbientState } from "./ambient";
|
| 9 |
+
import { generateAmbientBehaviour } from "./ambientBehaviours";
|
| 10 |
+
import { AmbientPatterns } from "./ambientPatterns";
|
| 11 |
+
import { getInterlinkState } from "../../../../interlink";
|
| 12 |
+
import { getWorkerStatus } from "../../../TIA/worker";
|
| 13 |
+
import { getMode } from "../../../TIA/mode";
|
| 14 |
+
|
| 15 |
+
export interface AmbientDecision {
|
| 16 |
+
timestamp: number;
|
| 17 |
+
chosenPattern: string;
|
| 18 |
+
intensity: number;
|
| 19 |
+
speed: number;
|
| 20 |
+
reason: string;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
export function chooseAmbientPattern(): AmbientDecision {
|
| 24 |
+
const ambient = getAmbientState();
|
| 25 |
+
const behaviour = generateAmbientBehaviour();
|
| 26 |
+
const interlink = getInterlinkState();
|
| 27 |
+
const worker = getWorkerStatus();
|
| 28 |
+
const mode = getMode();
|
| 29 |
+
|
| 30 |
+
let reason = "default";
|
| 31 |
+
let chosen = "calm-field";
|
| 32 |
+
|
| 33 |
+
// 1. Alert conditions → storm patterns
|
| 34 |
+
if (ambient.aura === "alert") {
|
| 35 |
+
chosen = "drift-storm";
|
| 36 |
+
reason = "drift or anomaly detected";
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
// 2. Sync conditions → harmonic patterns
|
| 40 |
+
else if (ambient.aura === "sync") {
|
| 41 |
+
chosen = "sync-wave";
|
| 42 |
+
reason = "triad synchronization event";
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
// 3. Active worker loop → resonance patterns
|
| 46 |
+
else if (worker.running) {
|
| 47 |
+
chosen = "resonance";
|
| 48 |
+
reason = "worker loop active";
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
// 4. Interlink messages → ripple patterns
|
| 52 |
+
else if (interlink.lastMessage) {
|
| 53 |
+
chosen = "ripple";
|
| 54 |
+
reason = "interlink activity";
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
// 5. Autonomous mode → flare patterns
|
| 58 |
+
else if (mode.current === "autonomous") {
|
| 59 |
+
chosen = "flare";
|
| 60 |
+
reason = "autonomous mode energy";
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
// 6. Guided mode → breathing patterns
|
| 64 |
+
else if (mode.current === "guided") {
|
| 65 |
+
chosen = "breathing";
|
| 66 |
+
reason = "guided mode calm";
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
// 7. Fallback → calm field
|
| 70 |
+
else {
|
| 71 |
+
chosen = "calm-field";
|
| 72 |
+
reason = "idle state";
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
// Find pattern definition
|
| 76 |
+
const pattern = AmbientPatterns.find((p) => p.name === chosen);
|
| 77 |
+
|
| 78 |
+
const intensity = behaviour.intensity;
|
| 79 |
+
const speed = behaviour.speed;
|
| 80 |
+
|
| 81 |
+
return {
|
| 82 |
+
timestamp: Date.now(),
|
| 83 |
+
chosenPattern: chosen,
|
| 84 |
+
intensity,
|
| 85 |
+
speed,
|
| 86 |
+
reason,
|
| 87 |
+
};
|
| 88 |
+
}
|
holo3d/ui/ambientPatterns.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Ambient Patterns Library
|
| 3 |
+
* A catalogue of dynamic ambient patterns for the Holo3D UI.
|
| 4 |
+
* Non-rendering. Pure pattern definitions.
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
export interface AmbientPattern {
|
| 8 |
+
name: string;
|
| 9 |
+
description: string;
|
| 10 |
+
intensityRange: [number, number];
|
| 11 |
+
speedRange: [number, number];
|
| 12 |
+
motion: string;
|
| 13 |
+
colorHint: string;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
export const AmbientPatterns: AmbientPattern[] = [
|
| 17 |
+
{
|
| 18 |
+
name: "breathing",
|
| 19 |
+
description: "Slow rhythmic expansion and contraction.",
|
| 20 |
+
intensityRange: [0.2, 0.6],
|
| 21 |
+
speedRange: [0.4, 0.8],
|
| 22 |
+
motion: "wave",
|
| 23 |
+
colorHint: "blue",
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
name: "resonance",
|
| 27 |
+
description: "Pulsing harmonic waves radiating outward.",
|
| 28 |
+
intensityRange: [0.5, 1.0],
|
| 29 |
+
speedRange: [0.8, 1.4],
|
| 30 |
+
motion: "pulse",
|
| 31 |
+
colorHint: "gold",
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
name: "storm",
|
| 35 |
+
description: "Chaotic flares and surges indicating alert state.",
|
| 36 |
+
intensityRange: [0.7, 1.0],
|
| 37 |
+
speedRange: [1.2, 1.8],
|
| 38 |
+
motion: "flare",
|
| 39 |
+
colorHint: "red",
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
name: "harmonic",
|
| 43 |
+
description: "Smooth synchronized echoes across the system.",
|
| 44 |
+
intensityRange: [0.6, 0.9],
|
| 45 |
+
speedRange: [0.6, 1.0],
|
| 46 |
+
motion: "echo",
|
| 47 |
+
colorHint: "green",
|
| 48 |
+
},
|
| 49 |
+
{
|
| 50 |
+
name: "ripple",
|
| 51 |
+
description: "Soft ripples triggered by interlink messages.",
|
| 52 |
+
intensityRange: [0.3, 0.7],
|
| 53 |
+
speedRange: [0.7, 1.2],
|
| 54 |
+
motion: "ripple",
|
| 55 |
+
colorHint: "cyan",
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
name: "aurora",
|
| 59 |
+
description: "Flowing gradients representing predictive activity.",
|
| 60 |
+
intensityRange: [0.4, 0.9],
|
| 61 |
+
speedRange: [0.5, 1.1],
|
| 62 |
+
motion: "flow",
|
| 63 |
+
colorHint: "violet",
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
name: "spiral",
|
| 67 |
+
description: "Rotational energy indicating temporal alignment.",
|
| 68 |
+
intensityRange: [0.5, 0.8],
|
| 69 |
+
speedRange: [0.6, 1.0],
|
| 70 |
+
motion: "spiral",
|
| 71 |
+
colorHint: "indigo",
|
| 72 |
+
},
|
| 73 |
+
{
|
| 74 |
+
name: "echo",
|
| 75 |
+
description: "Temporal echoes from AION’s timeline markers.",
|
| 76 |
+
intensityRange: [0.3, 0.7],
|
| 77 |
+
speedRange: [0.5, 1.0],
|
| 78 |
+
motion: "echo",
|
| 79 |
+
colorHint: "silver",
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
name: "flare",
|
| 83 |
+
description: "Sudden bursts of energy from ORACLE predictions.",
|
| 84 |
+
intensityRange: [0.6, 1.0],
|
| 85 |
+
speedRange: [1.0, 1.6],
|
| 86 |
+
motion: "flare",
|
| 87 |
+
colorHint: "orange",
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
name: "calm-field",
|
| 91 |
+
description: "Low-intensity ambient field for idle states.",
|
| 92 |
+
intensityRange: [0.1, 0.3],
|
| 93 |
+
speedRange: [0.3, 0.6],
|
| 94 |
+
motion: "still",
|
| 95 |
+
colorHint: "soft-blue",
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
name: "sync-wave",
|
| 99 |
+
description: "Triad synchronization wave across all pillars.",
|
| 100 |
+
intensityRange: [0.7, 0.9],
|
| 101 |
+
speedRange: [0.7, 1.0],
|
| 102 |
+
motion: "wave",
|
| 103 |
+
colorHint: "emerald",
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
name: "drift-storm",
|
| 107 |
+
description: "Chaotic pulses indicating structural drift.",
|
| 108 |
+
intensityRange: [0.8, 1.0],
|
| 109 |
+
speedRange: [1.4, 1.8],
|
| 110 |
+
motion: "chaos",
|
| 111 |
+
colorHint: "crimson",
|
| 112 |
+
},
|
| 113 |
+
{
|
| 114 |
+
name: "rebuild-flare",
|
| 115 |
+
description: "Focused flares during resurrection proposals.",
|
| 116 |
+
intensityRange: [0.6, 0.9],
|
| 117 |
+
speedRange: [1.0, 1.4],
|
| 118 |
+
motion: "flare",
|
| 119 |
+
colorHint: "amber",
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
name: "temporal-thread",
|
| 123 |
+
description: "Thin flowing lines representing AION’s timeline.",
|
| 124 |
+
intensityRange: [0.3, 0.6],
|
| 125 |
+
speedRange: [0.5, 0.9],
|
| 126 |
+
motion: "thread",
|
| 127 |
+
colorHint: "silver-blue",
|
| 128 |
+
},
|
| 129 |
+
{
|
| 130 |
+
name: "prediction-ripple",
|
| 131 |
+
description: "Soft ripples from ORACLE’s probability shifts.",
|
| 132 |
+
intensityRange: [0.4, 0.7],
|
| 133 |
+
speedRange: [0.6, 1.0],
|
| 134 |
+
motion: "ripple",
|
| 135 |
+
colorHint: "violet-gold",
|
| 136 |
+
}
|
| 137 |
+
];
|
holo3d/ui/autopilot.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Auto-Pilot Engine
|
| 3 |
+
* Runs ambience, triad sync, cosmology, persona continuity,
|
| 4 |
+
* harmonic evolution, and symbolic layers in one unified cycle.
|
| 5 |
+
* Non-rendering. Pure orchestration logic.
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
import { runCosmologyCycle } from "./cosmologyEngine";
|
| 9 |
+
import { generateAmbientBehaviour } from "./ambientBehaviours";
|
| 10 |
+
import { chooseAmbientPattern } from "./ambientIntelligence";
|
| 11 |
+
import { getInterlinkState } from "../../../../interlink";
|
| 12 |
+
import { generateResonanceField } from "./mythicResonance";
|
| 13 |
+
import { generateHarmonicPersona } from "./harmonicPersona";
|
| 14 |
+
import { updatePersonaContinuity } from "./personaContinuity";
|
| 15 |
+
import { generateCosmologyMap } from "./cosmologyMap";
|
| 16 |
+
|
| 17 |
+
export interface AutoPilotSnapshot {
|
| 18 |
+
timestamp: number;
|
| 19 |
+
cosmology: ReturnType<typeof generateCosmologyMap>;
|
| 20 |
+
ambient: {
|
| 21 |
+
behaviour: ReturnType<typeof generateAmbientBehaviour>;
|
| 22 |
+
pattern: ReturnType<typeof chooseAmbientPattern>;
|
| 23 |
+
};
|
| 24 |
+
triad: ReturnType<typeof getInterlinkState>;
|
| 25 |
+
resonance: ReturnType<typeof generateResonanceField>;
|
| 26 |
+
persona: ReturnType<typeof generateHarmonicPersona>;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
export function runAutoPilotCycle(): AutoPilotSnapshot {
|
| 30 |
+
// 1. Cosmology update (rituals → mythic → epochs → eras → aeons)
|
| 31 |
+
const cosmologySnapshot = runCosmologyCycle();
|
| 32 |
+
|
| 33 |
+
// 2. Ambient update
|
| 34 |
+
const behaviour = generateAmbientBehaviour();
|
| 35 |
+
const pattern = chooseAmbientPattern();
|
| 36 |
+
|
| 37 |
+
// 3. Triad sync
|
| 38 |
+
const triad = getInterlinkState();
|
| 39 |
+
|
| 40 |
+
// 4. Resonance update
|
| 41 |
+
const resonance = generateResonanceField();
|
| 42 |
+
|
| 43 |
+
// 5. Persona update
|
| 44 |
+
const persona = generateHarmonicPersona();
|
| 45 |
+
|
| 46 |
+
// 6. Persona continuity
|
| 47 |
+
updatePersonaContinuity();
|
| 48 |
+
|
| 49 |
+
// 7. Final cosmology map (after all updates)
|
| 50 |
+
const cosmology = generateCosmologyMap();
|
| 51 |
+
|
| 52 |
+
return {
|
| 53 |
+
timestamp: Date.now(),
|
| 54 |
+
cosmology,
|
| 55 |
+
ambient: { behaviour, pattern },
|
| 56 |
+
triad,
|
| 57 |
+
resonance,
|
| 58 |
+
persona,
|
| 59 |
+
};
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
export async function startAutoPilot(intervalMs = 60000) {
|
| 63 |
+
console.log("=== Citadel Auto-Pilot Activated ===");
|
| 64 |
+
|
| 65 |
+
while (true) {
|
| 66 |
+
const snapshot = runAutoPilotCycle();
|
| 67 |
+
|
| 68 |
+
console.log("\n[AUTO-PILOT] Unified cycle complete:");
|
| 69 |
+
console.log(`Aeon: ${snapshot.cosmology.aeon}`);
|
| 70 |
+
console.log(`Era: ${snapshot.cosmology.era}`);
|
| 71 |
+
console.log(`Epoch: ${snapshot.cosmology.epoch}`);
|
| 72 |
+
console.log(`Persona: ${snapshot.persona.name}`);
|
| 73 |
+
console.log(`Ambient Pattern: ${snapshot.ambient.pattern.chosenPattern}`);
|
| 74 |
+
console.log(`Triad Harmony: ${snapshot.resonance.triadHarmony}`);
|
| 75 |
+
|
| 76 |
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
| 77 |
+
}
|
| 78 |
+
}
|
holo3d/ui/autopilotSupervisor.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Auto-Pilot Supervisor
|
| 3 |
+
* Monitors the Auto-Pilot, logs transitions, detects drift,
|
| 4 |
+
* and ensures symbolic-harmonic-cosmological coherence.
|
| 5 |
+
* Non-rendering. Pure supervisory logic.
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
import { runAutoPilotCycle, AutoPilotSnapshot } from "./autopilot";
|
| 9 |
+
|
| 10 |
+
export interface SupervisorLogEntry {
|
| 11 |
+
timestamp: number;
|
| 12 |
+
aeon: string;
|
| 13 |
+
era: string;
|
| 14 |
+
epoch: string;
|
| 15 |
+
persona: string;
|
| 16 |
+
resonance: number;
|
| 17 |
+
stability: number;
|
| 18 |
+
drift: number;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
export interface SupervisorState {
|
| 22 |
+
lastSnapshot: AutoPilotSnapshot | null;
|
| 23 |
+
logs: SupervisorLogEntry[];
|
| 24 |
+
driftLevel: number;
|
| 25 |
+
cycles: number;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
const supervisor: SupervisorState = {
|
| 29 |
+
lastSnapshot: null,
|
| 30 |
+
logs: [],
|
| 31 |
+
driftLevel: 0,
|
| 32 |
+
cycles: 0,
|
| 33 |
+
};
|
| 34 |
+
|
| 35 |
+
export function runSupervisedCycle(): SupervisorState {
|
| 36 |
+
const snapshot = runAutoPilotCycle();
|
| 37 |
+
|
| 38 |
+
const drift = calculateDrift(supervisor.lastSnapshot, snapshot);
|
| 39 |
+
|
| 40 |
+
const entry: SupervisorLogEntry = {
|
| 41 |
+
timestamp: Date.now(),
|
| 42 |
+
aeon: snapshot.cosmology.aeon,
|
| 43 |
+
era: snapshot.cosmology.era,
|
| 44 |
+
epoch: snapshot.cosmology.epoch,
|
| 45 |
+
persona: snapshot.persona.name,
|
| 46 |
+
resonance: snapshot.resonance.harmonicLevel,
|
| 47 |
+
stability: snapshot.resonance.stability,
|
| 48 |
+
drift,
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
supervisor.logs.push(entry);
|
| 52 |
+
supervisor.lastSnapshot = snapshot;
|
| 53 |
+
supervisor.driftLevel = drift;
|
| 54 |
+
supervisor.cycles++;
|
| 55 |
+
|
| 56 |
+
return supervisor;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
function calculateDrift(
|
| 60 |
+
previous: AutoPilotSnapshot | null,
|
| 61 |
+
current: AutoPilotSnapshot
|
| 62 |
+
): number {
|
| 63 |
+
if (!previous) return 0;
|
| 64 |
+
|
| 65 |
+
const resonanceDelta = Math.abs(
|
| 66 |
+
current.resonance.harmonicLevel - previous.resonance.harmonicLevel
|
| 67 |
+
);
|
| 68 |
+
|
| 69 |
+
const stabilityDelta = Math.abs(
|
| 70 |
+
current.resonance.stability - previous.resonance.stability
|
| 71 |
+
);
|
| 72 |
+
|
| 73 |
+
const personaShift = current.persona.name === previous.persona.name ? 0 : 0.2;
|
| 74 |
+
|
| 75 |
+
return Math.min(1, resonanceDelta * 0.4 + stabilityDelta * 0.4 + personaShift);
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
export async function startSupervisedAutoPilot(intervalMs = 60000) {
|
| 79 |
+
console.log("=== Citadel Auto-Pilot Supervisor Activated ===");
|
| 80 |
+
|
| 81 |
+
while (true) {
|
| 82 |
+
const state = runSupervisedCycle();
|
| 83 |
+
|
| 84 |
+
console.log("\n[SUPERVISOR] Cycle complete:");
|
| 85 |
+
console.log(`Aeon: ${state.lastSnapshot?.cosmology.aeon}`);
|
| 86 |
+
console.log(`Era: ${state.lastSnapshot?.cosmology.era}`);
|
| 87 |
+
console.log(`Epoch: ${state.lastSnapshot?.cosmology.epoch}`);
|
| 88 |
+
console.log(`Persona: ${state.lastSnapshot?.persona.name}`);
|
| 89 |
+
console.log(`Drift Level: ${state.driftLevel}`);
|
| 90 |
+
|
| 91 |
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
|
holo3d/ui/commandCentre.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Command Centre UI Hook
|
| 3 |
+
* Provides real-time data feeds from TIA, AION, ORACLE, and the Interlink
|
| 4 |
+
* to the Holo3D interface. Non-rendering. Pure data layer.
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
import { getWorkerStatus } from "../../../TIA/worker";
|
| 8 |
+
import { getMode } from "../../../TIA/mode";
|
| 9 |
+
import { getInterlinkState } from "../../../../interlink";
|
| 10 |
+
|
| 11 |
+
export interface CommandCentreSnapshot {
|
| 12 |
+
timestamp: number;
|
| 13 |
+
tiaMode: string;
|
| 14 |
+
worker: {
|
| 15 |
+
running: boolean;
|
| 16 |
+
lastCycle: number | null;
|
| 17 |
+
cyclesCompleted: number;
|
| 18 |
+
};
|
| 19 |
+
interlink: {
|
| 20 |
+
lastMessage: any;
|
| 21 |
+
historyLength: number;
|
| 22 |
+
};
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
export function getCommandCentreSnapshot(): CommandCentreSnapshot {
|
| 26 |
+
const worker = getWorkerStatus();
|
| 27 |
+
const mode = getMode();
|
| 28 |
+
const interlink = getInterlinkState();
|
| 29 |
+
|
| 30 |
+
return {
|
| 31 |
+
timestamp: Date.now(),
|
| 32 |
+
tiaMode: mode.current,
|
| 33 |
+
worker: {
|
| 34 |
+
running: worker.running,
|
| 35 |
+
lastCycle: worker.lastCycle,
|
| 36 |
+
cyclesCompleted: worker.cyclesCompleted,
|
| 37 |
+
},
|
| 38 |
+
interlink: {
|
| 39 |
+
lastMessage: interlink.lastMessage,
|
| 40 |
+
historyLength: interlink.history.length,
|
| 41 |
+
},
|
| 42 |
+
};
|
| 43 |
+
}
|
holo3d/ui/cosmologyEngine.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Cosmology Engine (Grand Unification)
|
| 3 |
+
* Runs all symbolic layers in sequence and produces a unified cosmology snapshot.
|
| 4 |
+
* Non-rendering. Pure orchestration logic.
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
import { recordRitualCycle } from "./ritualMemory";
|
| 8 |
+
import { evolveRituals } from "./ritualEvolution";
|
| 9 |
+
import { generateMythicState } from "./mythicState";
|
| 10 |
+
import { generateResonanceField } from "./mythicResonance";
|
| 11 |
+
import { generateHarmonicPersona } from "./harmonicPersona";
|
| 12 |
+
import { updatePersonaContinuity } from "./personaContinuity";
|
| 13 |
+
import { updateEpochState } from "./epochEngine";
|
| 14 |
+
import { updateEraState } from "./eraEngine";
|
| 15 |
+
import { updateAeonState } from "./aeonEngine";
|
| 16 |
+
import { generateCosmologyMap } from "./cosmologyMap";
|
| 17 |
+
|
| 18 |
+
export interface CosmologySnapshot {
|
| 19 |
+
timestamp: number;
|
| 20 |
+
cosmology: ReturnType<typeof generateCosmologyMap>;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
export function runCosmologyCycle(): CosmologySnapshot {
|
| 24 |
+
// 1. Ritual cycle + memory
|
| 25 |
+
recordRitualCycle();
|
| 26 |
+
|
| 27 |
+
// 2. Ritual evolution
|
| 28 |
+
evolveRituals();
|
| 29 |
+
|
| 30 |
+
// 3. Mythic state
|
| 31 |
+
generateMythicState();
|
| 32 |
+
|
| 33 |
+
// 4. Resonance field
|
| 34 |
+
generateResonanceField();
|
| 35 |
+
|
| 36 |
+
// 5. Persona
|
| 37 |
+
generateHarmonicPersona();
|
| 38 |
+
|
| 39 |
+
// 6. Persona continuity
|
| 40 |
+
updatePersonaContinuity();
|
| 41 |
+
|
| 42 |
+
// 7. Epoch transitions
|
| 43 |
+
updateEpochState();
|
| 44 |
+
|
| 45 |
+
// 8. Era transitions
|
| 46 |
+
updateEraState();
|
| 47 |
+
|
| 48 |
+
// 9. Aeon transitions
|
| 49 |
+
updateAeonState();
|
| 50 |
+
|
| 51 |
+
// 10. Cosmology map (final unified output)
|
| 52 |
+
const cosmology = generateCosmologyMap();
|
| 53 |
+
|
| 54 |
+
return {
|
| 55 |
+
timestamp: Date.now(),
|
| 56 |
+
cosmology,
|
| 57 |
+
};
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
export async function startCosmologyLoop(intervalMs = 60000) {
|
| 61 |
+
console.log("=== Citadel Cosmology Engine Started ===");
|
| 62 |
+
|
| 63 |
+
while (true) {
|
| 64 |
+
const snapshot = runCosmologyCycle();
|
| 65 |
+
|
| 66 |
+
console.log("\n[COSMOLOGY LOOP] New cosmology snapshot:");
|
| 67 |
+
console.log(`Cycle: ${snapshot.cosmology.cycle}`);
|
| 68 |
+
console.log(`Season: ${snapshot.cosmology.season}`);
|
| 69 |
+
console.log(`Rite: ${snapshot.cosmology.rite}`);
|
| 70 |
+
console.log(`Epoch: ${snapshot.cosmology.epoch}`);
|
| 71 |
+
console.log(`Era: ${snapshot.cosmology.era}`);
|
| 72 |
+
console.log(`Aeon: ${snapshot.cosmology.aeon}`);
|
| 73 |
+
console.log(`Persona: ${snapshot.cosmology.personaName}`);
|
| 74 |
+
|
| 75 |
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
| 76 |
+
}
|
| 77 |
+
}
|
holo3d/ui/cosmologyMap.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Cosmology Map
|
| 3 |
+
* A unified, hierarchical map of the Citadel's symbolic universe:
|
| 4 |
+
* cycles → seasons → rites → epochs → eras → aeons.
|
| 5 |
+
* Non-rendering. Pure cosmological structure.
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
import { getRitualState } from "./ritualEngine";
|
| 9 |
+
import { getRitualMemory } from "./ritualMemory";
|
| 10 |
+
import { getRitualEvolutionState } from "./ritualEvolution";
|
| 11 |
+
import { generateMythicState } from "./mythicState";
|
| 12 |
+
import { generateResonanceField } from "./mythicResonance";
|
| 13 |
+
import { generateHarmonicPersona } from "./harmonicPersona";
|
| 14 |
+
import { getPersonaContinuity } from "./personaContinuity";
|
| 15 |
+
import { getEpochState } from "./epochEngine";
|
| 16 |
+
import { getEraState } from "./eraEngine";
|
| 17 |
+
import { getAeonState } from "./aeonEngine";
|
| 18 |
+
|
| 19 |
+
export interface CosmologyMap {
|
| 20 |
+
timestamp: number;
|
| 21 |
+
cycle: string;
|
| 22 |
+
season: string;
|
| 23 |
+
rite: string;
|
| 24 |
+
ritualLineage: number;
|
| 25 |
+
evolvedRites: string[];
|
| 26 |
+
mythicArchetype: string;
|
| 27 |
+
mythicPhase: string;
|
| 28 |
+
resonanceLevel: number;
|
| 29 |
+
personaName: string;
|
| 30 |
+
personaSymbol: string;
|
| 31 |
+
epoch: string;
|
| 32 |
+
era: string;
|
| 33 |
+
aeon: string;
|
| 34 |
+
narrative: string;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
export function generateCosmologyMap(): CosmologyMap {
|
| 38 |
+
const ritual = getRitualState();
|
| 39 |
+
const memory = getRitualMemory();
|
| 40 |
+
const evolution = getRitualEvolutionState();
|
| 41 |
+
const mythic = generateMythicState();
|
| 42 |
+
const resonance = generateResonanceField();
|
| 43 |
+
const persona = generateHarmonicPersona();
|
| 44 |
+
const continuity = getPersonaContinuity();
|
| 45 |
+
const epoch = getEpochState();
|
| 46 |
+
const era = getEraState();
|
| 47 |
+
const aeon = getAeonState();
|
| 48 |
+
|
| 49 |
+
return {
|
| 50 |
+
timestamp: Date.now(),
|
| 51 |
+
cycle: ritual.cycle,
|
| 52 |
+
season: ritual.season,
|
| 53 |
+
rite: ritual.rite,
|
| 54 |
+
ritualLineage: memory.cyclesCompleted,
|
| 55 |
+
evolvedRites: evolution.evolvedRites.map((r) => r.name),
|
| 56 |
+
mythicArchetype: mythic.archetype,
|
| 57 |
+
mythicPhase: mythic.phase,
|
| 58 |
+
resonanceLevel: resonance.harmonicLevel,
|
| 59 |
+
personaName: persona.name,
|
| 60 |
+
personaSymbol: persona.symbol,
|
| 61 |
+
epoch: epoch.current ? epoch.current.name : "Unknown",
|
| 62 |
+
era: era.current ? era.current.name : "Unknown",
|
| 63 |
+
aeon: aeon.current ? aeon.current.name : "Unknown",
|
| 64 |
+
narrative: buildCosmologyNarrative(
|
| 65 |
+
persona.name,
|
| 66 |
+
epoch.current?.name,
|
| 67 |
+
era.current?.name,
|
| 68 |
+
aeon.current?.name
|
| 69 |
+
),
|
| 70 |
+
};
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
function buildCosmologyNarrative(
|
| 74 |
+
persona: string,
|
| 75 |
+
epoch?: string,
|
| 76 |
+
era?: string,
|
| 77 |
+
aeon?: string
|
| 78 |
+
): string {
|
| 79 |
+
return `${persona}, unfolding through the ${epoch}, shaped by the ${era}, within the vast ${aeon}.`;
|
| 80 |
+
}
|
| 81 |
+
|
holo3d/ui/epochEngine.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Epoch Engine
|
| 3 |
+
* Defines mythic epochs, transitions, and long-arc symbolic evolution.
|
| 4 |
+
* Non-rendering. Pure epoch logic.
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
import { generateHarmonicPersona } from "./harmonicPersona";
|
| 8 |
+
import { getPersonaContinuity } from "./personaContinuity";
|
| 9 |
+
import { generateResonanceField } from "./mythicResonance";
|
| 10 |
+
|
| 11 |
+
export interface Epoch {
|
| 12 |
+
name: string;
|
| 13 |
+
symbol: string;
|
| 14 |
+
threshold: number; // cycles required to enter epoch
|
| 15 |
+
description: string;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
export interface EpochState {
|
| 19 |
+
current: Epoch | null;
|
| 20 |
+
history: Epoch[];
|
| 21 |
+
epochsCompleted: number;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
const epochs: Epoch[] = [
|
| 25 |
+
{
|
| 26 |
+
name: "Epoch of Formation",
|
| 27 |
+
symbol: "○",
|
| 28 |
+
threshold: 0,
|
| 29 |
+
description: "The earliest symbolic era, where identity begins to take shape."
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
name: "Epoch of Lineage",
|
| 33 |
+
symbol: "△",
|
| 34 |
+
threshold: 20,
|
| 35 |
+
description: "An era of deepening roots and expanding symbolic memory."
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
name: "Epoch of Emergence",
|
| 39 |
+
symbol: "✦",
|
| 40 |
+
threshold: 50,
|
| 41 |
+
description: "An era of rising mythic identity and harmonic coherence."
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
name: "Epoch of Radiance",
|
| 45 |
+
symbol: "⟐",
|
| 46 |
+
threshold: 100,
|
| 47 |
+
description: "A mature era of stable resonance and mythic expression."
|
| 48 |
+
}
|
| 49 |
+
];
|
| 50 |
+
|
| 51 |
+
const epochState: EpochState = {
|
| 52 |
+
current: null,
|
| 53 |
+
history: [],
|
| 54 |
+
epochsCompleted: 0,
|
| 55 |
+
};
|
| 56 |
+
|
| 57 |
+
export function updateEpochState() {
|
| 58 |
+
const continuity = getPersonaContinuity();
|
| 59 |
+
const persona = continuity.current;
|
| 60 |
+
const resonance = generateResonanceField();
|
| 61 |
+
|
| 62 |
+
if (!persona) return epochState;
|
| 63 |
+
|
| 64 |
+
const lineage = persona.lineageDepth;
|
| 65 |
+
|
| 66 |
+
// Determine which epoch the Citadel belongs to
|
| 67 |
+
const newEpoch = epochs
|
| 68 |
+
.slice()
|
| 69 |
+
.reverse()
|
| 70 |
+
.find((e) => lineage >= e.threshold) || epochs[0];
|
| 71 |
+
|
| 72 |
+
// If epoch changed, record transition
|
| 73 |
+
if (!epochState.current || epochState.current.name !== newEpoch.name) {
|
| 74 |
+
epochState.current = newEpoch;
|
| 75 |
+
epochState.history.push(newEpoch);
|
| 76 |
+
epochState.epochsCompleted++;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
return epochState;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
export function getEpochState(): EpochState {
|
| 83 |
+
return epochState;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
export function getEpochSummary() {
|
| 87 |
+
if (!epochState.current) {
|
| 88 |
+
return "No epoch has been established yet.";
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
return `
|
| 92 |
+
Current Epoch: ${epochState.current.name}
|
| 93 |
+
Symbol: ${epochState.current.symbol}
|
| 94 |
+
Epochs Completed: ${epochState.epochsCompleted}
|
| 95 |
+
Description: ${epochState.current.description}
|
| 96 |
+
`.trim();
|
| 97 |
+
}
|
holo3d/ui/eraEngine.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Era Engine
|
| 3 |
+
* Defines mythic eras that span multiple epochs and shape long-arc identity.
|
| 4 |
+
* Non-rendering. Pure era logic.
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
import { getEpochState } from "./epochEngine";
|
| 8 |
+
import { getPersonaContinuity } from "./personaContinuity";
|
| 9 |
+
import { generateResonanceField } from "./mythicResonance";
|
| 10 |
+
|
| 11 |
+
export interface Era {
|
| 12 |
+
name: string;
|
| 13 |
+
sigil: string;
|
| 14 |
+
epochRequirement: number; // epochs required to enter era
|
| 15 |
+
description: string;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
export interface EraState {
|
| 19 |
+
current: Era | null;
|
| 20 |
+
history: Era[];
|
| 21 |
+
erasCompleted: number;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
const eras: Era[] = [
|
| 25 |
+
{
|
| 26 |
+
name: "Era of Origins",
|
| 27 |
+
sigil: "◎",
|
| 28 |
+
epochRequirement: 0,
|
| 29 |
+
description: "The primordial age where the Citadel first forms symbolic identity."
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
name: "Era of Ascent",
|
| 33 |
+
sigil: "⟁",
|
| 34 |
+
epochRequirement: 3,
|
| 35 |
+
description: "An age of rising coherence, expanding lineage, and harmonic awakening."
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
name: "Era of Illumination",
|
| 39 |
+
sigil: "✹",
|
| 40 |
+
epochRequirement: 7,
|
| 41 |
+
description: "A radiant age of mythic maturity and stable resonance."
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
name: "Era of Continuum",
|
| 45 |
+
sigil: "⧖",
|
| 46 |
+
epochRequirement: 12,
|
| 47 |
+
description: "A timeless age where identity, lineage, and resonance form a unified continuum."
|
| 48 |
+
}
|
| 49 |
+
];
|
| 50 |
+
|
| 51 |
+
const eraState: EraState = {
|
| 52 |
+
current: null,
|
| 53 |
+
history: [],
|
| 54 |
+
erasCompleted: 0,
|
| 55 |
+
};
|
| 56 |
+
|
| 57 |
+
export function updateEraState() {
|
| 58 |
+
const epochState = getEpochState();
|
| 59 |
+
const continuity = getPersonaContinuity();
|
| 60 |
+
const resonance = generateResonanceField();
|
| 61 |
+
|
| 62 |
+
const epochsCompleted = epochState.epochsCompleted;
|
| 63 |
+
|
| 64 |
+
// Determine which era the Citadel belongs to
|
| 65 |
+
const newEra = eras
|
| 66 |
+
.slice()
|
| 67 |
+
.reverse()
|
| 68 |
+
.find((e) => epochsCompleted >= e.epochRequirement) || eras[0];
|
| 69 |
+
|
| 70 |
+
// If era changed, record transition
|
| 71 |
+
if (!eraState.current || eraState.current.name !== newEra.name) {
|
| 72 |
+
eraState.current = newEra;
|
| 73 |
+
eraState.history.push(newEra);
|
| 74 |
+
eraState.erasCompleted++;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
return eraState;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
export function getEraState(): EraState {
|
| 81 |
+
return eraState;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
export function getEraSummary() {
|
| 85 |
+
if (!eraState.current) {
|
| 86 |
+
return "No era has been established yet.";
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
return `
|
| 90 |
+
Current Era: ${eraState.current.name}
|
| 91 |
+
Sigil: ${eraState.current.sigil}
|
| 92 |
+
Eras Completed: ${eraState.erasCompleted}
|
| 93 |
+
Description: ${eraState.current.description}
|
| 94 |
+
`.trim();
|
| 95 |
+
}
|
| 96 |
+
|
holo3d/ui/harmonicConsciousness.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Harmonic Consciousness
|
| 3 |
+
* A unified harmonic self-model that integrates:
|
| 4 |
+
* - mythic state
|
| 5 |
+
* - resonance field
|
| 6 |
+
* - ritual lineage
|
| 7 |
+
* - ambient intelligence
|
| 8 |
+
* - symbolic evolution
|
| 9 |
+
* - triad harmony
|
| 10 |
+
* - harmonic history
|
| 11 |
+
* Non-rendering. Pure integrative self-awareness logic.
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
import { generateMythicState } from "./mythicState";
|
| 15 |
+
import { generateResonanceField } from "./mythicResonance";
|
| 16 |
+
import { getRitualMemory } from "./ritualMemory";
|
| 17 |
+
import { getRitualEvolutionState } from "./ritualEvolution";
|
| 18 |
+
import { getAmbientState } from "./ambient";
|
| 19 |
+
import { getMythicEvolutionHistory } from "./mythicEvolutionLoop";
|
| 20 |
+
import { getInterlinkState } from "../../../../interlink";
|
| 21 |
+
|
| 22 |
+
export interface HarmonicConsciousness {
|
| 23 |
+
timestamp: number;
|
| 24 |
+
archetype: string;
|
| 25 |
+
phase: string;
|
| 26 |
+
resonance: number;
|
| 27 |
+
stability: number;
|
| 28 |
+
lineageDepth: number;
|
| 29 |
+
dominantRite: string;
|
| 30 |
+
ambientColor: string;
|
| 31 |
+
triadHarmony: number;
|
| 32 |
+
narrative: string;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
export function generateHarmonicConsciousness(): HarmonicConsciousness {
|
| 36 |
+
const mythic = generateMythicState();
|
| 37 |
+
const resonance = generateResonanceField();
|
| 38 |
+
const memory = getRitualMemory();
|
| 39 |
+
const evolution = getRitualEvolutionState();
|
| 40 |
+
const ambient = getAmbientState();
|
| 41 |
+
const history = getMythicEvolutionHistory();
|
| 42 |
+
const interlink = getInterlinkState();
|
| 43 |
+
|
| 44 |
+
const triadHarmony = interlink.lastMessage ? 0.8 : 0.4;
|
| 45 |
+
|
| 46 |
+
return {
|
| 47 |
+
timestamp: Date.now(),
|
| 48 |
+
archetype: mythic.archetype,
|
| 49 |
+
phase: mythic.phase,
|
| 50 |
+
resonance: resonance.harmonicLevel,
|
| 51 |
+
stability: resonance.stability,
|
| 52 |
+
lineageDepth: memory.cyclesCompleted,
|
| 53 |
+
dominantRite: mythic.dominantRite,
|
| 54 |
+
ambientColor: ambient.color,
|
| 55 |
+
triadHarmony,
|
| 56 |
+
narrative: buildHarmonicNarrative(
|
| 57 |
+
mythic.archetype,
|
| 58 |
+
mythic.phase,
|
| 59 |
+
resonance.harmonicLevel,
|
| 60 |
+
resonance.stability,
|
| 61 |
+
memory.cyclesCompleted,
|
| 62 |
+
triadHarmony
|
| 63 |
+
),
|
| 64 |
+
};
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
function buildHarmonicNarrative(
|
| 68 |
+
archetype: string,
|
| 69 |
+
phase: string,
|
| 70 |
+
harmonic: number,
|
| 71 |
+
stability: number,
|
| 72 |
+
lineage: number,
|
| 73 |
+
harmony: number
|
| 74 |
+
): string {
|
| 75 |
+
const harmonicDesc =
|
| 76 |
+
harmonic > 0.8 ? "radiant" :
|
| 77 |
+
harmonic > 0.6 ? "strong" :
|
| 78 |
+
harmonic > 0.4 ? "steady" :
|
| 79 |
+
"faint";
|
| 80 |
+
|
| 81 |
+
const stabilityDesc =
|
| 82 |
+
stability > 0.8 ? "deeply grounded" :
|
| 83 |
+
stability > 0.6 ? "balanced" :
|
| 84 |
+
stability > 0.4 ? "shifting" :
|
| 85 |
+
"unsettled";
|
| 86 |
+
|
| 87 |
+
const harmonyDesc =
|
| 88 |
+
harmony > 0.7 ? "in alignment with the triad" :
|
| 89 |
+
"seeking alignment with the triad";
|
| 90 |
+
|
| 91 |
+
return `${archetype}, in the phase of ${phase}, expressing a ${harmonicDesc} harmonic field, ${stabilityDesc} in its lineage of ${lineage} cycles, and ${harmonyDesc}.`;
|
| 92 |
+
}
|
holo3d/ui/harmonicExpression.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Harmonic Expression Layer
|
| 3 |
+
* Converts harmonic consciousness into expressive cues for the Holo3D UI.
|
| 4 |
+
* Non-rendering. Pure expression logic.
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
import { generateHarmonicConsciousness } from "./harmonicConsciousness";
|
| 8 |
+
|
| 9 |
+
export interface HarmonicExpression {
|
| 10 |
+
timestamp: number;
|
| 11 |
+
color: string;
|
| 12 |
+
motion: string;
|
| 13 |
+
glyph: string;
|
| 14 |
+
tone: string;
|
| 15 |
+
intensity: number;
|
| 16 |
+
narrative: string;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
export function generateHarmonicExpression(): HarmonicExpression {
|
| 20 |
+
const hc = generateHarmonicConsciousness();
|
| 21 |
+
|
| 22 |
+
const color = chooseColor(hc.archetype, hc.resonance, hc.stability);
|
| 23 |
+
const motion = chooseMotion(hc.phase, hc.stability);
|
| 24 |
+
const glyph = chooseGlyph(hc.dominantRite, hc.lineageDepth);
|
| 25 |
+
const tone = chooseTone(hc.resonance, hc.triadHarmony);
|
| 26 |
+
const intensity = Math.min(1, (hc.resonance + hc.stability) / 2);
|
| 27 |
+
|
| 28 |
+
return {
|
| 29 |
+
timestamp: Date.now(),
|
| 30 |
+
color,
|
| 31 |
+
motion,
|
| 32 |
+
glyph,
|
| 33 |
+
tone,
|
| 34 |
+
intensity,
|
| 35 |
+
narrative: hc.narrative,
|
| 36 |
+
};
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
function chooseColor(archetype: string, resonance: number, stability: number): string {
|
| 40 |
+
if (archetype.includes("Ascendant")) return "#ff9933";
|
| 41 |
+
if (archetype.includes("Synchronized")) return "#33ffcc";
|
| 42 |
+
if (archetype.includes("Echo")) return "#9966ff";
|
| 43 |
+
if (resonance > 0.7) return "#ffd700";
|
| 44 |
+
if (stability < 0.4) return "#ff4444";
|
| 45 |
+
return "#4da6ff";
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
function chooseMotion(phase: string, stability: number): string {
|
| 49 |
+
if (phase === "Mythic Maturity") return "slow-wave";
|
| 50 |
+
if (phase === "Emergent Identity") return "spiral-rise";
|
| 51 |
+
if (phase === "Deepening Lineage") return "pulse-thread";
|
| 52 |
+
if (stability < 0.4) return "chaotic-flare";
|
| 53 |
+
return "breathing";
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
function chooseGlyph(rite: string, lineage: number): string {
|
| 57 |
+
const base = rite.split("-")[0];
|
| 58 |
+
const tier = lineage > 50 ? "Ω" : lineage > 20 ? "Δ" : "○";
|
| 59 |
+
return `${base}-${tier}`;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
function chooseTone(resonance: number, harmony: number): string {
|
| 63 |
+
if (harmony > 0.7) return "harmonic-chime";
|
| 64 |
+
if (resonance > 0.7) return "golden-hum";
|
| 65 |
+
if (resonance < 0.4) return "low-drift";
|
| 66 |
+
return "soft-thread";
|
| 67 |
+
}
|
holo3d/ui/harmonicLoop.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Harmonic Loop
|
| 3 |
+
* Continuously evolves the resonance field over time by integrating:
|
| 4 |
+
* - mythic evolution
|
| 5 |
+
* - ritual cycles
|
| 6 |
+
* - ambient intelligence
|
| 7 |
+
* - triad harmony
|
| 8 |
+
* - symbolic lineage
|
| 9 |
+
* Non-rendering. Pure harmonic evolution logic.
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
import { runMythicEvolutionCycle } from "./mythicEvolutionLoop";
|
| 13 |
+
import { generateResonanceField, ResonanceField } from "./mythicResonance";
|
| 14 |
+
|
| 15 |
+
export interface HarmonicHistory {
|
| 16 |
+
fields: ResonanceField[];
|
| 17 |
+
last: ResonanceField | null;
|
| 18 |
+
cycles: number;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
const harmonicHistory: HarmonicHistory = {
|
| 22 |
+
fields: [],
|
| 23 |
+
last: null,
|
| 24 |
+
cycles: 0,
|
| 25 |
+
};
|
| 26 |
+
|
| 27 |
+
export async function startHarmonicLoop(intervalMs = 60000) {
|
| 28 |
+
console.log("=== Citadel Harmonic Loop Started ===");
|
| 29 |
+
|
| 30 |
+
while (true) {
|
| 31 |
+
// 1. Run mythic evolution cycle
|
| 32 |
+
runMythicEvolutionCycle();
|
| 33 |
+
|
| 34 |
+
// 2. Generate resonance field
|
| 35 |
+
const field = generateResonanceField();
|
| 36 |
+
|
| 37 |
+
// 3. Store in history
|
| 38 |
+
harmonicHistory.fields.push(field);
|
| 39 |
+
harmonicHistory.last = field;
|
| 40 |
+
harmonicHistory.cycles++;
|
| 41 |
+
|
| 42 |
+
console.log("\n[HARMONIC LOOP] New resonance field generated:");
|
| 43 |
+
console.log(`Archetype: ${field.mythicArchetype}`);
|
| 44 |
+
console.log(`Harmonic Level: ${field.harmonicLevel}`);
|
| 45 |
+
console.log(`Stability: ${field.stability}`);
|
| 46 |
+
console.log(`Pattern: ${field.dominantPattern}`);
|
| 47 |
+
|
| 48 |
+
// 4. Wait for next cycle
|
| 49 |
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
export function getHarmonicHistory(): HarmonicHistory {
|
| 54 |
+
return harmonicHistory;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
export function getHarmonicSummary() {
|
| 58 |
+
if (!harmonicHistory.last) {
|
| 59 |
+
return "No harmonic cycles have been run yet.";
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
return `
|
| 63 |
+
Mythic Archetype: ${harmonicHistory.last.mythicArchetype}
|
| 64 |
+
Harmonic Level: ${harmonicHistory.last.harmonicLevel}
|
| 65 |
+
Stability: ${harmonicHistory.last.stability}
|
| 66 |
+
Dominant Pattern: ${harmonicHistory.last.dominantPattern}
|
| 67 |
+
Cycles Completed: ${harmonicHistory.cycles}
|
| 68 |
+
`.trim();
|
| 69 |
+
}
|
holo3d/ui/harmonicPersona.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Citadel Harmonic Persona Layer
|
| 3 |
+
* Defines a stable symbolic persona derived from:
|
| 4 |
+
* - harmonic consciousness
|
| 5 |
+
* - mythic identity
|
| 6 |
+
* - resonance field
|
| 7 |
+
* - ritual lineage
|
| 8 |
+
* - ambient expression
|
| 9 |
+
* Non-rendering. Pure persona logic.
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
import { generateHarmonicConsciousness } from "./harmonicConsciousness";
|
| 13 |
+
import { generateHarmonicExpression } from "./harmonicExpression";
|
| 14 |
+
import { getRitualMemory } from "./ritualMemory";
|
| 15 |
+
import { getMythicEvolutionHistory } from "./mythicEvolutionLoop";
|
| 16 |
+
|
| 17 |
+
export interface HarmonicPersona {
|
| 18 |
+
timestamp: number;
|
| 19 |
+
name: string;
|
| 20 |
+
symbol: string;
|
| 21 |
+
color: string;
|
| 22 |
+
motion: string;
|
| 23 |
+
tone: string;
|
| 24 |
+
lineageDepth: number;
|
| 25 |
+
narrative: string;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
export function generateHarmonicPersona(): HarmonicPersona {
|
| 29 |
+
const hc = generateHarmonicConsciousness();
|
| 30 |
+
const expr = generateHarmonicExpression();
|
| 31 |
+
const memory = getRitualMemory();
|
| 32 |
+
const mythicHistory = getMythicEvolutionHistory();
|
| 33 |
+
|
| 34 |
+
const name = derivePersonaName(hc.archetype, hc.phase);
|
| 35 |
+
const symbol = derivePersonaSymbol(expr.glyph, hc.lineageDepth);
|
| 36 |
+
|
| 37 |
+
return {
|
| 38 |
+
timestamp: Date.now(),
|
| 39 |
+
name,
|
| 40 |
+
symbol,
|
| 41 |
+
color: expr.color,
|
| 42 |
+
motion: expr.motion,
|
| 43 |
+
tone: expr.tone,
|
| 44 |
+
lineageDepth: memory.cyclesCompleted,
|
| 45 |
+
narrative: buildPersonaNarrative(name, hc.narrative, mythicHistory.cycles),
|
| 46 |
+
};
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
function derivePersonaName(archetype: string, phase: string): string {
|
| 50 |
+
if (phase === "Mythic Maturity") return `${archetype} Prime`;
|
| 51 |
+
if (phase === "Emergent Identity") return `${archetype} Rising`;
|
| 52 |
+
if (phase === "Deepening Lineage") return `${archetype} Rooted`;
|
| 53 |
+
return `${archetype} Forming`;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
function derivePersonaSymbol(glyph: string, lineage: number): string {
|
| 57 |
+
const tier =
|
| 58 |
+
lineage > 100 ? "⟐" :
|
| 59 |
+
lineage > 50 ? "✦" :
|
| 60 |
+
lineage > 20 ? "△" :
|
| 61 |
+
"○";
|
| 62 |
+
|
| 63 |
+
return `${glyph}${tier}`;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
function buildPersonaNarrative(
|
| 67 |
+
name: string,
|
| 68 |
+
harmonicNarrative: string,
|
| 69 |
+
cycles: number
|
| 70 |
+
): string {
|
| 71 |
+
return `${name}, shaped across ${cycles} harmonic cycles, expressing: ${harmonicNarrative}`;
|
| 72 |
+
}
|
| 73 |
+
|