[TSM.ID].[11031972] PXE : Platform X Ecosystem I [118 Module -LIVE-]
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export async function GET() {
|
||||
const cookieStore = await cookies();
|
||||
const tokenString = cookieStore.get("jumpa_token")?.value;
|
||||
|
||||
if (!tokenString) {
|
||||
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||
}
|
||||
|
||||
try {
|
||||
const payloadBase64 = tokenString.split(".")[1];
|
||||
const payloadBuffer = Buffer.from(payloadBase64, "base64");
|
||||
const user = JSON.parse(payloadBuffer.toString("utf-8"));
|
||||
return NextResponse.json(user);
|
||||
} catch {
|
||||
return NextResponse.json({ error: "Invalid Token" }, { status: 401 });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const ENGINE_FILE_PATH = path.join(process.cwd(), 'engine.json');
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
if (fs.existsSync(ENGINE_FILE_PATH)) {
|
||||
const data = fs.readFileSync(ENGINE_FILE_PATH, 'utf-8');
|
||||
const json = JSON.parse(data);
|
||||
return NextResponse.json({ engine: json.engine || 'xcu ULTRA' });
|
||||
}
|
||||
return NextResponse.json({ engine: 'xcu ULTRA' });
|
||||
} catch {
|
||||
return NextResponse.json({ engine: 'xcu ULTRA' });
|
||||
}
|
||||
}
|
||||
|
||||
export async function POST(req: Request) {
|
||||
try {
|
||||
const body = await req.json();
|
||||
if (body.engine === 'xcu ULTRA' || body.engine === 'XCU Ultra' || body.engine === 'XCU_DIRECTOR') {
|
||||
fs.writeFileSync(ENGINE_FILE_PATH, JSON.stringify({ engine: body.engine }), 'utf-8');
|
||||
return NextResponse.json({ success: true, engine: body.engine });
|
||||
}
|
||||
return NextResponse.json({ success: false, error: 'Invalid engine' }, { status: 400 });
|
||||
} catch {
|
||||
return NextResponse.json({ success: false, error: 'Failed to update engine' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export async function POST(req: Request) {
|
||||
try {
|
||||
const body = await req.json();
|
||||
const { roomName } = body;
|
||||
|
||||
if (!roomName) {
|
||||
return NextResponse.json({ error: "Room name is required" }, { status: 400 });
|
||||
}
|
||||
|
||||
// Call the PM2 Vanguard AI webhook
|
||||
// Assume Vanguard AI runs on localhost:3060 on Gamma
|
||||
const response = await fetch('http://127.0.0.1:3060/api/summon', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ roomName })
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errData = await response.json().catch(() => ({}));
|
||||
return NextResponse.json({ error: "Vanguard failed to join", details: errData }, { status: 500 });
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return NextResponse.json({ success: true, message: data.message });
|
||||
|
||||
} catch (err) {
|
||||
console.error("Summon Vanguard Error:", err);
|
||||
return NextResponse.json({ error: "Internal server error" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export async function POST() {
|
||||
// FASE 82: XCU Ultra Eradicated
|
||||
return NextResponse.json({ success: true, message: "Cohost privileges granted via XCU Protocol" });
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
// FASE 99: REAL-TIME QUANTUM TELEMETRY
|
||||
// Menghubungi Engine XCU Ultra di port 8081 (Alpha Node)
|
||||
const telemetryRes = await fetch('http://160.187.143.253:8081/api/v1/telemetry/snapshot', {
|
||||
next: { revalidate: 0 },
|
||||
cache: 'no-store'
|
||||
});
|
||||
|
||||
const telemetry = await telemetryRes.json();
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
rooms: [
|
||||
{
|
||||
id: "XCU_QUANTUM_CORE_ALPHA",
|
||||
status: telemetry.status || "BROADCASTING",
|
||||
name: "The Cassandra Matrix",
|
||||
type: "MoQ / WebTransport",
|
||||
participants: telemetry.active_connections || 0,
|
||||
metrics: {
|
||||
cpu: telemetry.cpu_usage,
|
||||
ram: telemetry.ram_usage,
|
||||
threats: telemetry.threats_blocked
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "SANDBOX_ALPHA",
|
||||
status: "ONLINE",
|
||||
name: "Quantum Sandbox",
|
||||
type: "XCU Ultra Engine",
|
||||
participants: Math.floor((telemetry.active_connections || 0) / 10)
|
||||
}
|
||||
]
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("XCU Engine Unreachable:", error);
|
||||
return NextResponse.json({ success: false, error: "Engine Offline" }, { status: 503 });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import crypto from 'crypto';
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
const room = req.nextUrl.searchParams.get("room");
|
||||
const username = req.nextUrl.searchParams.get("username");
|
||||
|
||||
if (!room || !username) {
|
||||
return NextResponse.json({ error: 'Missing "room" or "username" query parameter' }, { status: 400 });
|
||||
}
|
||||
|
||||
// FASE 82: THE GREAT PURGE
|
||||
// XCU Ultra has been eradicated. We now generate a pure XCU Quantum Token.
|
||||
const tokenPayload = {
|
||||
room,
|
||||
username,
|
||||
iat: Math.floor(Date.now() / 1000),
|
||||
exp: Math.floor(Date.now() / 1000) + 3600,
|
||||
matrix_id: crypto.randomUUID()
|
||||
};
|
||||
|
||||
const token = Buffer.from(JSON.stringify(tokenPayload)).toString('base64');
|
||||
|
||||
return NextResponse.json({
|
||||
token: `XCU_${token}`,
|
||||
engineStrategy: 'XCU_DIRECTOR'
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user