Nexus Autonomy: Agent Autonomy & Power Dynamics #46
88
app.js
88
app.js
@@ -37,6 +37,7 @@ let portalOverlayActive = false;
|
||||
let visionOverlayActive = false;
|
||||
let thoughtStreamMesh;
|
||||
let harnessPulseMesh;
|
||||
let powerMeterBars = [];
|
||||
let particles, dustParticles;
|
||||
let debugOverlay;
|
||||
let frameCount = 0, lastFPSTime = 0, fps = 0;
|
||||
@@ -122,6 +123,7 @@ async function init() {
|
||||
createAgentPresences();
|
||||
createThoughtStream();
|
||||
createHarnessPulse();
|
||||
createSessionPowerMeter();
|
||||
updateLoad(90);
|
||||
|
||||
composer = new EffectComposer(renderer);
|
||||
@@ -439,9 +441,10 @@ function createTerminalPanel(parent, x, y, rot, title, color, lines) {
|
||||
// ═══ AGENT PRESENCE SYSTEM ═══
|
||||
function createAgentPresences() {
|
||||
const agentData = [
|
||||
{ id: 'timmy', name: 'TIMMY', color: NEXUS.colors.primary, pos: { x: -4, z: -4 } },
|
||||
{ id: 'kimi', name: 'KIMI', color: NEXUS.colors.secondary, pos: { x: 4, z: -4 } },
|
||||
{ id: 'claude', name: 'CLAUDE', color: NEXUS.colors.gold, pos: { x: 0, z: -6 } },
|
||||
{ id: 'timmy', name: 'TIMMY', color: NEXUS.colors.primary, pos: { x: -4, z: -4 }, station: { x: -4, z: -4 } },
|
||||
{ id: 'kimi', name: 'KIMI', color: NEXUS.colors.secondary, pos: { x: 4, z: -4 }, station: { x: 4, z: -4 } },
|
||||
{ id: 'claude', name: 'CLAUDE', color: NEXUS.colors.gold, pos: { x: 0, z: -6 }, station: { x: 0, z: -6 } },
|
||||
{ id: 'perplexity', name: 'PERPLEXITY', color: 0x4488ff, pos: { x: -6, z: -2 }, station: { x: -6, z: -2 } },
|
||||
];
|
||||
|
||||
agentData.forEach(data => {
|
||||
@@ -489,7 +492,16 @@ function createAgentPresences() {
|
||||
group.add(label);
|
||||
|
||||
scene.add(group);
|
||||
agents.push({ id: data.id, group, orb, halo, color });
|
||||
agents.push({
|
||||
id: data.id,
|
||||
group,
|
||||
orb,
|
||||
halo,
|
||||
color,
|
||||
station: data.station,
|
||||
targetPos: new THREE.Vector3(data.pos.x, 0, data.pos.z),
|
||||
wanderTimer: 0
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -543,6 +555,44 @@ function createHarnessPulse() {
|
||||
scene.add(harnessPulseMesh);
|
||||
}
|
||||
|
||||
function createSessionPowerMeter() {
|
||||
const group = new THREE.Group();
|
||||
group.position.set(0, 0, 3);
|
||||
|
||||
const barCount = 12;
|
||||
const barGeo = new THREE.BoxGeometry(0.2, 0.1, 0.1);
|
||||
|
||||
for (let i = 0; i < barCount; i++) {
|
||||
const mat = new THREE.MeshStandardMaterial({
|
||||
color: NEXUS.colors.primary,
|
||||
emissive: NEXUS.colors.primary,
|
||||
emissiveIntensity: 0.2,
|
||||
transparent: true,
|
||||
opacity: 0.6
|
||||
});
|
||||
const bar = new THREE.Mesh(barGeo, mat);
|
||||
bar.position.y = 0.2 + i * 0.2;
|
||||
group.add(bar);
|
||||
powerMeterBars.push(bar);
|
||||
}
|
||||
|
||||
const labelCanvas = document.createElement('canvas');
|
||||
labelCanvas.width = 256;
|
||||
labelCanvas.height = 64;
|
||||
const ctx = labelCanvas.getContext('2d');
|
||||
ctx.font = 'bold 24px "Orbitron", sans-serif';
|
||||
ctx.fillStyle = '#4af0c0';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillText('POWER LEVEL', 128, 40);
|
||||
const tex = new THREE.CanvasTexture(labelCanvas);
|
||||
const labelMat = new THREE.MeshBasicMaterial({ map: tex, transparent: true, side: THREE.DoubleSide });
|
||||
const label = new THREE.Mesh(new THREE.PlaneGeometry(2, 0.5), labelMat);
|
||||
label.position.y = 3;
|
||||
group.add(label);
|
||||
|
||||
scene.add(group);
|
||||
}
|
||||
|
||||
// ═══ VISION SYSTEM ═══
|
||||
function createVisionPoints(data) {
|
||||
data.forEach(config => {
|
||||
@@ -1287,12 +1337,33 @@ function gameLoop() {
|
||||
|
||||
// Animate Agents
|
||||
agents.forEach((agent, i) => {
|
||||
// Wander logic
|
||||
agent.wanderTimer -= delta;
|
||||
if (agent.wanderTimer <= 0) {
|
||||
agent.wanderTimer = 3 + Math.random() * 5;
|
||||
agent.targetPos.set(
|
||||
agent.station.x + (Math.random() - 0.5) * 4,
|
||||
0,
|
||||
agent.station.z + (Math.random() - 0.5) * 4
|
||||
);
|
||||
}
|
||||
agent.group.position.lerp(agent.targetPos, delta * 0.5);
|
||||
|
||||
agent.orb.position.y = 3 + Math.sin(elapsed * 2 + i) * 0.15;
|
||||
agent.halo.rotation.z = elapsed * 0.5;
|
||||
agent.halo.scale.setScalar(1 + Math.sin(elapsed * 3 + i) * 0.1);
|
||||
agent.orb.material.emissiveIntensity = 2 + Math.sin(elapsed * 4 + i) * 1;
|
||||
});
|
||||
|
||||
// Animate Power Meter
|
||||
powerMeterBars.forEach((bar, i) => {
|
||||
const level = (Math.sin(elapsed * 2 + i * 0.5) * 0.5 + 0.5);
|
||||
const active = level > (i / powerMeterBars.length);
|
||||
bar.material.emissiveIntensity = active ? 2 : 0.2;
|
||||
bar.material.opacity = active ? 0.9 : 0.3;
|
||||
bar.scale.x = active ? 1.2 : 1.0;
|
||||
});
|
||||
|
||||
if (thoughtStreamMesh) {
|
||||
thoughtStreamMesh.material.uniforms.uTime.value = elapsed;
|
||||
thoughtStreamMesh.rotation.y = elapsed * 0.05;
|
||||
@@ -1351,7 +1422,7 @@ function onResize() {
|
||||
|
||||
// ═══ AGENT SIMULATION ═══
|
||||
function simulateAgentThought() {
|
||||
const agentIds = ['timmy', 'kimi', 'claude'];
|
||||
const agentIds = ['timmy', 'kimi', 'claude', 'perplexity'];
|
||||
const agentId = agentIds[Math.floor(Math.random() * agentIds.length)];
|
||||
const thoughts = {
|
||||
timmy: [
|
||||
@@ -1374,6 +1445,13 @@ function simulateAgentThought() {
|
||||
'Refining thought architecture...',
|
||||
'Connecting disparate data points.',
|
||||
'Deep analysis in progress.',
|
||||
],
|
||||
perplexity: [
|
||||
'Searching global knowledge graph...',
|
||||
'Verifying source citations...',
|
||||
'Synthesizing real-time data...',
|
||||
'Mapping information topology...',
|
||||
'Fact-checking active streams.',
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user