feat: Phase 3 — wire panel modules (heatmap, agent-board, dual-brain, LoRA, sovereignty, earth)
- core/theme.js: export NEXUS with full NEXUS.theme.* properties used by all 6 panels - core/ticker.js: add subscribe() convenience export so panels can self-register - data/gitea.js: also write state.agentStatus, activeAgentCount, zoneIntensity, commits, commitHashes - data/loaders.js: also write state.sovereignty - data/bitcoin.js: also write state.blockHeight, lastBlockHeight, newBlockDetected, starPulseIntensity - data/weather.js: also write state.weather - app.js: import + init all 6 panel modules, bootstrap data polling, call globalTicker.tick() Fixes #412 Refs #409 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// modules/data/bitcoin.js — Blockstream block height polling
|
||||
// Writes to S: lastKnownBlockHeight, _starPulseIntensity
|
||||
// Writes to S: lastKnownBlockHeight, _starPulseIntensity (legacy)
|
||||
// Writes to state: blockHeight, lastBlockHeight, newBlockDetected, starPulseIntensity
|
||||
import { S } from '../state.js';
|
||||
import { state } from '../core/state.js';
|
||||
|
||||
const BITCOIN_REFRESH_MS = 60 * 1000;
|
||||
|
||||
@@ -11,12 +13,15 @@ export async function fetchBlockHeight() {
|
||||
const height = parseInt(await res.text(), 10);
|
||||
if (isNaN(height)) return null;
|
||||
|
||||
const isNew = S.lastKnownBlockHeight !== null && height > S.lastKnownBlockHeight;
|
||||
const prev = S.lastKnownBlockHeight;
|
||||
const isNew = prev !== null && height > prev;
|
||||
S.lastKnownBlockHeight = height;
|
||||
if (isNew) S._starPulseIntensity = 1.0;
|
||||
|
||||
if (isNew) {
|
||||
S._starPulseIntensity = 1.0;
|
||||
}
|
||||
state.blockHeight = height;
|
||||
state.lastBlockHeight = prev || 0;
|
||||
state.newBlockDetected = isNew;
|
||||
if (isNew) state.starPulseIntensity = 1.0;
|
||||
|
||||
return { height, isNewBlock: isNew };
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user