// modules/core/state.js — Shared reactive data bus // Data modules write here; visual modules read from here. // No module may call fetch() except those under modules/data/. export const state = { // Commit heatmap (written by data/gitea.js) zoneIntensity: {}, // { zoneName: [0..1], ... } commits: [], // raw commit objects (last N) commitHashes: [], // short hashes for matrix rain // Agent status (written by data/gitea.js) agentStatus: null, // { agents: Array } | null activeAgentCount: 0, // count of agents with status === 'working' // Weather (written by data/weather.js) weather: null, // { cloud_cover, precipitation, ... } | null // Bitcoin (written by data/bitcoin.js) blockHeight: 0, lastBlockHeight: 0, newBlockDetected: false, starPulseIntensity: 0, // Portal / sovereignty / SOUL (written by data/loaders.js) portals: [], // portal descriptor objects sovereignty: null, // { score, label, assessment_type } | null soulMd: '', // raw SOUL.md text // Computed helpers totalActivity() { const vals = Object.values(this.zoneIntensity); if (vals.length === 0) return 0; return vals.reduce((s, v) => s + v, 0) / vals.length; }, };