Adds an opt-in agent integration surface that lets a trusted external
tool (running as the same logged-in user) drive the running WWV browser
session — fly the globe, toggle layers, focus entities — by POSTing
JSON actions to the server, which fans them out over SSE to every
connected browser tab belonging to that user.
The motivating use case is an MCP server (a Model Context Protocol
adapter): an LLM agent calls a tool like `globe_fly_to({lat, lon})`,
the MCP server posts to `/api/agent/publish`, the browser subscriber
re-emits the action onto the existing client-side `dataBus`, and the
React + Cesium app handles it the same way it would handle any UI
button click. Read-only camera / engine queries already work via the
existing REST surface — this PR adds the missing write path.
What's added:
- `src/lib/agent/bus.ts` — process-local AgentBus singleton, scoped
per user. Subscriptions live in a `Map<userId, Map<connId, sub>>`
so user A's publish never reaches user B's stream, even though
both run on the same Node process.
- `src/app/api/agent/stream/route.ts` — SSE channel. Auth-gated. Sends
initial `:connected` + `retry:3000` directives and a `:hb` heartbeat
every 25s so intermediary proxies (Caddy, Nginx, CDNs) don't tear
down a "stalled" connection.
- `src/app/api/agent/publish/route.ts` — POST endpoint. Accepts JSON
AgentAction shapes (`fly_to`, `face_towards`, `layer_toggle`,
`highlight_layer`, `select_entity`, `ping`), broadcasts only to the
publishing user's bus bucket. Returns `{delivered, subscribers}` so
the caller knows how many tabs received the command.
- `src/components/layout/AgentBusSubscriber.tsx` — browser EventSource
client. Re-emits received actions onto `dataBus` (`cameraGoTo`,
`cameraFaceTowards`, `layerToggled`, `entitySelected`) — every plugin
is already listening on those channels, so no plugin changes needed.
- `AppShell.tsx` — mounts `AgentBusSubscriber` next to the existing
`DataBusSubscriber`. Two lines.
- `src/app/api/build/route.ts` — `/api/build` returns build id +
timestamp + public flag state. Pairs with a one-line console.log
the subscriber prints on mount so a stale-bundle / config-mismatch
is visible at a glance instead of looking like a feature regression.
Default off via `NEXT_PUBLIC_WWV_AGENT_BUS_ENABLED=true`. An unintended
deployment doesn't open a remote-control channel for users who didn't
opt in.
What's changed in the Dockerfile:
- Adds ARG declarations for the new vars (`NEXT_PUBLIC_WWV_AGENT_BUS_ENABLED`,
`NEXT_PUBLIC_WWV_BUILD_ID`, `NEXT_PUBLIC_WWV_BUILD_AT`).
- Stamps the build with millisecond-precision id + ISO timestamp
(`/app/.build-id`, `/app/.build-at`); both copied into the runner
stage for `/api/build` to read.
- Writes `/app/.env.production.local` from declared ARGs *before*
`next build` runs. Docker doesn't reliably promote ARGs into the
Node child-process environment for the build command, so
`process.env.NEXT_PUBLIC_*` references that previously inlined
through Webpack's DefinePlugin sometimes fell back to runtime
polyfill access (`tV.env.NEXT_PUBLIC_X`) that resolves to `undefined`
in the browser. Writing the env file is the documented Next.js path
and behaves the same on every host.
Default-off, no schema changes, no plugin changes, fully backwards-compatible
on operators who don't opt in.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- Migrated wwv-plugin-gps-jamming to local-plugins and fixed WebSocket payload handling (Patch)
- Migrated wwv-plugin-fortiguard to local-plugins and refactored API proxy fetch logic (Patch)
- Migrated wwv-plugin-nz-traffic-cameras to local-plugins (Patch)
- Cleaned up tutorial plugin wwv-plugin-iss from tree (Patch)
- Added scripts/migrate-plugin.mjs for automation (Patch)
This fixes visual bugs where active UI elements (filter chips, buttons, tabs) would lose their styling or become unreadable when hovered. Also bumps version to 2.5.4.
* feat(ui): add centralized theme tokens and light mode switcher
- Refactor: Moved hardcoded colors, borders, typography, and glass effects into centralized src/styles/theme-tokens.css (Patch)
- Feat: Implemented a robust Light/Dark mode switcher via Zustand and localStorage, persisting via data-theme attribute (Minor)
- Refactor: Updated globals.css and component-specific stylesheets to use centralized variables instead of hardcoded values (Patch)
* fix(feedback): use correct production webhook URL and add error toast on fetch failure
* feat(ui): major UI overhaul and video interactions
feat(ui): redesign WorldWideView user interface
feat(video): add zooming and panning to video window
fix(ui): resolve UI component contrast issues
fix(globe): correct Cesium globe layout shrinking issue
fix(interaction): restore globe interaction UI and time selection dropdown
- Refactor: Moved hardcoded colors, borders, typography, and glass effects into centralized src/styles/theme-tokens.css (Patch)
- Feat: Implemented a robust Light/Dark mode switcher via Zustand and localStorage, persisting via data-theme attribute (Minor)
- Refactor: Updated globals.css and component-specific stylesheets to use centralized variables instead of hardcoded values (Patch)
- fix(build): Add pnpm override for @spz-loader/core to 0.3.0 to bypass Octal escape sequences error during build
- feat(healthcheck): Add /api/health endpoint and HEALTHCHECK directive to Dockerfile and docker-compose.yml for Coolify monitoring
- refactor(build): Remove Sentry config from next.config.ts to avoid webpack plugin conflicts with wasm compilation
Wait for injectHostGlobals to complete before initializing MarketplaceSync. This fixes the 'React is not defined / __WWV_HOST__ is undefined' error when mounting the AppShell.
The `Build and push Docker image` step has `push: true` unconditionally,
but PRs from forks don't have write access to this org's GHCR namespace
(or to the GHA cache backing it). Every fork PR's CI run currently fails
with:
ERROR: failed to push ghcr.io/silvertakana/worldwideview:pr-NN:
denied: installation not allowed to Write organization package
This is the standard GitHub fork-security policy — without it any PR
opener could publish arbitrary tagged images to your registry. The
workflow's other concerns (verifying the Dockerfile compiles, exercising
build-time NEXT_PUBLIC_* arg plumbing, surfacing build failures) don't
require a push to do their job, so we just gate the push step.
Gate the push step on:
github.event_name != 'pull_request' # push to main / workflow_dispatch
|| pull_request.head.repo.full_name == github.repository # internal PR
Same gate on `cache-to` since GHA cache writes have the same permission
profile. Cache reads remain available to fork builds, so build times
benefit from your warm cache.
After this:
- push to main / dispatch: build + push as today
- PR from a branch inside this repo: build + push as today
- PR from a fork: build (verifies image), skip push (no 403)
Co-authored-by: Sapphire <sapphire@tiktokcoach>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
This removes the public/cesium/ files that were previously accidentally tracked, as they are copied locally by scripts/copy-cesium.mjs. Version bumped to 2.1.9 (Patch).
Dynamically import cesium and resium in hostGlobals to prevent server-side webpack from incorrectly bundling binary assets into the SSR template strings, which caused 'Octal escape sequences are not allowed in template strings'.