{
  "markdown": "# SweK_Engine v3939 -- complete archive\n\nThe single source of truth: **WebGL engine + Node ai-bridge + listener + the Home\nAssistant integration + the ship/verify toolchain**, in one repository. The\nversioned zip (`SweK_Engine_vNNNN.zip`) is cut from this tree; the zip always\ncontains a single top-level folder named `SweK_Engine_vNNNN`, which is what the\nin-engine updater looks for.\n\nCurrent build: **v3939** (`WebGLEngine/main.js` `ENGINE_VERSION`). The brain\ncarries its own `BRAIN_BUILD` in `WebGLEngine/brain/brain.js`. Never reuse a\nversion number -- supersede forward.\n\n## System architecture (diagram)\n\nSee **`WebGLEngine/architecture.svg`** for a one-page diagram of the whole\nmulti-runtime system -- how the Excel/VBA simulation, the WebGL browser engine,\nthe Node `ai-bridge` (:8787), the PowerShell+Python KPop Listener, and Home\nAssistant fit together, plus the external services (Ollama, OSM/elevation APIs,\nTwitch/Discord, games). Open it directly in a browser, or from the tray\n**Open Engine -> Architecture diagram**.\n\n## Layout\n```\nSweK_Engine_v3939/\n├── WebGLEngine/      <- the engine. Bundles the Node bridge (ai-bridge/, :8787)\n│                        with haDiscovery.js wired in, the ha/ iframe-panel\n│                        installer, brain/ + brains/ (ai-brain, dashboard,\n│                        commander bridge pages), and tools/ship/ -- the\n│                        changelog, staleness, knowledge-index, status, verify\n│                        and gate toolchain that cuts each build.\n├── HomeAssistant/    <- add-on repo (ingress panel) + haDiscovery.js + wiring\n│                        docs + slim-build.mjs/manifest + modHAInstall.bas.\n├── KPop Listener/    <- the PowerShell listener set.\n├── PetFBI/           <- the pet-tracking app.\n├── TaskerBridge/     <- Android/Tasker side of the bridge.\n├── raycast-extension/<- Raycast commands for the engine.\n├── agent-skills/     <- packaged skills.\n├── cloud/            <- hosting/deploy scaffolding.\n├── diso_tools/       <- disassembly/inspection utilities.\n├── strict-libm/      <- the pinned-math shim used by determinism gates.\n├── Shared/           <- assets and code shared across runtimes.\n├── Root Utils/       <- SESSION_START.md and the operator scripts.\n└── docs/             <- long-form notes.\n```\n\nLaunchers at the root: `START_SweK_LATEST.bat` / `START_NODE_Engine.bat`\n(Windows), `Start Mac SweK Engine.command` / `make_Mac_SweK_Runnable.sh` (macOS),\n`_SETUP.bat` for a first run.\n\n## Build a workbook from scratch (VBASync)\n> The exploded `VBAEngineCore/` and `VBAVoxelEngine/` module folders are NOT in\n> this repository -- they ship separately. This section is kept because the\n> import procedure is unchanged; point it at wherever you keep those folders.\n\n1. Open your VBASync blank workbook; enable **Trust access to the VBA project object model**.\n2. Import everything in `VBAEngineCore/` (or `VBAVoxelEngine/` for the other one).\n   `ThisWorkbook`/`Sheet*` are document modules — paste their code.\n3. Add to `ThisWorkbook`: `Private Sub Workbook_Open()` / `modInit.Init` / `End Sub`.\n4. On open you land on the **Demos** sheet (menu A); buttons: each demo, Rebuild,\n   Launch In-View Menu (B), List Demos, **Install HA Panel**.\n\n## Home Assistant — two install routes, one button\n`modHAInstall.InstallHAPanel` (the \"Install HA Panel\" sheet button) defaults to the\n**add-on (ingress)** route: it opens the \"My Home Assistant\" redirect to add the\nadd-on repository, then you click Install/Start in the store. Self-contained, no\nSamba, no YAML, HA handles auth/TLS. (`InstallHAPanelIframe` runs the engine's\nexisting `ha/install.ps1` instead — the panel_iframe-over-Samba route, no GitHub\nrepo needed.)\n\nSet `HA_ADDON_REPO_URL` in `modHAInstall.bas` to your published add-on repo. For\nzero-touch, also set `HA_BASE_URL` + a long-lived `HA_TOKEN`.\n\n## Engine telemetry as HA entities (no ESPHome emulation)\n`WebGLEngine/ai-bridge/haDiscovery.js` publishes MQTT discovery so the transmit\nengine shows up in HA as a device: Engine Online, Tick, Enemies, Player Health,\nFPS, Scene, Directives, WS Subscribers, plus solar/energy (Solar Power, Solar\nEnergy Today, Grid Power, Battery Level). Wire it per `HomeAssistant/HA_MQTT_WIRING.md`\n(two lines in server.js + `HA_MQTT=mqtt://broker`). Adjust the solar field paths in\n`haDiscovery.js` (`pick(...)`) to match your real payload.\n\n## Delivery-mode slim build\n`node HomeAssistant/slim-build.mjs` copies the allowlisted subset of `WebGLEngine/`\n(per `slim.manifest.json`) into the add-on's `www/`, rewriting absolute asset paths\nto relative for ingress. The full engine stays intact in the repo; HA gets the trim.\nTune the include/exclude lists to the minimum your panel needs.\n\n\n\n\n\n## Architecture: two workbooks + Shared\n- **VBAEngine/** — the full OpenGL/D3D11 engine workbook (everything render-side).\n- **VBAVoxelEngine/** — the workbook wired to the WebGL/voxel engine.\n- **Shared/** — functions BOTH want (bridge client, networking). Each workbook\n  is built by importing its own folder **plus** `Shared/`. They stay separate\n  projects (each declares its own GL/Win32 APIs; merging into one would create\n  duplicate `Public Declare`s / ambiguous-name errors), but shared utilities are\n  duplicated into both at import time via Shared/.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Changelog\n\nThe full round-by-round history — 286 entries, v566 to v3939 — is in\n[docs/CHANGELOG.md](docs/CHANGELOG.md). It lived here until v3941 and was 99.1% of this\nfile, which put the README past the size GitHub will render.\n\n\n## Honest status\nNothing here was compiled in the VBE, run against a live HA/Supervisor/MQTT broker,\nor rendered in a browser on my side. Verify in-app: the VBASync import + compile,\nthe add-on build/start + ingress panel, the MQTT device under Settings → Devices &\nServices → MQTT, and the slim build loading. Bloom/tint/polish still render only on\nthe D3D11 backend (see VBA_Engine_Checklist.md in the EngineCore bundle).\n\n",
  "bytes": 6092,
  "sha": "79747cf568c700497910670931c3a11b2d2adbdf6e0cb7f647298f2d487d826d",
  "repo_slug": "howdykeith/swek_engine",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/okf_howdykeith_swek_engine_webglengine_okf_i_6b20f6a3/readme"
}