Compare commits

..
Author SHA1 Message Date
Antigravity AI 188eb4c949 fix: trigger vercel deployment after correcting git email 2026-05-08 12:19:22 +12:00
Antigravity AI 758f04d2a1 feat(wwv-cli): register package and npm publish commands 2026-05-08 11:26:54 +12:00
Antigravity AI 6632174b22 feat(wwv-cli): implement npm publish and marketplace webhook ping 2026-05-08 11:26:25 +12:00
Antigravity AI 8af0b99294 refactor(wwv-cli): rename publish to package for wwvpkg creation 2026-05-08 11:25:53 +12:00
Antigravity AI f3e30cecc5 feat(wwv-cli): implement publish command for wwvpkg creation 2026-05-08 11:07:09 +12:00
Antigravity AI b47835b4b2 feat(wwv-cli): implement dev command with vite and websockets 2026-05-08 11:06:21 +12:00
Antigravity AI 40aa245468 feat(wwv-cli): implement create command for scaffolding 2026-05-08 11:04:43 +12:00
Antigravity AI ef1a0cfa9f feat(wwv-cli): initialize cli package and entry point 2026-05-08 11:04:08 +12:00
Antigravity AI 2874d468d9 fix(ui): instantly follow cursor during panel resize without transition delay 2026-05-01 22:18:07 +12:00
Antigravity AI 6c2c58a6cf feat(ui): dynamic toggle button positioning during panel resize 2026-05-01 22:11:28 +12:00
Antigravity AI 5055d2c110 feat(ui): add resizable drag handles to both sidebars 2026-05-01 22:05:25 +12:00
Antigravity AI 44bacbaffd feat(ui): add layer search and persist right panel on deselection 2026-05-01 22:00:37 +12:00
SilvertakanaandAntigravity AI 7354b414e7 fix: Enlarge panel pull tab trigger areas (#46)
* fix: enlarge panel pull tab trigger areas for better touch targets

* fix: extend trigger area further inward towards panels

* fix(globe): increase mobile pinch zoom sensitivity [Patch]

- decrease _zoomFactor to 5 to make pinch zooming more responsive on touch devices [Patch]
- conditionally allow dev origins in next config [Patch]

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-29 23:59:52 +12:00
SilvertakanaandAntigravity AI 196380c0af fix: resolve GlitchTip crashes in core components (#44)
Co-authored-by: Antigravity AI <[email protected]>
2026-04-29 12:43:45 +12:00
SilvertakanaandAntigravity AI 06e919639d docs: comprehensive documentation overhaul and fixes (#42)
* docs(core): comprehensive documentation overhaul

* fix: resolve worktree paths dynamically via git CLI

* refactor(ui): temporarily disable demo ad strip

* fix(ui): redirect header logo and cleanup marketplace routes [Patch]

- make header logo a clickable link to landing page [Patch]

- cleanup marketplace routes and remove builtinPlugins [Patch]

* fix: silently drop malformed legacy built-in plugins from marketplace API validation to prevent console spam

* feat: add Sentry captureMessage for marketplace manifest validation errors to improve observability

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-29 12:00:58 +12:00
SilvertakanaandAntigravity AI f948f2aaab fix: silently drop legacy plugin manifest and add sentry logging (#41)
* fix: silently drop malformed legacy built-in plugins from marketplace API validation to prevent console spam

* feat: add Sentry captureMessage for marketplace manifest validation errors to improve observability

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-29 11:52:59 +12:00
SilvertakanaandAntigravity AI a5125dba7b docs: Comprehensive Documentation Overhaul (#39)
* docs(core): comprehensive documentation overhaul

* fix: resolve worktree paths dynamically via git CLI

* refactor(ui): temporarily disable demo ad strip

* fix(ui): redirect header logo and cleanup marketplace routes [Patch]

- make header logo a clickable link to landing page [Patch]

- cleanup marketplace routes and remove builtinPlugins [Patch]

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-28 23:39:20 +12:00
SilvertakanaandAntigravity AI 21a6c618c8 feat(marketplace): automate default plugin installation (#37)
- Added seedDefaultPlugins pipeline for idempotent initial hydration
- Migrated legacy hard-coded plugins from builtinPlugins.ts to defaultPlugins.ts
- Updated /api/marketplace/load to trigger seeding on fresh installs
- Added support for Antigravity worktrees in local test script
- (Minor version bump for new automated seeding feature)

Co-authored-by: Antigravity AI <[email protected]>
2026-04-23 18:06:06 +12:00
Antigravity AI 48a17bf3ee feat(sdk,docs): add vite static compiler export, overhaul documentation for plugin ecosystem [Minor]
- add wwvStaticCompiler to SDK vite/ subpath export [Minor]
- export createPluginContext and PluginContext type from SDK [Minor]
- update viteGlobals mapping for lucide-react [Patch]
- overhaul all docs/ for decoupled plugin development workflow [Minor]
- update README with new CLI-based plugin creation instructions [Minor]
- fix marketplace load route CORS and error handling [Patch]
- add test coverage for DeclarativePlugin edge cases [Patch]
- bump root to v1.18.0, SDK to v1.5.0
2026-04-23 10:19:17 +12:00
Antigravity AI 2e4c074f77 docs: add repository ecosystem section to readme 2026-04-22 18:17:35 +12:00
Antigravity AI e2108f5049 chore: add multi-repo workspace warnings to local-dev scripts 2026-04-22 18:10:24 +12:00
Antigravity AI b76067c0bb docs: add prerequisites recipe for docker and pnpm installation 2026-04-22 18:03:56 +12:00
Antigravity AI 04e614e1ed docs: add open-core data engine architecture bullet to readme 2026-04-22 17:59:03 +12:00
Antigravity AI 0d14a63246 docs: restore complete README structure and integrate new setup scripts 2026-04-22 17:57:29 +12:00
Antigravity AI 781fe9e790 feat: add local-dev shell and powershell scripts for contributor setup 2026-04-22 17:54:43 +12:00
Antigravity AI f0c2d81e18 fix: replace Here-String with array to fix PowerShell parsing issues 2026-04-22 17:51:18 +12:00
Antigravity AI f86b7d1e94 ci: add docker build and publish workflow to ghcr.io 2026-04-22 17:43:12 +12:00
Antigravity AI 28704e6fe1 feat: add native Windows PowerShell setup script for self-hosting 2026-04-22 17:39:50 +12:00
Antigravity AI 01e291a40e fix: improve docker existence check to catch WSL stub binaries 2026-04-22 17:37:44 +12:00
Antigravity AI 909e150b3d docs: add self-hosting docker compose instructions to readme 2026-04-22 17:34:40 +12:00
Antigravity AI 1fe3a77383 feat: add self-hosting setup scripts 2026-04-22 17:33:54 +12:00
Antigravity AI 998f98851e docs: update architecture docs for dual-repo data engine 2026-04-22 12:46:41 +12:00
Antigravity AI 9c51cdb8a2 feat: add engine split-routing with cloud fallback
When a local data engine is detected at localhost:5001, the frontend
fetches its /manifest to discover available seeders. Plugins with
local seeders route to the local engine; plugins without fall back
to the cloud engine at wss://dataengine.worldwideview.dev/stream.

This enables core contributors to develop with the public engine
while proprietary data sources continue working via the cloud.
2026-04-22 12:46:00 +12:00
Antigravity AI d74ae694a4 feat(cli): implement wwv-cli developer toolkit and finalize plugin bundling architecture
- feat(cli): Update developer workflows and quickstarts to utilize new \@worldwideview/cli\ toolchain externally (Minor)
- refactor(plugins): Standardize remaining internal manifests and loader implementations strictly to dynamic bundled format (Patch)
- docs(core): Revise README and development specs with \
px create-wwv-plugin\ workflows (Patch)
2026-04-19 15:15:04 +12:00
Antigravity AI ec4c89fe51 fix(core): untrack local dev sandbox plugins from git history [Patch]
- Add public/plugins to gitignore
- Untrack pre-compiled dev plugins
- Bump version
2026-04-19 12:45:35 +12:00
Antigravity AI 44e8ff9b70 fix(marketplace): coerce outdated plugin cards to bundle format on install 2026-04-18 23:50:06 +12:00
Antigravity AI cc90d3c2a3 fix(plugins): gracefully align internal plugin IDs with marketplace manifest IDs, update demo environment variables to hyphened identifier 2026-04-18 22:59:53 +12:00
Antigravity AI 0e6268bf72 fix(plugins): implement try/catch for PluginManager polling to prevent silent loading loops and surface errors 2026-04-18 22:37:57 +12:00
Antigravity AI 764af74d14 fix(core): resolve data engine routing and plugin validation errors [Patch]
- update hostGlobals to default to cloud URL and respect explicit engine env vars [Patch]
- fix Next.js CSP headers to allow dynamic CDN bundle loading from unpkg [Patch]
- add strict manifest validation handling and logging to plugin loader [Patch]
2026-04-18 20:58:13 +12:00
Silvertakana 29269c668a Merge pull request #36 from silvertakana/bug/35-fix-plugin-loading-errors
fix: fix plugin loading errors on Coolify and Localhost Dependencies
2026-04-18 18:49:45 +12:00
132 changed files with 3860 additions and 8597 deletions

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@ DATABASE_URL=file:./data/wwv.db
# Default plugins enabled on boot for demo edition
# Comma-separated list of plugin IDs
NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS=iranwarlive,satellite,gps_jamming
NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS=iranwarlive,satellite,gps-jamming
# Edition: "local" | "cloud" | "demo"
NEXT_PUBLIC_WWV_EDITION=local
@@ -12,4 +12,4 @@ NEXT_PUBLIC_WWV_EDITION=local
# [WARNING] NEVER commit real secrets here. Real secrets must ONLY go into .env.local!
AUTH_SECRET=changeme_d64c1f35b447da89cf6ed5a0988da1379b21904edb91a87c3f5a63942e3d23a4_changeme
+55
View File
@@ -0,0 +1,55 @@
name: Docker Build and Publish
on:
push:
branches: [ "main", "feat/docker-ci" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
+4
View File
@@ -80,9 +80,13 @@ packages/*/dist/
# Developmental scripts & temporary sandbox
/local-scripts/
/public/plugins-local/
# git worktrees
/.worktrees/
# proprietary extracted services
packages/wwv-data-engine/
# IDE workspace files
*.code-workspace
+24 -6
View File
@@ -101,11 +101,13 @@ Visibility Toggle → DataBusSubscriber subscribes to layer via WsClient
→ Store → EntityRenderer → Globe
```
Four plugin architectures exist:
1. **Static** — GeoJSON file in `public/data/`, loaded by `StaticDataPlugin`
2. **Active Proxied** — Next.js API routes in `src/app/api/` as CORS proxy
3. **Microservice** — Standalone Fastify container with SQLite (e.g., `iranwarlive-backend`)
4. **Dynamic CDN Loaded (Bundle)** — Externally developed plugins dynamically imported at runtime via ES module CDNs (e.g., `unpkg.com` version-pinned URLs). Handled by `loadBundlePlugin` using `import(/* webpackIgnore: true */ entry)`.
Four plugin architectures exist (All-Bundle Model):
1. **Data Engine Seeder** — Standalone Fastify container with SQLite microservice or unified seeders (e.g., `iranwarlive-backend`).
2. **Dynamic CDN Loaded (Bundle)** — Externally developed plugins dynamically imported at runtime via ES module CDNs (e.g., `unpkg.com` version-pinned URLs).
3. **WWV CLI Unpacked (Dev)** — Developed externally using `@worldwideview/cli dev`, which spins up a local Vite server and hot-reloads via WebSocket injection directly into the running platform.
4. **Marketplace Package (.wwvpkg)** — Built via `@worldwideview/cli publish` and distributed through the WorldWideView Marketplace.
All plugins are now dynamically imported at runtime as ES module bundles via `loadPluginFromManifest` utilizing `import(/* webpackIgnore: true */ entry)`. The plugin passport is defined in `wwv-manifest.json` which governs its trust tier (`developer`, `unverified`, `verified`, `built-in`) and capabilities.
Plugin types are re-exported from SDK through `src/core/plugins/PluginTypes.ts` and `PluginManifest.ts` — **source of truth is always `@worldwideview/wwv-plugin-sdk`**.
@@ -129,6 +131,18 @@ Engine push /stream → DataBusSubscriber WsClient router
→ StackManager (co-located entity grouping)
```
### 4.3.1 Split-Routing (Cloud Fallback)
When a local engine is detected at `localhost:5001`, the frontend fetches its `/manifest` to discover available seeders. Per-plugin routing via `resolveEngineUrl`:
- Plugin's seeder is in local manifest → `ws://localhost:5001/stream`
- Plugin's seeder is NOT in local manifest → `wss://dataengine.worldwideview.dev/stream`
This enables core contributors running the public (community) engine locally to see local data for their seeders while proprietary sources (aviation, maritime) continue streaming from the cloud.
The data engine uses a **public upstream / private fork** model:
- `wwv-data-engine` (public) — community seeders, contributors fork and PR here
- `wwv-data-engine-internal` (private) — all seeders, deploys to Coolify via `git merge upstream/main`
### 4.4 Rendering Pipeline
- **Primitive-based**: Uses `PointPrimitiveCollection`, `BillboardCollection`, `LabelCollection` — NOT Cesium Entity API
@@ -198,7 +212,7 @@ Built-in plugins are instantiated in `AppShell.tsx` and registered via `PluginRe
> - **Never** reference Cursor IDE rules; we use the open `.agents/` standard.
> - **MUST**: You MUST update Semantic Versioning numbering inside the relevant `package.json` file prior to executing any code commits, adhering strictly to the `[/commit]` workflow rules (`feat:` -> Minor, `fix/refactor/perf:` -> Patch).
> - **MUST Detail Commit Levels & Bumps**: On description changes or release notes, you must detail the level of commit (Major/Minor/Fix) for *each* individual change. If there are multiple accumulated changes, you MUST EITHER commit them individually and bump the version each time, OR commit them all at once and bump the version multiple times.
> - **MUST Explain Complex Concepts Simply**: Whenever providing a complicated technical explanation to the user, you MUST include a simple explanation below it. Use an analogy comparing the concept to something from everyday life to ensure the user easily understands it.
> - **MUST Explain Complex Concepts Simply**: Whenever providing a complicated technical explanation to the user, you MUST include a simple explanation below it. Use an analogy with reference to the correct terminology, comparing the concept to something from everyday life to ensure the user easily understands it.
### 5.8 Workspace Hygiene
Whenever agents generate temporary debugging scripts, test REST endpoints via `.mjs`, or dump traces/JSON outputs, they **MUST** save these exclusively inside `/local-scripts/`. The root directory is strictly for production configuration files.
@@ -215,6 +229,7 @@ Whenever agents generate temporary debugging scripts, test REST endpoints via `.
| `NEXT_PUBLIC_BING_MAPS_KEY` | No | Bing Maps imagery |
| `NEXT_PUBLIC_GOOGLE_MAPS_API_KEY` | No | Google 3D Tiles |
| `NEXT_PUBLIC_WWV_EDITION` | No | `local` / `cloud` / `demo` (default: `local`) |
| `NEXT_PUBLIC_WWV_PLUGIN_DATA_ENGINE_URL` | No | Override engine WebSocket URL (default: cloud) |
| `OPENSKY_CREDENTIALS` | No | Comma-separated `id:secret` pairs for credential rotation |
| `WWV_BRIDGE_TOKEN` | No | Shared secret for marketplace → WWV install bridge |
| `WWV_DEMO_ADMIN_SECRET` | No | Demo edition admin password |
@@ -281,7 +296,10 @@ Configured in `next.config.ts` `headers()`:
| Repo | Purpose |
|---|---|
| `worldwideview` | Main application (this repo) |
| `wwv-data-engine` | Open-source data engine — community seeders (PUBLIC) |
| `wwv-data-engine-internal` | Proprietary data engine — all seeders (PRIVATE, deployed to Coolify) |
| `worldwideview-marketplace` | Plugin marketplace web app |
| `worldwideview-plugins` | Published npm plugin packages |
| `worldwideview-web` | Marketing / landing page |
---
+49 -51
View File
@@ -1,91 +1,89 @@
<div align="center">
# WorldWideView 🌍
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# WorldWideView
**The Open-Source, Plugin-Driven Geospatial Intelligence Engine**
[![License: Elastic 2.0](https://img.shields.io/badge/License-Elastic%202.0-blue.svg)](LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
*A modular situational awareness platform designed to ingest live data streams and render them as interactive, cinematic layers on a high-fidelity CesiumJS 3D globe.*
<!-- 📸 Replace with a high-res GIF or screenshot of the platform running with multiple layers enabled -->
![WorldWideView Interface](docs/assets/screenshot.png)
</div>
---
## ⚡ Build a Plugin in 5 Minutes
WorldWideView is a real-time geospatial engine visualizing live global data on an interactive 3D globe. Utilizing a dynamic "All-Bundle" plugin architecture, independent data sources—like live aircraft, maritime vessels, or conflict events—are ingested and rendered decoupled from the core 3D viewer.
WorldWideView’s architecture means **everything is a plugin**. The core engine is completely data-agnostic. Rather than touching complex 3D rendering code, you can build a plugin that simply pipes a REST API into GeoJSON, and the engine handles the rest!
## Core Technologies
Ready to add a new intelligence layer (like Earthquakes, Weather, or Satellites)? We have a scaffold generator ready for you:
- **Frontend:** Next.js 16 (App Router), React 19, TypeScript 5
- **3D Engine:** CesiumJS + Resium (Google Photorealistic 3D Tiles)
- **State Management:** Zustand
- **Event Bus:** Custom typed `DataBus` for high-frequency WebSocket updates
- **Database:** SQLite via Prisma (local), PostgreSQL (cloud)
- **Deployment:** Docker multi-stage build, Coolify
## Quick Start (Self-Hosting)
WorldWideView uses a multi-stage Dockerfile designed for standalone output. To deploy instantly on your own server:
**Mac/Linux:**
```bash
# 1. Generate the boilerplate plugin from a template
pnpm run scaffold-osm-plugin my-new-data-source
# 2. Add your data fetching logic in the generated files
# 3. Reload the dev server and watch it map on the globe!
mkdir worldwideview && cd worldwideview
curl -fsSL https://raw.githubusercontent.com/silvertakana/worldwideview/main/setup.sh | bash
```
📖 **[Read the Full Plugin Guide](docs/PLUGIN_GUIDE.md)** for a deep dive into hooking up websockets or static datasets.
**Windows (PowerShell):**
```powershell
mkdir worldwideview; cd worldwideview
Invoke-WebRequest -Uri https://raw.githubusercontent.com/silvertakana/worldwideview/main/setup.ps1 -UseBasicParsing | Invoke-Expression
```
---
> [!NOTE]
> Ensure you mount the `/app/data` volume to persist the SQLite database across container restarts.
## 🚀 Installation & Setup (Local Development)
## Quick Start (Local Development)
To run the source code locally for contributing or developing:
```bash
git clone https://github.com/silvertakana/worldwideview.git
cd worldwideview
pnpm install
pnpm run setup # generates .env.local with AUTH_SECRET
pnpm run dev:all # starts the app, data engine, and marketplace concurrently
pnpm run dev:all # boots the UI, cache layers, and the data engine
```
Visit `http://localhost:3000` to see the live globe.
---
## Plugin Ecosystem
## 🐋 Production Deployment (Docker & Coolify)
WorldWideView operates on an open-core philosophy. The platform itself is data-agnostic; all data sources are dynamically imported as plugins at runtime.
WorldWideView uses a multi-stage Dockerfile designed for standalone output, natively supporting deployment via Coolify or standard Docker Compose. The `docker-compose.yml` spins up the front-end application alongside the high-performance Data Engine and Redis cache.
- **[Plugin Quickstart Guide](docs/plugin-quickstart.md)**: Learn how to scaffold and link your first plugin using the `@worldwideview/cli`.
- **[Advanced Plugin Guide](docs/plugin-advanced.md)**: Deep dive into microservice data seeders, WebSockets, complex 3D rendering, and Marketplace publishing.
```bash
# Start the core app, Redis cache, and Data Engine microservice in production mode
docker compose up -d
```
## Repository Ecosystem
**Persistent Storage Requirements:**
When deploying to production, ensure you mount the following volumes to prevent data loss:
- Mount `/app/data` to persist the core SQLite database.
- Mount `/app/packages/wwv-data-engine/data` to persist the custom plugin microservices SQLite layer.
- Mount `/data` to persist the standalone Redis container.
WorldWideView is distributed across several specialized repositories:
---
1. **`worldwideview`** (This Repo): Main frontend, CesiumJS rendering engine, and core plugin framework.
2. **`wwv-data-engine`**: Open-source community data backend for polling public APIs.
3. **`worldwideview-plugins`**: First-party maintained plugins.
4. **`worldwideview-marketplace`**: The web application driving the plugin directory.
5. **`worldwideview-web`**: Marketing and landing site.
## 🧠 Core Architecture & Philosophies
## Documentation Index
- **Dynamic, Decentralized Plugins**: The plugin ecosystem uses a decentralized architecture fetching ES module CDN bundles (e.g., from unpkg) at runtime. The core engine is a lightweight shell that loads data providers dynamically via the marketplace.
- **High-Performance Rendering**: Engineered for scale using raw Cesium primitives to smoothly handle upwards of 100,000+ objects simultaneously without GPU stalls.
- **Cinematic Situational Awareness**: Implements horizon culling, smooth camera tracking, orientation-locked billboarding, and stack spiderification for dense locations.
Explore our comprehensive documentation suite for detailed engineering insights:
---
## 📚 Documentation Index
- **[Setup & Installation Guide](docs/SETUP.md)**: Detailed environment and local development setup.
- **[Architecture (Engineering Depth)](docs/ARCHITECTURE.md)**: Deep dive into the Cesium rendering pipeline, event data bus, and performance optimizations.
- **[Contributions Guide](CONTRIBUTING.md)**: How to help out, coding standards, and commit conventions.
- **[User Guide](docs/USER_GUIDE.md)**: Application features and navigation tips.
---
## 🤝 Contributing & Community
We are actively looking for contributors to help build new data plugins and optimize the core 3D engine!
- Found a bug or have an idea? Search the [Issue Tracker](https://github.com/silvertakana/worldwideview/issues) and submit a report.
- Want to build something? Check out our **[Pinned Plugin Wishlist](https://github.com/silvertakana/worldwideview/issues)** for great first issues!
- **[Project Overview](docs/project-overview.md)**: High-level value proposition and technology stack.
- **[Architecture](docs/architecture.md)**: DataBus event stream and Zustand state management.
- **[Build System](docs/build-system.md)**: Monorepo structure, Next.js standalone output, and Docker builds.
- **[Development](docs/development.md)**: Coding conventions and common implementation patterns.
- **[Testing](docs/testing.md)**: Vitest setup and coverage targets.
- **[Deployment](docs/deployment.md)**: Coolify integration and persistent volumes.
- **[Files Catalog](docs/files.md)**: Comprehensive mapping of core source files.
> [!IMPORTANT]
> **Fair-Use Notice:** This application may contain copyrighted material the use of which has not always been specifically authorized by the copyright owner. Such material is made available for educational purposes, situational awareness, and to advance understanding of global events under "fair use" (Section 107 of the US Copyright Law).
+7
View File
@@ -0,0 +1,7 @@
# This file lists tools managed by Aftman, a cross-platform toolchain manager.
# For more information, see https://github.com/LPGhatguy/aftman
# To add a new tool, add an entry to this table.
[tools]
rojo = "rojo-rbx/[email protected]"
# rojo = "rojo-rbx/[email protected]"
-91
View File
@@ -1,91 +0,0 @@
# API Reference
This document provides a technical reference for the core internal services of WorldWideView. These services are designed to be used by plugins and core components for communication and data management.
## `DataBus`
The `DataBus` is a central event emitter used for decoupled, typed communication between different parts of the application.
- **Import**: `import { dataBus } from "@/core/data/DataBus";`
- **Source**: `src/core/data/DataBus.ts`
### Methods
#### `on<K>(event: K, handler: Handler): () => void`
Subscribes to an event. Returns an unsubscribe function.
- **event**: The event name (keys of `DataBusEvents`).
- **handler**: A callback function receiving the event data.
#### `off<K>(event: K, handler: Handler): void`
Unsubscribes from an event.
- **event**: The event name.
- **handler**: The handler function to remove.
#### `emit<K>(event: K, data: T): void`
Broadcasts an event to all subscribers.
- **event**: The event name.
- **data**: The payload for the event.
#### `removeAllListeners(event?: string): void`
Removes all listeners for a specific event, or all listeners if no event is provided.
---
## `PluginRegistry`
The `PluginRegistry` manages the registration and discovery of all `WorldPlugin` implementations.
- **Import**: `import { pluginRegistry } from "@/core/plugins/PluginRegistry";`
- **Source**: `src/core/plugins/PluginRegistry.ts`
### Methods
#### `register(plugin: WorldPlugin): void`
Adds a new plugin to the registry. Throws a warning if the plugin ID is already registered.
#### `get(pluginId: string): WorldPlugin | undefined`
Retrieves a plugin by its unique ID.
#### `getAll(): WorldPlugin[]`
Returns an array of all registered plugins.
#### `getByCategory(category: string): WorldPlugin[]`
Returns all plugins belonging to a specific category.
#### `has(pluginId: string): boolean`
Checks if a plugin with the given ID is registered.
#### `unregister(pluginId: string): void`
Removes a plugin from the registry.
---
## `CacheLayer`
The `CacheLayer` provides a two-tier caching mechanism for geographical entities.
- **Import**: `import { cacheLayer } from "@/core/data/CacheLayer";`
- **Source**: `src/core/data/CacheLayer.ts`
### Methods
#### `init(): Promise<void>`
Initializes the IndexedDB store. Must be called before persistent storage operations.
#### `set(pluginId: string, entities: GeoEntity[], ttlMs?: number): void`
Caches entities for a plugin.
- **pluginId**: Unique identifier for the data source.
- **entities**: Array of `GeoEntity` objects.
- **ttlMs**: Time-to-live in milliseconds (default: 30,000).
#### `get(pluginId: string): GeoEntity[] | null`
Retrieves entities from the L1 (Memory) cache. Returns `null` if expired or missing.
#### `getFromPersistent(pluginId: string): Promise<GeoEntity[] | null>`
Retrieves entities from the L2 (IndexedDB) cache. This method also populates the L1 cache on success.
#### `invalidate(pluginId: string): void`
Removes entries for a plugin from both L1 and L2 caches.
#### `clear(): void`
Purges all data from both cache tiers.
+27 -58
View File
@@ -1,64 +1,33 @@
# System Architecture
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# Architecture
WorldWideView is a high-performance, event-driven geospatial intelligence engine. It is designed to ingest live, fast-moving signals—such as aviation ADS-B, maritime AIS, or satellite feeds—and transform them into cinematic, real-time visual layers on a 3D globe.
## Overview
WorldWideView operates on a decoupled, plugin-based architecture designed for real-time visualization of geospatial data. The system is split between a Next.js 16 frontend that handles UI and CesiumJS 3D rendering, and a network of plugin data seeders that stream live updates via WebSockets.
## Module Breakdown
The core design philosophy is the "All-Bundle Model," where plugins are dynamically imported at runtime as ES module bundles (`Dynamic CDN Loaded`). The frontend maintains a modular state architecture using Zustand, routing high-frequency data updates through a custom `DataBus` singleton to avoid React render cycle bottlenecks.
1. **`src/core/plugins`**: The registration and lifecycle management layer.
- **PluginManager**: Orchestrator for enabling/disabling plugins.
- **InstalledPluginsLoader**: Dynamically discovers and loads external marketplace plugins at runtime via CDN bundles (e.g. UNPKG).
2. **`src/core/data`**: The "Heartbeat" of the system.
- **DataBus**: Decentralized event pipeline for all system actions.
- **PollingManager**: Intelligent scheduler for external API calls with backoff logic.
- **CacheLayer**: 2-stage persistent caching (In-Memory + IndexedDB).
3. **`src/core/globe`**: The Rendering Engine.
- **Cesium Integration**: Low-level control over the Cesium Viewer.
- **EntityRenderer**: High-performance "Primitive" renderer.
4. **`packages/wwv-plugin-*`**: Monorepo plugin packages, externalized into standalone dynamically loaded CDNs.
## Component Map
- **Frontend App Shell:** Next.js App Router providing layout and base API routes (in `src/app/`).
- **Globe Rendering Engine:** CesiumJS wrapped in Resium, responsible for 3D primitive and model rendering (in `src/core/globe/`).
- **State Management:** Zustand slice-based architecture (in `src/core/state/`).
- **Data Pipeline:** Custom event bus (`DataBus`) and WebSocket clients (`DataBusSubscriber`) routing live data to state (in `src/core/data/`).
- **Plugin System:** Registration, lifecycle management, and ES module loaders (in `src/core/plugins/`).
- **Database Layer:** Prisma ORM connecting to local SQLite or cloud PostgreSQL (in `prisma/`).
## Performance: Primitives vs. Entities
## Key Files
- `src/core/plugins/PluginManager.ts` - The PluginManager class. Core registry that instantiates plugins, calls `initialize()`, and handles lifecycle events.
- `src/core/plugins/loaders/InstalledPluginsLoader.ts` - Dynamically fetches and imports `import(/* webpackIgnore: true */ ...)` marketplace plugins into the environment.
- `src/core/data/DataBus.ts` - Custom typed event bus singleton that routes high-frequency data around the application.
- `src/core/globe/GlobeView.tsx` - The main Cesium viewer container, handling imagery layers, cameras, and primitive collections.
- `src/core/state/store.ts` - The main Zustand store registry linking the nine state slices (globe, layers, timeline, ui, filter, data, config, favorites, geojson).
One of our core design decisions is using **Cesium Primitives** instead of the standard high-level **Entity API** for high-count datasets.
## Data Flow
Real-time data follows a strict unidirectional stream optimized for sub-second updates:
| Feature | Entity API | Primitive API (WWV) |
|---|---|---|
| **Abstraction** | High (Easy to use) | Low (Direct GPU access) |
| **Overhead** | Significant per-entity JS objects | Minimal (Batched rendering) |
| **Max Capacity** | ~1,000 entities | **100,000+ points/billboards** |
| **WWV Use Case** | Info window content | Live data point visualization |
**Why?** The Entity API in Cesium is great for rich features but triggers significant CPU overhead when managing thousands of moving objects. By using `PointPrimitiveCollection` and `BillboardCollection`, WorldWideView batches these draw calls, ensuring 60FPS even with dense global data.
## Data Pipeline (Example: Aviation)
The following diagram trace the journey of a single data point from a remote sensor to the user's screen:
```mermaid
sequenceDiagram
participant S as Remote API (e.g. OpenSky)
participant P as Plugin (AviationPlugin)
participant D as DataBus
participant R as EntityRenderer
participant G as GPU (Cesium)
Note over S, P: Polling Interval (e.g. 30s)
S->>P: raw JSON data
rect rgb(200, 230, 255)
Note right of P: Mapping to GeoEntity
P->>P: parse, filter, sanitize
end
P->>D: emit("dataUpdated", { entities })
D->>R: trigger render cycle
rect rgb(255, 230, 200)
Note right of R: Batch Update Primitives
R->>G: update collection buffer
end
G-->>G: 60FPS visualization
```
## Design Principles
- **Single Responsibility (SRP)**: Plugins only handle data mapping; they don't know about the UI or the Cache.
- **Dependency Inversion**: The `PluginManager` communicates with plugins through the `WorldPlugin` interface, allowing new plugins to be added without modifying core code.
- **Event-Driven Architecture**: The system is reactive. Components subscribe to what they need, reducing prop-drilling and unnecessary re-renders.
- **Defensive Programming**: All external API calls in plugins are wrapped in error boundaries and handled by the `PollingManager`'s backoff logic to prevent system-wide failures.
1. **Engine Push:** A remote data engine pushes state over WebSocket (`/stream`) from either local seeders (`ws://localhost:5001/stream`) or the cloud fallback (`wss://dataengine.worldwideview.dev/stream`).
2. **WebSocket Client Router:** `WsClient.handleMessage()` receives the payload and pipes it to the event bus.
3. **DataBus Emission:** The bus fires `DataBus.emit("websocketData", WsStreamPayload)`.
4. **State Hydration:** The `DataBusSubscriber` component listens to the bus and calls `_hydrateSnapshot()` to update the Zustand store's `entitiesByPlugin` cache.
5. **Memoized Selection:** `GlobeView` selects the visible entities from the store.
6. **Primitive Rendering:** The `EntityRenderer` translates store entities into Cesium `PointPrimitiveCollection` and `BillboardCollection` arrays for GPU rendering.
7. **Animation & LOD:** `AnimationLoop` handles horizon culling and hover effects, while `useModelRendering` promotes close-range entities to 3D glTF models.
-452
View File
@@ -1,452 +0,0 @@
# WorldWideView Plugin Guide
Build custom data layer plugins for the WorldWideView 3D globe platform. This guide covers the full plugin lifecycle, available APIs, and step-by-step instructions for creating your own plugin.
## Architecture Overview
```
┌─────────────────────────────────────────────────┐
│ UI Layer │
│ LayerPanel ─ InfoCard ─ Timeline ─ ConfigPanel │
└────────────────────┬────────────────────────────┘
│ Zustand Store
┌────────────────────┴────────────────────────────┐
│ Plugin Manager │
│ register → initialize → enable/disable → poll │
│ ┌────────┴────────┐ │
│ PluginRegistry PollingManager │
│ │ │ │
│ DataBus (events) CacheLayer (2-tier) │
└────────────────────┬────────────────────────────┘
│
┌────────────────────┴────────────────────────────┐
│ Your Plugin (WorldPlugin) │
│ fetch() → GeoEntity[] → renderEntity() → Globe │
└─────────────────────────────────────────────────┘
```
### Plugin Lifecycle
1. **Instantiation**: Your class is instantiated and passed to `pluginRegistry.register()`.
2. **Registration**: The `PluginManager` discovers the plugin in the registry during the boot sequence.
3. **Initialization**: `initialize(ctx)` is called. This is where you should set up your domain-specific API clients or static data.
4. **Enabled State**: When a user toggles the layer in the UI, the `PluginManager` starts the polling cycle.
5. **Fetch/Render Cycle**: `fetch()` is called periodically; `renderEntity()` is called for result.
6. **Destruction**: `destroy()` is called if the plugin is unregistered or the application is unmounted.
### Data Flow
```mermaid
sequenceDiagram
participant PM as PluginManager
participant P as YourPlugin
participant DB as DataBus
PM->>P: initialize(ctx)
Note over PM, P: User toggles layer ON
loop Every getPollingInterval()
PM->>P: fetch(timeRange)
P-->>PM: GeoEntity[]
PM->>DB: emit("dataUpdated")
end
Note over PM, P: User toggles layer OFF
PM->>PM: Stop Polling
```
---
## Quick Start: Minimal Plugin
```typescript
// src/plugins/earthquakes/index.ts
import { Activity } from "lucide-react";
import type {
WorldPlugin, GeoEntity, TimeRange, PluginContext,
LayerConfig, CesiumEntityOptions,
} from "@/core/plugins/PluginTypes";
export class EarthquakePlugin implements WorldPlugin {
id = "earthquake";
name = "Earthquakes";
description = "Recent seismic activity from USGS";
icon = Activity;
category = "natural-disaster" as const;
version = "1.0.0";
private context: PluginContext | null = null;
async initialize(ctx: PluginContext): Promise<void> {
this.context = ctx;
}
destroy(): void {
this.context = null;
}
async fetch(_timeRange: TimeRange): Promise<GeoEntity[]> {
const res = await fetch("/api/earthquake");
if (!res.ok) return [];
const data = await res.json();
return data.features.map((f: any): GeoEntity => ({
id: `earthquake-${f.id}`,
pluginId: "earthquake",
latitude: f.geometry.coordinates[1],
longitude: f.geometry.coordinates[0],
altitude: 0,
timestamp: new Date(f.properties.time),
label: `M${f.properties.mag}`,
properties: {
magnitude: f.properties.mag,
depth: f.geometry.coordinates[2],
place: f.properties.place,
},
}));
}
getPollingInterval(): number {
return 120000; // 2 minutes
}
getLayerConfig(): LayerConfig {
return {
color: "#ef4444",
clusterEnabled: true,
clusterDistance: 40,
};
}
renderEntity(entity: GeoEntity): CesiumEntityOptions {
const mag = (entity.properties.magnitude as number) || 0;
return {
type: "point",
color: mag >= 5 ? "#dc2626" : mag >= 3 ? "#f97316" : "#fbbf24",
size: Math.max(4, mag * 2),
outlineColor: "#000000",
outlineWidth: 1,
};
}
}
```
### Register Your Plugin
In your app's initialization code (e.g. the root layout component):
```typescript
import { pluginRegistry } from "@/core/plugins/PluginRegistry";
import { EarthquakePlugin } from "@/plugins/earthquakes";
pluginRegistry.register(new EarthquakePlugin());
```
That's it. The plugin will appear in the Layer Panel and can be toggled on/off.
---
## WorldPlugin Interface Reference
### Required Properties
| Property | Type | Description |
|---|---|---|
| `id` | `string` | Unique identifier (e.g. `"aviation"`, `"earthquake"`) |
| `name` | `string` | Display name shown in the Layer Panel |
| `description` | `string` | Short description shown below the name |
| `icon` | `string \| ComponentType` | Lucide icon component or emoji string |
| `category` | `PluginCategory` | Grouping in the Layer Panel |
| `version` | `string` | Semver version string |
**Available categories:** `aviation`, `maritime`, `conflict`, `natural-disaster`, `infrastructure`, `cyber`, `economic`, `custom`
### Required Methods
#### `initialize(ctx: PluginContext): Promise<void>`
Called once when the plugin is registered. Store the context for later use.
```typescript
interface PluginContext {
apiBaseUrl: string; // Base URL for API calls
timeRange: TimeRange; // Current time window
onDataUpdate: (entities: GeoEntity[]) => void; // Push data updates
onError: (error: Error) => void; // Report errors
}
```
#### `destroy(): void`
Cleanup when the plugin is unregistered. Release any resources.
#### `fetch(timeRange: TimeRange): Promise<GeoEntity[]>`
Called by the polling system at your declared interval. Return an array of `GeoEntity` objects representing your data points.
#### `getPollingInterval(): number`
Return the polling interval in milliseconds. This determines how often `fetch()` is called.
#### `getLayerConfig(): LayerConfig`
Return the default layer configuration. These values are used to initialize the UI and the renderer:
```typescript
interface LayerConfig {
color: string; // Default CSS color for primary visualization
iconUrl?: string; // Default icon for billboards (if applicable)
clusterEnabled: boolean; // Enable spatial clustering at high zoom levels
clusterDistance: number; // Cluster radius in pixels (suggested: 40)
minZoomLevel?: number; // Hide entities when camera is too far (meters)
maxEntities?: number; // Limit for performance safety
showLabelsByDefault?: boolean; // If true, labels show without hover
}
```
#### `renderEntity(entity: GeoEntity): CesiumEntityOptions`
Called for each entity to determine how it appears on the globe:
```typescript
interface CesiumEntityOptions {
type: "billboard" | "point" | "polyline" | "polygon" | "label";
color?: string; // CSS color string
size?: number; // Pixel size (for points)
iconUrl?: string; // Image URL (for billboards)
rotation?: number; // Degrees, applied to billboards
outlineColor?: string; // CSS color for point outlines
outlineWidth?: number; // Outline width in pixels
labelText?: string; // Text label above the entity
labelFont?: string; // CSS font string for labels
}
```
### Optional Methods
#### `getSelectionBehavior(entity: GeoEntity): SelectionBehavior | null`
Return trail rendering and camera behavior when an entity is selected. Return `null` for default behavior.
```typescript
interface SelectionBehavior {
showTrail?: boolean; // Render a trail polyline
trailDurationSec?: number; // Trail length in seconds (default: 60)
trailStepSec?: number; // Trail point spacing (default: 5)
trailColor?: string; // CSS color (default: '#00fff7')
flyToOffsetMultiplier?: number; // Camera offset multiplier (default: 3)
flyToBaseDistance?: number; // Base camera distance in meters (default: 30000)
}
```
**Example:** Show trails only for airborne entities:
```typescript
getSelectionBehavior(entity: GeoEntity): SelectionBehavior | null {
if (entity.properties.on_ground) return null;
return { showTrail: true, trailColor: "#00fff7" };
}
```
#### `getServerConfig(): ServerPluginConfig`
Declare your plugin's server-side data layer requirements:
```typescript
interface ServerPluginConfig {
apiBasePath: string; // e.g. "/api/aviation"
pollingIntervalMs: number; // Server-side polling interval
requiresAuth?: boolean; // OAuth/API key needed
historyEnabled?: boolean; // Supports timeline playback
availabilityEnabled?: boolean; // Reports time ranges
}
```
> **Note:** The current server infrastructure (API routes, background polling) is set up per-plugin in `src/app/api/<pluginId>/` and `src/lib/`. See [Server-Side Data Layer](#server-side-data-layer) for the pattern.
#### `getSidebarComponent(): ComponentType`
Return a React component to render in the sidebar when this plugin's layer is active.
#### `getDetailComponent(): ComponentType<{ entity: GeoEntity }>`
Return a React component to render in the detail panel when an entity from this plugin is selected.
---
## GeoEntity
The universal data model for all plugin entities:
```typescript
interface GeoEntity {
id: string; // Unique ID (prefix with pluginId)
pluginId: string; // Must match your plugin's `id`
latitude: number; // WGS84 latitude
longitude: number; // WGS84 longitude
altitude?: number; // Meters above sea level
heading?: number; // Degrees (0 = North, 90 = East)
speed?: number; // Meters per second
timestamp: Date; // When this data was captured
label?: string; // Short display label
properties: Record<string, unknown>; // Plugin-specific data
}
```
**Conventions:**
- **`id`** — Prefix with your plugin ID to avoid collisions: `"earthquake-us7000abc"`
- **`heading` + `speed`** — If both are set, the renderer will extrapolate movement between polls (smooth animation)
- **`properties`** — Use for domain-specific data (e.g. magnitude, vessel type, altitude). These are accessible in info cards and detail panels
---
## Core Services
### DataBus — Event Communication
Subscribe to cross-plugin events:
```typescript
import { dataBus } from "@/core/data/DataBus";
// Available events
dataBus.on("dataUpdated", ({ pluginId, entities }) => { ... });
dataBus.on("entitySelected", ({ entity }) => { ... });
dataBus.on("layerToggled", ({ pluginId, enabled }) => { ... });
dataBus.on("timeRangeChanged", ({ timeRange }) => { ... });
dataBus.on("cameraPreset", ({ presetId }) => { ... });
```
### CacheLayer — Two-Tier Caching
The PluginManager automatically caches your `fetch()` results in:
1. **Memory** — instant recall within the same session
2. **IndexedDB** — survives page refreshes
You don't need to interact with the cache directly — it's managed by the PluginManager.
### PollingManager — Automatic Polling
Your `getPollingInterval()` return value is used to set up automatic polling. Features:
- **Exponential backoff** on errors (up to 60s max)
- **Pause/resume** support
- **Dynamic interval updates** — users can adjust intervals in the Config Panel
---
## Server-Side Data Layer
For plugins that need server-side processing (API proxying, database persistence, authentication), follow this pattern:
### 1. Create an API Route
```
src/app/api/<your-plugin>/route.ts
```
```typescript
import { NextResponse } from "next/server";
export async function GET() {
// Fetch from your data source
const res = await fetch("https://api.example.com/data", {
headers: { "Authorization": `Bearer ${process.env.YOUR_API_KEY}` },
cache: "no-store",
});
if (!res.ok) {
return NextResponse.json({ error: res.statusText }, { status: res.status });
}
const data = await res.json();
return NextResponse.json(data);
}
```
### 2. Optional: Background Polling
For APIs with rate limits, create a server-side polling module:
```
src/lib/<your-plugin>-polling.ts
```
Register it in `src/instrumentation.ts`:
```typescript
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
const { startYourPluginPolling } = await import("./lib/your-plugin-polling");
startYourPluginPolling();
}
}
```
### 3. Optional: History Endpoint
For timeline/playback support, add a history route:
```
src/app/api/<your-plugin>/history/route.ts
```
Accept a `?time=<ms>` parameter and return the closest historical records.
### 4. Declare in Plugin
Use `getServerConfig()` to document your server-side setup:
```typescript
getServerConfig(): ServerPluginConfig {
return {
apiBasePath: "/api/earthquake",
pollingIntervalMs: 120000,
historyEnabled: false,
};
}
```
---
## Rendering Details
### Billboard vs Point
| Feature | `billboard` | `point` |
|---|---|---|
| Custom image | Yes via `iconUrl` | No |
| Rotation | Yes via `rotation` | No |
| Performance | Good (GPU batched) | Best (single draw call) |
| Outline | No | Yes via `outlineColor/Width` |
**Use billboards** for entities with custom icons and rotation (aircraft, vehicles).
**Use points** for simpler markers (fires, earthquakes, vessels).
### Labels
Labels are automatically hidden at long distances and shown within 500km or on hover/selection. Configure via `labelText` and `labelFont` in your `renderEntity()` return.
### Position Extrapolation
If your `GeoEntity` has both `heading` and `speed` set, the globe renderer will automatically extrapolate smooth movement between polling intervals (up to 5 minutes). This creates fluid animation without increasing your API call frequency.
---
## Existing Plugin Examples
| Plugin | Category | Data Source | Rendering | Selection |
|---|---|---|---|---|
| [Aviation](../src/plugins/aviation/index.ts) | `aviation` | OpenSky Network (live + Supabase fallback) | Billboards with altitude-based coloring | Trail polyline for airborne entities |
| [Maritime](../src/plugins/maritime/index.ts) | `maritime` | AIS feeds (with demo fallback) | Points with vessel-type coloring | Default |
| [Wildfire](../src/plugins/wildfire/index.ts) | `natural-disaster` | NASA FIRMS (VIIRS) | Points with FRP-based sizing/coloring | Default |
---
## Checklist: Publishing a Plugin
- [ ] Implements all required `WorldPlugin` methods
- [ ] `id` is unique and lowercase (no spaces)
- [ ] All `GeoEntity.id` values are prefixed with your plugin ID
- [ ] `GeoEntity.pluginId` matches your plugin's `id`
- [ ] `renderEntity()` returns valid `CesiumEntityOptions`
- [ ] API route created (if needed) at `src/app/api/<id>/`
- [ ] Plugin registered in the app initialization code
- [ ] Tested: toggle on/off in Layer Panel
- [ ] Tested: entity hover and click selection
- [ ] Tested: info card displays your `properties` correctly
-75
View File
@@ -1,75 +0,0 @@
# Setup & Installation
Follow these steps to set up your development environment and get WorldWideView running locally.
## Requirements
- **Node.js**: v18.17 or higher (tested on v20+)
- **pnpm**: v8 or higher (`npm install -g pnpm`)
- **Browser**: Chrome, Firefox, or Edge (CesiumJS requires WebGL support)
## Environment Setup
Run the setup script to auto-generate `.env.local` with a secure `AUTH_SECRET`:
```bash
pnpm run setup
```
This copies `.env.example` → `.env.local` and fills in `AUTH_SECRET` automatically. You can then optionally add API keys for enhanced features (Cesium Ion, Bing Maps, OpenSky, etc.).
> [!NOTE]
> `AUTH_SECRET` must remain stable across restarts. The setup script generates it once and writes it to `.env.local`. Never commit `.env.local` to git.
## Running Locally
1. **Install Dependencies**:
```bash
pnpm install
```
2. **Generate environment file** (first time only):
```bash
pnpm run setup
```
3. **Start Dev Server**:
```bash
pnpm run dev:all
```
4. **Open Browser**:
Navigate to [http://localhost:3000](http://localhost:3000).
## Folder Structure Explanation
Understanding the project layout:
```text
worldwideview/
├── docs/ # Project documentation
├── packages/ # Plugin packages (pnpm workspaces)
├── public/ # Static assets (GeoJSON data files, Cesium dependencies)
├── scripts/ # Build and utility scripts (e.g., copy-cesium.mjs)
└── src/
├── app/ # Next.js App Router (Layouts, Pages, API Routes)
├── components/ # React UI components (HUD, LayersPanel, Panels)
├── core/ # Core engine logic
│ ├── data/ # Data management (DataBus, Polling, Cache)
│ ├── globe/ # Cesium-specific hooks and view logic
│ └── plugins/ # Plugin system base and registry
├── lib/ # Utility libraries and server-side logic
└── plugins/ # Built-in plugins (Aviation, Maritime, etc.)
```
## Verification
To verify your setup:
1. Ensure the globe loads without errors in the console.
2. Check if the "Aviation" layer is visible in the Layers Panel.
3. Verify that the HUD (top bar) displays live camera coordinates.
---
> [!TIP]
> The database is created automatically on first run — no manual setup is required. If you need to reset it, delete `data/wwv.db` and restart the dev server.
-48
View File
@@ -1,48 +0,0 @@
# User Guide
Welcome to WorldWideView! This guide will help you navigate the 3D globe and interact with live data layers.
## Navigating the Globe
- **Rotate**: Left-click and drag.
- **Zoom**: Use the mouse wheel or pinch on a trackpad.
- **Tilt/Rotate Perspective**: Right-click and drag (or use Ctrl + Left-click).
- **Fly to Location**: Double-click on an entity or use the search bar (if available).
## Application Panels
### Layers Panel
Located on the left side of the screen, the Layers Panel allows you to toggle different data sources on and off.
- **Search Layers**: Filter the available plugins.
- **Toggle Visibility**: Enable or disable specific data layers like Aviation, Maritime, or Wildfires.
- **Layer Configuration**: Some layers provide settings like clustering or color customization.
### HUD (Heads-Up Display)
The HUD at the top provides real-time information about your current view:
- **Camera Coordinates**: Latitude, Longitude, and Altitude.
- **Pitch & Heading**: Current orientation of the camera.
- **FPS Indicator**: Performance metrics.
### Timeline
The timeline at the bottom allows you to track data over time.
- **Current Time**: Displays the simulated time on the globe.
- **Playback Controls**: If supported by the plugin, you can scrubbing through historical data.
## Interacting with Entities
- **Hover**: Hover over a marker (point or billboard) to see a quick label.
- **Selection**: Click on an entity to open its **Info Card**.
- **Info Card**: Displays detailed properties about the selected object (e.g., flight number, vessel type, fire intensity).
- **Trails**: Some entities (like aircraft) show a historical trail when selected.
## Settings & Configuration
You can access global settings through the **Config Panel**. Here you can:
- Adjust the **Polling Interval** for data updates.
- Toggle **Night Mode** or change the **Imagery Base Map** (e.g., Satellite, Terrain, Street).
- Manage **Cache Settings** to clear offline data.
---
> [!TIP]
> Use the **[Keyboard Shortcuts]** (coming soon) for faster navigation and panel toggling.
+32
View File
@@ -0,0 +1,32 @@
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# Build System
## Overview
WorldWideView uses a pnpm monorepo workspace for managing both the main application and its associated SDK and plugin packages. The primary build system relies on Next.js 16 with custom Webpack optimizations, specifically designed to output a standalone trace for highly efficient Docker containerization.
The core build configuration resides in `package.json` and `next.config.ts`. A custom standalone tracer strips unnecessary CLI dependencies (`prisma`, `dotenv`) from the final build to prevent fatal container runtime crashes.
## Build Workflows
### Standard Development
- **Install Dependencies:** `pnpm install` (Installs all workspace packages defined in `pnpm-workspace.yaml`).
- **Initial Setup:** `pnpm run setup` (Executes `scripts/setup.mjs` to generate a `.env.local` with a fresh `AUTH_SECRET`).
- **Run Development Server (All):** `pnpm dev:all` (Concurrently starts the Next.js frontend and the local `wwv-data-engine` backends).
### Production Build
- **Build Command:** `pnpm build` (Executes `next build --webpack`).
- **Output:** Generates a `.next/standalone/` folder ready for execution.
- **Static Assets:** `scripts/copy-cesium.mjs` is executed during `predev` and `build` to copy pre-compiled CesiumJS static assets into the `public/cesium/` directory, keeping them out of the output tracer.
## Platform Setup
- **Database Migrations:** Prisma schema is located at `prisma/schema.prisma`. During development, `pnpm dev` triggers a `predev` hook running `npx prisma migrate deploy` to ensure SQLite tables exist in `data/wwv.db`.
- **Microservices:** Data engine seeders and standalone Fastify backend plugins (like `wwv-plugin-iranwarlive/backend`) are started via `pnpm start:backends` and managed locally inside `packages/*/backend`.
- **Plugin Packages:** Internal plugin packages must be properly listed in `tsconfig.json` paths and `next.config.ts`'s `transpilePackages` array.
## Reference
- **Monorepo Config:** `pnpm-workspace.yaml` - defines package locations (`packages/*` and `packages/*/backend`).
- **Next Config:** `next.config.ts` - controls the standalone output, `transpilePackages`, and restrictive security headers.
- **Prisma Config:** `prisma.config.ts` - Native JavaScript object export used to bypass Next.js tracer issues with dynamic imports.
- **Cesium Script:** `scripts/copy-cesium.mjs` - Handles static asset injection.
-362
View File
@@ -1,362 +0,0 @@
# Creating a WorldWideView Plugin
This guide walks you through building, publishing, and listing your own WorldWideView plugin from scratch.
---
## Overview
WorldWideView plugins display geospatial data on a 3D Cesium globe. Every plugin must implement the `WorldPlugin` interface from the **Plugin SDK** (`@worldwideview/wwv-plugin-sdk`).
There are **three plugin formats**:
| Format | Use Case | Example |
|---|---|---|
| **`static`** | GeoJSON file loaded at startup — no API calls at runtime | Military Bases, Nuclear Facilities, Embassies |
| **`bundle`** | Full TypeScript class with custom logic, live API data, UI components | Aviation, Maritime, Wildfire |
| **`declarative`** | JSON-only manifest that points to an external API — no code needed | *(Future)* |
---
## Prerequisites
- Node.js ≥ 18
- pnpm (`npm install -g pnpm`)
- A npm account (for publishing to the npm registry)
- The WorldWideView monorepo cloned locally
---
## Step 1 — Create Your Plugin Package
All plugins live under `packages/` in the monorepo.
```bash
mkdir packages/wwv-plugin-my-data
cd packages/wwv-plugin-my-data
```
Create `package.json`:
```json
{
"name": "@worldwideview/wwv-plugin-my-data",
"version": "1.0.0",
"description": "WorldWideView plugin — my custom data layer",
"main": "src/index.ts",
"types": "src/index.ts",
"files": ["src"],
"keywords": [
"worldwideview",
"worldwideview-plugin",
"geojson",
"cesium",
"globe"
],
"repository": {
"type": "git",
"url": "https://github.com/silvertakana/worldwideview.git",
"directory": "packages/wwv-plugin-my-data"
},
"license": "ISC",
"author": "WorldWideView",
"peerDependencies": {
"@worldwideview/wwv-plugin-sdk": "*"
},
"worldwideview": {
"id": "my-data",
"icon": "MapPin",
"category": "Custom",
"format": "bundle"
}
}
```
> [!IMPORTANT]
> The `"worldwideview"` object block is strictly required if you intend to publish your plugin to the WorldWideView Marketplace. The marketplace uses this internal manifest to determine how to categorize and display your plugin automatically.
> * `id`: The unique string identifier.
> * `icon`: The Lucide React icon name (e.g. `MapPin`, `Satellite`, `Plane`).
> * `category`: Must match an existing category (e.g. `Aviation`, `Maritime`, `Natural Disaster`, `Custom`).
> * `format`: Either `bundle`, `static`, or `declarative`.
> [!IMPORTANT]
> The SDK is declared as a **peer dependency**, not a direct dependency. The host application provides it at runtime.
---
## Step 2 — Write Your Plugin Code
Create `src/index.ts`. Here are examples for the two most common formats:
### Option A — Static GeoJSON Plugin (simplest)
For static plugins, the npm package is just metadata. The actual loading is handled by the `StaticDataPlugin` loader at runtime, driven by a manifest + GeoJSON file.
```typescript
/**
* @worldwideview/wwv-plugin-my-data
*
* Static GeoJSON plugin — my custom dataset.
*
* This package exists for npm registry metadata. The actual plugin logic
* is handled by WorldWideView's StaticDataPlugin loader at runtime using
* the manifest + GeoJSON data file served from the host application.
*/
export const PLUGIN_ID = "my-data" as const;
```
For static plugins you also need:
1. A **GeoJSON file** placed at `public/data/my_data.geojson` in the main app
2. A **manifest entry** in the marketplace (see Step 4)
### Option B — Bundle Plugin (full control)
For bundle plugins, you write a class that implements the `WorldPlugin` interface:
```typescript
import type {
WorldPlugin,
GeoEntity,
TimeRange,
PluginContext,
LayerConfig,
CesiumEntityOptions,
} from "@worldwideview/wwv-plugin-sdk";
export class MyDataPlugin implements WorldPlugin {
// ─── Required Metadata ──────────────────────────────
id = "my-data";
name = "My Data Layer";
description = "Displays custom points on the globe.";
icon = "MapPin"; // Lucide icon name (string)
category = "custom" as const;
version = "1.0.0";
// ─── Lifecycle ──────────────────────────────────────
async initialize(ctx: PluginContext): Promise<void> {
// Called once when the plugin is loaded.
// Use ctx.apiBaseUrl, ctx.timeRange, ctx.onDataUpdate, etc.
}
destroy(): void {
// Called when the plugin is unloaded. Clean up timers, sockets, etc.
}
// ─── Data ───────────────────────────────────────────
async fetch(timeRange: TimeRange): Promise<GeoEntity[]> {
// Fetch your data from an API and return GeoEntity objects.
const res = await fetch("https://api.example.com/points");
const data = await res.json();
return data.map((item: any) => ({
id: String(item.id),
pluginId: this.id,
latitude: item.lat,
longitude: item.lon,
altitude: 0,
timestamp: new Date(),
label: item.name,
properties: { type: item.type },
}));
}
getPollingInterval(): number {
return 60_000; // Re-fetch every 60 seconds
}
// ─── Rendering ──────────────────────────────────────
getLayerConfig(): LayerConfig {
return {
color: "#3b82f6",
clusterEnabled: true,
clusterDistance: 40,
maxEntities: 5000,
};
}
renderEntity(entity: GeoEntity): CesiumEntityOptions {
return {
type: "point",
color: "#3b82f6",
size: 8,
};
}
}
```
---
## Step 3 — Publish to npm
```bash
cd packages/wwv-plugin-my-data
pnpm publish --access public
```
> [!NOTE]
> The marketplace pulls metadata (version, description, keywords, readme) directly from the npm registry. You do not need to duplicate this information anywhere else.
---
## Step 4 — Submit to the Marketplace
Once your package is published to npm, submit it for listing in the WorldWideView Marketplace:
1. Go to [marketplace.worldwideview.dev/submit](https://marketplace.worldwideview.dev/submit) (or open the Admin UI on a local marketplace instance)
2. Enter your **npm package name** (e.g. `@worldwideview/wwv-plugin-my-data`)
3. The marketplace automatically fetches your metadata from npm and reads the `"worldwideview"` block from your `package.json`
4. Your plugin enters a **pending** state for review
5. Once approved, it appears in the browse catalog
> [!IMPORTANT]
> The `"worldwideview"` block in your `package.json` is required for submission. Make sure `id`, `icon`, `category`, and `format` are correctly set before publishing.
### For static format plugins
If your plugin uses `"format": "static"`, your **GeoJSON file** must be hosted and accessible at a public URL, or included in the `public/data/` folder of the host WorldWideView application. The `dataFile` path in your manifest should point to that URL.
If you are contributing a plugin for inclusion in the official WorldWideView release, place the GeoJSON at `public/data/<name>.geojson` and open a pull request.
---
## Step 5 — Test Locally
1. Start all WorldWideView services: `pnpm run dev:all` (in the monorepo root)
2. (Wait for both the main app and marketplace to start)
3. Open the marketplace at `http://localhost:3001/browse`
4. Find your plugin and click **Install**
5. Verify the data appears on the globe at `http://localhost:3000`
---
## SDK Interface Reference
The `WorldPlugin` interface requires these properties and methods:
### Required Properties
| Property | Type | Description |
|---|---|---|
| `id` | `string` | Unique plugin identifier (e.g., `"my-data"`) |
| `name` | `string` | Display name shown in the sidebar |
| `description` | `string` | Short description |
| `icon` | `string \| ComponentType` | Lucide icon name or React component |
| `category` | `PluginCategory` | One of: `aviation`, `maritime`, `conflict`, `natural-disaster`, `infrastructure`, `cyber`, `economic`, `custom` |
| `version` | `string` | Semver version string |
### Required Methods
| Method | Returns | Description |
|---|---|---|
| `initialize(ctx)` | `Promise<void>` | Set up the plugin. Receives `PluginContext` with API URLs, time range, callbacks |
| `destroy()` | `void` | Clean up resources (timers, sockets, etc.) |
| `fetch(timeRange)` | `Promise<GeoEntity[]>` | Return the data to display on the globe |
| `getPollingInterval()` | `number` | Milliseconds between `fetch()` calls |
| `getLayerConfig()` | `LayerConfig` | Layer appearance (color, clustering, limits) |
| `renderEntity(entity)` | `CesiumEntityOptions` | How each entity renders on the globe |
### Optional Methods
| Method | Returns | Description |
|---|---|---|
| `getSelectionBehavior(entity)` | `SelectionBehavior \| null` | Trail / fly-to on click |
| `getServerConfig()` | `ServerPluginConfig` | Server-side API routing |
| `getFilterDefinitions()` | `FilterDefinition[]` | Declarative filter UI |
| `getSidebarComponent()` | `ComponentType` | Custom sidebar panel |
| `getDetailComponent()` | `ComponentType<{ entity }>` | Custom detail panel |
| `getSettingsComponent()` | `ComponentType<{ pluginId }>` | Custom settings panel |
### Key Types
```typescript
interface GeoEntity {
id: string;
pluginId: string;
latitude: number;
longitude: number;
altitude?: number;
heading?: number;
speed?: number;
timestamp: Date;
label?: string;
properties: Record<string, unknown>;
}
interface LayerConfig {
color: string;
iconUrl?: string;
clusterEnabled: boolean;
clusterDistance: number;
minZoomLevel?: number;
maxEntities?: number;
}
interface CesiumEntityOptions {
type: "billboard" | "point" | "polyline" | "polygon" | "label" | "model";
color?: string;
size?: number;
iconUrl?: string;
rotation?: number;
modelUrl?: string;
modelScale?: number;
// ... more options
}
```
---
## Real Examples
### Borders Plugin (bundle format)
A minimal bundle plugin that implements the `WorldPlugin` interface directly:
- **Source**: `packages/wwv-plugin-borders/src/index.ts`
- **npm**: `@worldwideview/wwv-plugin-borders`
### Military Bases Plugin (static format)
A static GeoJSON plugin where the npm package is just metadata:
- **Source**: `packages/wwv-plugin-military-bases/src/index.ts`
- **GeoJSON**: `public/data/military_bases.geojson`
- **npm**: `@worldwideview/wwv-plugin-military-bases`
- **Manifest**: Defined in `worldwideview-marketplace/src/data/pluginManifests.ts`
---
## How It All Connects
```
Developer writes plugin
│
▼
Publish to npm ► npm registry (stores version, description, keywords, readme)
│
▼
Submit npm package name to Marketplace
│
▼
Marketplace fetches metadata from npm ← npm registry
and reads the "worldwideview" block from package.json
│
▼
Review → Plugin appears in browse catalog
│
▼
User clicks "Install"
│
▼
Marketplace sends manifest to WorldWideView instance
│
▼
Plugin saved to database (Prisma) → loaded on next startup
│
▼
loadPluginFromManifest() routes by format:
static → StaticDataPlugin (GeoJSON loader)
bundle → dynamic import()
│
▼
Plugin renders on the 3D globe
```
+34
View File
@@ -0,0 +1,34 @@
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# Deployment
## Overview
WorldWideView utilizes a containerized deployment strategy based on Docker's multi-stage builds. To minimize the footprint of the Next.js runtime, it leverages the Next.js `standalone` output trace, effectively dropping unnecessary development dependencies and generating a highly optimized Node.js artifact.
## Package Types
### Main Application
- **Build Output:** Located at `.next/standalone/`.
- **Static Assets:** Cesium static workers are injected at build time via `scripts/copy-cesium.mjs`.
### Plugin Microservices
- Standalone plugin backends (e.g., `wwv-plugin-iranwarlive/backend`) are isolated via individual `Dockerfile` configurations and orchestrated together in production using `docker-compose.yml`.
## Platform Deployment
### Coolify Integration
WorldWideView deploys optimally to Coolify using a Dockerfile builder.
- **Environment Variables:** Must be explicitly mapped in the Coolify UI (e.g., `DATABASE_URL`, `AUTH_SECRET`).
- **Persistent Storage:** SQLite requires a persistent volume mounted to `/app/data` to ensure the frontend registry (installed plugins, user configs) survives container rebuilds.
- **Microservices Deployment:** The `wwv-data-engine-internal` and associated plugin seeders are deployed as separate Coolify services communicating over private internal networks.
### Docker Structure
- **Dockerfile:** Found at the project root (`Dockerfile`). Uses an Extractor Pattern (`deps` → `builder` → `runner`). The `.git` and `node_modules` folders must be explicitly untracked to prevent cache overlap.
- **Compose:** Local multi-container emulation is handled via `docker-compose.yml`.
## Reference
- **Standalone Config:** `next.config.ts` (sets `output: "standalone"`).
- **Prisma Export:** `prisma.config.ts` ensures no CLI wrappers are invoked inside the standalone container, preventing fatal `MODULE_NOT_FOUND` runtime crashes.
- **Docker Mounts:**
- Main App: `/app/data` (SQLite DB)
- Data Engine: `/app/packages/wwv-data-engine/data` (SQLite DB)
- Cache: `/data` (Redis)
+73
View File
@@ -0,0 +1,73 @@
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# Development
## Overview
Development on WorldWideView prioritizes modularity, high performance, and strict architectural boundaries between the UI and the 3D rendering context. We adhere to rigorous file size constraints and rely heavily on Vanilla CSS and Zustand slice-patterns to maintain clarity across the large ecosystem.
## Code Style
### File Size Limits
- **Max 150 lines per file.** If a component or function grows beyond this, you must modularize it. Extract helper functions, split React components, and utilize custom hooks.
### Styling Conventions
- **Vanilla CSS Only:** Do not use Tailwind CSS or CSS-in-JS.
- **Global Styles:** Located at `src/app/globals.css`.
- **Component Styles:** Use CSS Modules (`.module.css`) or co-locate `.css` files directly next to their components.
- **HUD Animations:** Specialized interface animations are stored in `src/styles/hud-animations.css`.
### Import Aliases
- Application core: `@/*` → `./src/*`
- Plugin SDK: `@worldwideview/wwv-plugin-sdk` → `./packages/wwv-plugin-sdk/src`
- Custom plugins use their respective names configured in `tsconfig.json`.
## Common Patterns
### Entity Rendering
When translating raw plugin data into `CesiumEntityOptions` inside `renderEntity()`, follow these strict graphical rules:
```typescript
// Correct Point Pattern
renderEntity(entity: GeoEntity): CesiumEntityOptions {
return {
type: "point",
color: "#ff0000",
size: 10,
outlineColor: "#ffffff",
outlineWidth: 2
};
}
// Correct Billboard Pattern
renderEntity(entity: GeoEntity): CesiumEntityOptions {
return {
type: "billboard",
color: "#ffffff",
iconUrl: "/icons/aircraft.png",
iconScale: 0.5
};
}
```
> [!WARNING]
> **NEVER MIX PROPERTIES:** Do not apply `size`, `outlineWidth`, or `outlineColor` to a `billboard` entity. Mixing these parameters causes severe GPU clipping and rendering artifacts in Cesium.
### State Access
Zustand is divided into slices. For performance, components must select exactly the properties they need to avoid over-rendering:
```typescript
// From src/components/panels/LayerPanel.tsx
const activeLayers = useStore((state) => state.layers.active);
const toggleLayer = useStore((state) => state.layers.toggle);
```
## Workflows
### Debugging & Temporary Scripts
Whenever generating temporary debugging scripts, testing REST endpoints via `.mjs`, or dumping traces/JSON outputs, **save these exclusively inside `/local-scripts/`**.
- *Reference:* The root directory is strictly for production configuration files.
### Scaffold a New Component
1. Create a new directory under `src/components/{category}/MyComponent`.
2. Add `MyComponent.tsx` and `MyComponent.module.css`.
3. Export from a local `index.ts` if creating a composite view.
## Reference
- **Core Abstractions:** See `packages/wwv-plugin-sdk/src/PluginTypes.ts` for interface expectations.
- **State Slices:** Located in `src/core/state/` (e.g., `globeSlice.ts`, `dataSlice.ts`).
+33
View File
@@ -0,0 +1,33 @@
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# Files Catalog
## Overview
WorldWideView is structured as a pnpm monorepo. The primary application resides in the root `src/` directory, while external dependencies, plugins, and the core Plugin SDK are abstracted into the `packages/` directory.
The system is highly modularized to separate React UI rendering from heavy CesiumJS 3D operations and high-frequency real-time WebSocket state management.
## Core Source Files
- `src/app/` - The Next.js App Router entry points. Contains `layout.tsx` (the core React shell), `page.tsx` (the globe view), and `/api/` (server-side NextAuth and API handlers).
- `src/core/plugins/PluginManager.ts` - Central orchestration unit for dynamic plugins. Handles loading, lifecycle (`initialize`, `destroy`), and manifest resolution.
- `src/core/globe/GlobeView.tsx` - The primary CesiumJS container. It memoizes Zustand state to prevent heavy re-renders while injecting `EntityRenderer` primitives.
- `src/core/data/DataBus.ts` - Singleton pub/sub event bus handling all high-velocity WebSocket stream events without triggering React re-renders.
- `src/core/state/store.ts` - The primary Zustand state registry exporting all nine discrete slices (`globe`, `layers`, `timeline`, `ui`, `filter`, `data`, `config`, `favorites`, `geojson`).
## Platform Implementation
- `src/core/plugins/loaders/InstalledPluginsLoader.ts` - Platform-specific loader that dynamically injects ES module CDNs via `import(/* webpackIgnore: true */)`.
- `src/core/globe/hooks/useCameraActions.ts` - Abstraction connecting React UI logic to raw CesiumJS camera math (flyTo, lookAt).
- `src/lib/edition.ts` - Platform edition configuration. Exposes runtime feature flags for `local`, `cloud`, and `demo` deployments.
## Build System
- `package.json` - Root monorepo configuration with `pnpm` workspace bindings.
- `next.config.ts` - Next.js compiler settings, security headers, and standalone output configuration.
- `docker-compose.yml` - Defines the orchestration of the frontend, Redis cache, and all local plugin microservice backends (`wwv-data-engine`).
## Configuration
- `prisma/schema.prisma` - Local SQLite and cloud PostgreSQL database schema for storing user settings and installed plugin manifests.
- `scripts/copy-cesium.mjs` - Crucial build-time script that extracts and copies CesiumJS static web workers to `public/cesium/`.
- `public/` - Static assets, plugin icons, and compiled Cesium workers.
## Reference
- **Plugins Directory:** All plugins conform to the `@worldwideview/wwv-plugin-sdk` interface and are developed inside `packages/wwv-plugin-<name>/`.
- **Microservices Directory:** Standalone Fastify backends are nested within `packages/wwv-plugin-<name>/backend/`.
+328
View File
@@ -0,0 +1,328 @@
<!-- Generated: 2026-04-23 20:29:00 UTC -->
# End-to-End Tutorial: Building a Real-Time ISS Tracking Plugin
Welcome! This tutorial is designed for complete beginners. If you have never built a WorldWideView plugin before, you are in the right place.
By following these steps exactly, you will build a complete, real-time International Space Station (ISS) tracker from scratch. You will learn how to set up your environment, stream live data using a backend seeder, render it in 3D on the globe, and publish your work to the world.
Let's get started.
---
## Step 1: Setting up your Workspace
Before we write any code, we need to prepare your computer. We will install the required tools and download the two main repositories that make up the WorldWideView platform.
### 1.1 Install Prerequisites
Ensure you have the following installed on your machine:
1. **Node.js**: Download and install [Node.js](https://nodejs.org/) (Version 18 or higher is required).
2. **Git**: Download and install [Git](https://git-scm.com/).
3. **pnpm**: This is the package manager we use. Open your terminal and run:
```bash
npm install -g pnpm
```
### 1.2 Clone the Repositories
You need both the frontend application and the backend data engine. Open your terminal and navigate to the folder where you want to store your code (e.g., `C:\dev`).
Run these commands to download the code:
```bash
git clone https://github.com/silvertakana/worldwideview.git
git clone https://github.com/silvertakana/wwv-data-engine.git
```
### 1.3 Install Dependencies
Next, we need to install the libraries that these projects depend on.
First, install dependencies for the Data Engine:
```bash
cd wwv-data-engine
pnpm install
```
Second, install dependencies for the main WorldWideView application:
```bash
cd ../worldwideview
pnpm install
```
### 1.4 Setup Environment Variables
WorldWideView needs a few basic configuration keys to run.
While still in the `worldwideview` folder, run the automated setup script. This will generate a `.env.local` file with the necessary secrets:
```bash
pnpm run setup
```
Your workspace is now ready!
---
## Step 2: Creating the Data Engine Seeder (Backend)
The ISS moves incredibly fast. If our frontend tries to ask for its location every second, it will lag. Instead, we use the **Bring Your Own Backend (BYOB)** pattern. We will write a "Seeder" script in the Data Engine that fetches the ISS location and instantly broadcasts it to the frontend via WebSockets.
### 2.1 Create the Seeder File
Navigate to your data engine repository and create a new file named `iss.ts` in the `src/seeders` folder:
`c:\dev\wwv-data-engine\src\seeders\iss.ts`
### 2.2 Write the Polling Logic
Open `iss.ts` in your text editor and paste the following code. This script reaches out to the free WhereTheISS.at API every 5 seconds and saves the data to the engine's memory (Redis).
```typescript
import { setLiveSnapshot } from '../core/redis';
import axios from 'axios';
const WTIA_URL = 'https://api.wheretheiss.at/v1/satellites/25544';
const POLLING_INTERVAL = 5000; // 5 seconds
async function pollISS() {
try {
// 1. Fetch data from the API
const response = await axios.get(WTIA_URL);
const data = response.data;
// 2. Format the data into a GeoEntity object
const stateObj = {
id: 25544,
name: "International Space Station",
latitude: data.latitude,
longitude: data.longitude,
altitude: data.altitude * 1000, // Convert kilometers to meters
velocity: data.velocity,
visibility: data.visibility,
footprint: data.footprint
};
// 3. Save to Redis under the 'iss' namespace for 60 seconds
await setLiveSnapshot('iss', { "25544": stateObj }, 60);
console.log(`[ISS] Poll OK: updated position to ${data.latitude}, ${data.longitude}`);
} catch (error) {
console.error(`[ISS] Polling error:`, error.message);
} finally {
// 4. Repeat the process after 5 seconds
setTimeout(pollISS, POLLING_INTERVAL);
}
}
// Start the loop
pollISS();
```
### 2.3 Register the Seeder
The engine needs to know your seeder exists. Open `c:\dev\wwv-data-engine\src\seeders\index.ts` and add this line at the bottom:
```typescript
import './iss';
```
---
## Step 3: Testing the Data Engine
Before we build the frontend, let's prove that our backend is actually fetching the ISS data.
### 3.1 Start the Engine
In your terminal, navigate to the `wwv-data-engine` folder and start the backend:
```bash
pnpm dev:backends
```
You should see `[ISS] Poll OK: updated position` appearing in your console every 5 seconds. Leave this terminal running.
### 3.2 Write a Quick Test Script
Open a *new* terminal window. Let's write a tiny script to peek into the engine's memory. Create a file called `test_iss.mjs` in the `wwv-data-engine` folder:
```javascript
// test_iss.mjs
import Redis from 'ioredis';
const redis = new Redis();
async function verify() {
const data = await redis.get('data:iss:live');
if (data) {
console.log("Success! We found the ISS:", JSON.parse(data));
} else {
console.log("No data found yet.");
}
process.exit(0);
}
verify();
```
Run the script:
```bash
node test_iss.mjs
```
If you see a large block of data containing coordinates and altitude, your backend is working perfectly!
---
## Step 4: Creating the WorldWideView Plugin (Frontend)
Now we will build the visual part of the plugin that connects to our backend stream and draws the ISS on the 3D globe.
### 4.1 Scaffold the Plugin
In your terminal, navigate back to your main `c:\dev` folder. We will use the official CLI tool to generate a blank plugin template. Run:
```bash
npx @worldwideview/create-plugin@latest wwv-plugin-iss
```
When prompted, name the folder `wwv-plugin-iss`.
Move into your new plugin folder and install its dependencies:
```bash
cd wwv-plugin-iss
npm install
```
### 4.2 Write the Plugin Logic
Open `c:\dev\wwv-plugin-iss\src\index.ts` in your text editor. Replace everything in the file with this code:
```typescript
import type { WorldPlugin, GeoEntity, PluginContext, LayerConfig, CesiumEntityOptions } from "@worldwideview/wwv-plugin-sdk";
export class IssPlugin implements WorldPlugin {
// The ID MUST match the namespace we used in the backend ('iss')
id = "iss";
name = "ISS Live Tracker";
description = "Real-time International Space Station tracking.";
icon = "Satellite";
category = "space" as const;
version = "1.0.0";
async initialize(ctx: PluginContext): Promise<void> {
console.log("ISS Plugin loaded!");
}
destroy(): void { }
async fetch(): Promise<GeoEntity[]> {
// We return an empty array because the WebSockets handle the data automatically.
return [];
}
getPollingInterval(): number {
return 0; // Disabled: we use continuous WebSockets instead of polling.
}
getLayerConfig(): LayerConfig {
return {
color: "#00ffcc",
clusterEnabled: false
};
}
renderEntity(entity: GeoEntity): CesiumEntityOptions {
// Level of Detail (LOD): Use a 2D billboard from far away,
// and transition to a 3D model when zooming in close.
return {
type: "billboard",
color: "#ffffff",
iconUrl: "https://unpkg.com/wwv-plugin-iss/assets/iss-icon.png",
iconScale: 0.8,
modelUrl: "https://unpkg.com/wwv-plugin-iss/assets/ISS_stationary.glb",
modelScale: 2.5,
heading: entity.heading || 0,
};
}
}
```
---
## Step 5: Connecting and Testing Everything
Now we will link your new plugin to your local WorldWideView application to see it in action.
### 5.1 Link the Plugin
In your `wwv-plugin-iss` terminal, tell the CLI where your main WorldWideView folder is:
```bash
npx wwv config set wwv-path C:\dev\worldwideview
```
Now, link the plugin. This creates a shortcut so WorldWideView can see your code:
```bash
npm run link
```
Start the plugin watcher. This will automatically update your plugin if you make any changes to the code:
```bash
npm run dev
```
Leave this terminal running.
### 5.2 Start WorldWideView
Open a third, final terminal window. Navigate to your main `worldwideview` folder and start the frontend application:
```bash
cd C:\dev\worldwideview
pnpm dev
```
### 5.3 View the ISS
1. Open your web browser and go to `http://localhost:3000`.
2. Click the **Layers** icon on the left sidebar.
3. Find **ISS Live Tracker** in the list and toggle it ON.
4. The globe will instantly fly to the current location of the ISS, and you will see it moving in real-time!
> [!TIP]
> **Troubleshooting missing points:**
> - Ensure your Data Engine terminal (`pnpm dev:backends`) is still running.
> - Press `F12` in your browser to open Developer Tools. Check the `Console` tab for any red errors.
> - Ensure the `id` in your plugin (`"iss"`) exactly matches the name you used in the backend `setLiveSnapshot('iss', ...)`.
---
## Step 6: Publishing Your Plugin
You've built it, now share it with the world!
### 6.1 Update package.json
Open `c:\dev\wwv-plugin-iss\package.json`. You must add a `"worldwideview"` metadata block so the marketplace knows how to read your plugin. Ensure your file looks like this:
```json
{
"name": "wwv-plugin-iss",
"version": "1.0.0",
"main": "dist/index.js",
"worldwideview": {
"id": "iss",
"name": "ISS Live Tracker",
"version": "1.0.0",
"icon": "Satellite",
"category": "space"
},
"scripts": { ... }
}
```
### 6.2 Publish to NPM
In your plugin terminal, log in to NPM and publish your package:
```bash
npm login
npm publish --access public
```
### 6.3 Submit to the Marketplace
1. Go to the official marketplace at `https://marketplace.worldwideview.dev/submit`.
2. Type in your package name (`wwv-plugin-iss`) and click submit.
3. The system will automatically verify your code. Once approved, any WorldWideView user on the planet can click "Install" to add your ISS tracker to their globe.
**Congratulations!** You have successfully navigated the entire stack, from API polling and WebSockets to 3D rendering and global publishing.
+80
View File
@@ -0,0 +1,80 @@
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# Advanced Plugin Guide
This guide covers complex architectures, real-time telemetry streaming, and the deployment lifecycle for WorldWideView plugins. If you haven't built a basic plugin yet, start with the **[Quickstart](plugin-quickstart.md)**.
## Architecture Paradigm: The All-Bundle Model
WorldWideView operates on a strict **Dynamic CDN Loaded (Bundle)** architecture.
> [!WARNING]
> **Deprecation Notice:** The legacy `StaticDataPlugin` (GeoJSON loaders) and `DeclarativePlugin` runtimes are fully deprecated. All new plugins must be dynamically imported at runtime as ES module bundles via `import(/* webpackIgnore: true */ entry)`.
### How Plugins Load
1. A user clicks "Install" in the **Marketplace**.
2. The marketplace sends the plugin manifest (containing an ES Module CDN URL, like `unpkg.com`) to the WorldWideView database.
3. At runtime, the `InstalledPluginsLoader` dynamically fetches the JavaScript bundle.
4. The plugin is instantiated, and its `initialize(ctx)` method is invoked.
## Real-Time Data: Bring Your Own Backend (BYOB)
Relying on the frontend `fetch()` method is insufficient for high-frequency real-time tracking (like aviation or maritime). For continuous telemetry, you must build a **Data Engine Seeder** — a containerized backend microservice.
### Microservice Seeder Architecture
Instead of the frontend fetching data, your backend container connects to an upstream source, normalizes the data, and publishes it to the central Redis stream managed by `wwv-data-engine`.
1. **Scaffold a Backend:** Use the CLI to generate a backend template.
```bash
npx @worldwideview/cli create-backend my-plugin-backend
```
2. **Containerize:** This generates a Fastify Node.js server with a `Dockerfile` and `docker-compose.yml`.
3. **Publish to Redis:** Your backend polls the external API (e.g., ADS-B Exchange) and pushes snapshots to the WorldWideView Redis pipeline.
4. **WebSocket Delivery:** The central `wwv-data-engine` immediately broadcasts these updates over WebSockets to all connected clients.
> [!TIP]
> **Debugging WebSockets:** If your frontend isn't receiving data from your backend seeder:
> 1. Check the `wwv-data-engine` logs to ensure your seeder is publishing to Redis successfully.
> 2. Verify the frontend is connected to the correct WebSocket endpoint. Local instances default to `ws://localhost:5001/stream`, while unrecognized seeders fall back to the cloud at `wss://dataengine.worldwideview.dev/stream`.
## Advanced Cesium Rendering
When returning `CesiumEntityOptions` in `renderEntity(entity)`, you have direct access to the 3D engine's capabilities.
### 3D Models vs. Billboards (LOD Strategy)
To maintain 60 FPS with tens of thousands of entities, use WorldWideView's Level of Detail (LOD) promotion system.
- Render distant entities as simple `billboard` or `point` primitives.
- When the camera gets close, the system's `useModelRendering` hook can promote the entity to a full 3D glTF model.
```typescript
renderEntity(entity: GeoEntity): CesiumEntityOptions {
return {
type: "billboard", // Primary lightweight renderer
color: "#ffffff",
iconUrl: "https://unpkg.com/my-plugin/assets/icon.png",
iconScale: 0.5,
// Provide a 3D model URL. The engine will swap it in automatically at close range.
modelUrl: "https://unpkg.com/my-plugin/assets/model.glb",
modelScale: 1.0,
heading: entity.heading,
};
}
```
> [!CAUTION]
> **GPU Clipping Bug:** NEVER mix `size`, `outlineWidth`, or `outlineColor` properties onto an entity of `type: "billboard"`. This will cause the WebGL compiler to panic and result in severe visual clipping artifacts.
## Publishing to the Marketplace
To distribute your plugin globally:
1. **Publish to NPM:**
```bash
npm publish --access public
```
2. **Submit:** Navigate to `https://marketplace.worldwideview.dev/submit`.
3. **Register:** Enter your NPM package name. The marketplace automatically scrapes your `package.json` for the required `"worldwideview"` object block (containing your `id`, `icon`, and `category`).
4. **Review:** Once approved, your plugin's ES Module bundle will be served via CDN to all WorldWideView instances worldwide.
### Debugging Marketplace Submissions
- **"Invalid Manifest" Error:** Ensure you are using `@worldwideview/wwv-plugin-sdk` as a `peerDependency` (not a direct dependency) so the host application injects the context correctly.
- **Icon Not Showing:** Icons must be valid Lucide icon strings (e.g., `"Plane"`, `"Anchor"`).
+126
View File
@@ -0,0 +1,126 @@
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# Quickstart: Creating Your First Plugin
Welcome to WorldWideView plugin development! This tutorial will guide you through creating your first custom data layer on the 3D globe.
By the end of this guide, you will have a working plugin that plots real-time data on the WorldWideView map.
## 1. Prerequisites
Before you start, ensure you have:
- Node.js ≥ 18
- `npm` or `pnpm` installed
- A running instance of WorldWideView on your local machine (running at `http://localhost:3000`).
## 2. Scaffold Your Plugin
WorldWideView plugins are built as standard NPM packages. They are entirely decoupled from the core application, allowing you to develop and publish them independently.
To generate a new plugin template, use the official CLI:
```bash
npx @worldwideview/create-plugin@latest my-first-plugin
cd my-first-plugin
npm install
```
This creates a lightweight Vite-based project pre-configured with the `@worldwideview/wwv-plugin-sdk`.
## 3. Link Your Plugin to WorldWideView
To see your plugin live on the globe while you develop, you need to link it to your local WorldWideView instance.
First, tell the CLI where your WorldWideView repository is located:
```bash
npx wwv config set wwv-path C:\path\to\your\worldwideview
```
Next, link the plugin. This creates a symlink so your local WorldWideView instance can dynamically load your code:
```bash
npm run link
```
Finally, start the plugin watcher. This will automatically rebuild your plugin whenever you save a file:
```bash
npm run dev
```
> [!TIP]
> **Debugging Link Issues:** If your plugin doesn't appear in the WorldWideView "Installed Plugins" list after linking, check your `package.json`. The `"worldwideview"` object block is strictly required. Ensure `id`, `name`, and `version` are populated correctly.
## 4. Explore the Code
Open `src/index.ts` in your text editor. You'll see a class that implements the `WorldPlugin` interface:
```typescript
import type { WorldPlugin, GeoEntity, PluginContext, LayerConfig, CesiumEntityOptions } from "@worldwideview/wwv-plugin-sdk";
export class MyFirstPlugin implements WorldPlugin {
id = "my-first-plugin";
name = "My First Data Layer";
description = "A simple example plugin.";
icon = "MapPin";
category = "custom" as const;
version = "1.0.0";
async initialize(ctx: PluginContext): Promise<void> {
console.log("Plugin initialized!");
}
destroy(): void { }
async fetch(timeRange: TimeRange): Promise<GeoEntity[]> {
// Generate a single dummy point over Paris
return [{
id: "test-point-1",
pluginId: this.id,
latitude: 48.8566,
longitude: 2.3522,
timestamp: new Date(),
properties: { name: "Hello World" },
}];
}
getPollingInterval(): number {
return 60_000; // Fetch every 60 seconds
}
getLayerConfig(): LayerConfig {
return {
color: "#ff0000",
clusterEnabled: false,
clusterDistance: 40,
};
}
renderEntity(entity: GeoEntity): CesiumEntityOptions {
return {
type: "point",
color: "#ff0000",
size: 15,
outlineColor: "#ffffff",
outlineWidth: 2
};
}
}
```
## 5. View Your Plugin
1. Ensure your WorldWideView main application is running (`pnpm dev` or `pnpm dev:all` in the main repo).
2. Open your browser to `http://localhost:3000`.
3. Open the **Layers** panel on the left sidebar.
4. Locate "My First Data Layer" and toggle it on.
5. The globe will fly to Paris, and you should see a red dot!
> [!WARNING]
> **Debugging Missing Points:** If the layer is toggled on but you don't see the point:
> 1. Check your browser's Developer Console (F12) for any `DataBus` errors.
> 2. Ensure your `fetch()` method returns an array of `GeoEntity` objects with valid `latitude` and `longitude` properties.
> 3. Verify that your `renderEntity()` function returns a valid type (`point`, `billboard`, etc.).
## Next Steps
Congratulations! You've successfully built and linked your first plugin.
For advanced features—like real-time WebSocket streaming, containerizing your own backend microservices, or publishing your plugin to the global Marketplace—proceed to the **[Advanced Plugin Guide](docs/plugin-advanced.md)**.
+28
View File
@@ -0,0 +1,28 @@
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# Project Overview
WorldWideView is a real-time geospatial intelligence engine that visualizes live global data on an interactive 3D globe. It leverages a modern frontend stack to render high-density datasets synchronously, including aircraft, maritime vessels, conflict events, satellites, and environmental data.
The core value proposition of WorldWideView is mapping diverse, decoupled intelligence streams onto a central geographic interface using a dynamically loaded plugin architecture. Data sources operate completely decoupled from the display platform, streaming observations via WebSockets for sub-second visual updates. The ecosystem consists of multiple repositories, including the main app (`worldwideview`), the plugin marketplace (`worldwideview-marketplace`), and the WebSocket push server (`wwv-data-engine`).
## Key Files
- `package.json` (Lines 1-76) - Core dependencies and project metadata for the monorepo workspace.
- `src/app/layout.tsx` - Global application shell and React structure.
- `src/core/plugins/PluginManager.ts` - Heart of the engine, registers and lifecycle-manages external intelligence views.
- `src/core/globe/GlobeView.tsx` - Main Cesium globe component rendering.
## Technology Stack
- **Framework:** Next.js 16 (App Router) — `src/app/`
- **Language:** TypeScript 5 (Strict Mode) — `tsconfig.json`
- **3D Engine:** CesiumJS + Resium (Google Photorealistic 3D Tiles) — `src/core/globe/GlobeView.tsx`
- **State Management:** Zustand — `src/core/state/` (slice-based store)
- **Event Bus:** Custom typed `DataBus` — `src/core/data/DataBus.ts`
- **Database:** SQLite via Prisma (local), PostgreSQL (cloud) — `prisma/schema.prisma`
- **Styling:** Vanilla CSS (no Tailwind) — `src/app/globals.css`
## Platform Support
Built as a highly portable Next.js container, it supports multiple deployment profiles controlled by `NEXT_PUBLIC_WWV_EDITION` (default: `local`).
- **Local (`local`)**: Self-hosted, full features, auth enabled.
- **Cloud (`cloud`)**: Managed cloud instance, full features.
- **Demo (`demo`)**: Public demo, auth disabled, optional admin via `WWV_DEMO_ADMIN_SECRET`.
Feature flags are evaluated at runtime in `src/core/edition.ts`.
+42
View File
@@ -0,0 +1,42 @@
<!-- Generated: 2026-04-23 06:11:00 UTC -->
# Testing
## Overview
WorldWideView utilizes Vitest alongside a `jsdom` environment and the React Testing Library to ensure high reliability across core application logic, server APIs, and plugin loaders. Test coverage is strategically focused on shared libraries, core state logic, and the plugin ecosystem mechanisms.
## Test Types
### Unit Tests
Focused on validating standalone functions and state slice reducers without mounting React components.
- **Example:** Validating the runtime edition feature flags.
- *File:* `src/core/edition.test.ts`
- **Example:** Validating marketplace token exchanges and rate limiting logic.
- *Files:* `src/lib/marketplaceToken.test.ts`, `src/lib/rateLimit.test.ts`
### Integration Tests
Focused on ensuring module interaction, such as the event bus properly interacting with state, or plugin loaders successfully resolving manifests.
- **Example:** Testing local database repositories.
- *File:* `src/lib/repository.test.ts`
- **Example:** Validating cross-origin resource sharing (CORS) handlers for data engine streaming.
- *File:* `src/lib/cors.test.ts`
- **Example:** Verifying demo-admin bypass secrets.
- *File:* `src/lib/demoAdmin.test.ts`
## Running Tests
Execute the following commands from the root `worldwideview` directory:
- **Run all tests once:**
```bash
pnpm test
```
*(Alias for `vitest run`)*
- **Run tests in watch mode (for active development):**
```bash
npx vitest
```
## Reference
- **Coverage Scope:** The Vitest configuration primarily targets tests located inside `src/lib/**`, `src/core/**`, and `src/plugins/**`.
- **Environment:** The test environment is configured as `jsdom` via `vite.config.ts` or `vitest.config.ts`, ensuring that DOM-specific API calls function outside of a real browser.
+6
View File
@@ -0,0 +1,6 @@
const { PrismaClient } = require('./src/generated/prisma');
const prisma = new PrismaClient();
prisma.installedPlugin.findMany().then(r => console.log(JSON.stringify(r.map(record => {
const manifest = JSON.parse(record.config);
return { id: manifest.id, entry: manifest.entry, format: manifest.format };
}), null, 2))).catch(console.error).finally(() => prisma.$disconnect());
+9
View File
@@ -0,0 +1,9 @@
import sqlite3
import json
conn = sqlite3.connect('data/wwv.db')
cursor = conn.cursor()
cursor.execute('SELECT id, dataSource FROM installed_plugins')
rows = cursor.fetchall()
for r in rows:
if r[1]:
print(f"plugin={r[0]}, dataSource={r[1]}")
-1
View File
@@ -1 +0,0 @@
docker run --rm -v nmn55t4io3myfubs72worn7k_wwv-data:/data nouchka/sqlite3 /data/wwv.db "UPDATE InstalledPlugin SET config = json_set(config, '$.format', 'static', '$.dataFile', 'https://cdn.jsdelivr.net/npm/@worldwideview/[email protected]/data/military-bases.geojson') WHERE pluginId = 'military-bases';"
+37
View File
@@ -0,0 +1,37 @@
Write-Host "[*] Setting up WorldWideView for Local Development..."
# Check for pnpm
try {
$null = Get-Command pnpm -ErrorAction Stop
} catch {
Write-Host "[Error] pnpm is not installed or not in PATH."
Write-Host "Please install it first: https://pnpm.io/installation"
exit 1
}
Write-Host "[*] Installing dependencies..."
pnpm install
Write-Host "[*] Running initial setup (generating secrets)..."
pnpm run setup
# Check for the sibling Data Engine repository
if (-not (Test-Path "../wwv-data-engine")) {
Write-Host ""
Write-Host "=====================================================================" -ForegroundColor Yellow
Write-Host "[!] NOTICE: Local Data Engine not found at ../wwv-data-engine" -ForegroundColor Yellow
Write-Host ""
Write-Host "Frontend-Only Mode: You are developing the frontend UI." -ForegroundColor Green
Write-Host "WorldWideView will automatically stream data from the Cloud Engine." -ForegroundColor Green
Write-Host ""
Write-Host "Full-Stack Mode: If you want to develop backend data seeders, you" -ForegroundColor Cyan
Write-Host "must clone the open-source data engine as a sibling directory:" -ForegroundColor Cyan
Write-Host " cd ..; git clone https://github.com/silvertakana/wwv-data-engine"
Write-Host " cd wwv-data-engine; pnpm install"
Write-Host "=====================================================================" -ForegroundColor Yellow
Write-Host ""
}
Write-Host "[*] Starting local Next.js frontend server..."
Write-Host " (To run the data engine backends concurrently, run: pnpm dev:all)"
pnpm run dev
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
set -e
echo "🌍 Setting up WorldWideView for Local Development..."
# Check for pnpm
if ! command -v pnpm &> /dev/null; then
echo "❌ Error: pnpm is required but not installed."
echo "Please install it first: https://pnpm.io/installation"
exit 1
fi
echo "📦 Installing dependencies..."
pnpm install
echo "🔐 Running initial setup (generating secrets)..."
pnpm run setup
# Check for the sibling Data Engine repository
if [ ! -d "../wwv-data-engine" ]; then
echo ""
echo "====================================================================="
echo "⚠️ NOTICE: Local Data Engine not found at ../wwv-data-engine"
echo ""
echo "Frontend-Only Mode: You are developing the frontend UI."
echo "WorldWideView will automatically stream data from the Cloud Engine."
echo ""
echo "Full-Stack Mode: If you want to develop backend data seeders, you"
echo "must clone the open-source data engine as a sibling directory:"
echo " cd .. && git clone https://github.com/silvertakana/wwv-data-engine"
echo " cd wwv-data-engine && pnpm install"
echo "====================================================================="
echo ""
fi
echo "🚀 Starting local Next.js frontend server..."
echo " (To run the data engine backends concurrently, run: pnpm dev:all)"
pnpm run dev
+3 -5
View File
@@ -3,10 +3,8 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
serverExternalPackages: ["better-sqlite3", "@prisma/adapter-better-sqlite3", "@prisma/client", "prisma"],
transpilePackages: ["@worldwideview/wwv-plugin-sdk","resium",
"react-player",
"satellite.js"
],
transpilePackages: ["@worldwideview/wwv-plugin-sdk", "resium", "react-player", "satellite.js"],
allowedDevOrigins: process.env.ALLOWED_DEV_ORIGIN ? [process.env.ALLOWED_DEV_ORIGIN] : undefined,
experimental: {
memoryBasedWorkersCount: true,
cpus: 2,
@@ -25,7 +23,7 @@ const nextConfig: NextConfig = {
value: [
"default-src 'self'",
// CesiumJS requires unsafe-eval (worker compilation) and unsafe-inline (styles)
"script-src 'self' 'unsafe-eval' 'unsafe-inline' blob: https://cdn.jsdelivr.net https://analytics.worldwideview.dev https://va.vercel-scripts.com https://pagead2.googlesyndication.com https://adservice.google.com https://www.googletagservices.com https://ep2.adtrafficquality.google https://static.cloudflareinsights.com",
"script-src 'self' 'unsafe-eval' 'unsafe-inline' blob: https://unpkg.com https://cdn.jsdelivr.net https://analytics.worldwideview.dev https://va.vercel-scripts.com https://pagead2.googlesyndication.com https://adservice.google.com https://www.googletagservices.com https://ep2.adtrafficquality.google https://static.cloudflareinsights.com",
"style-src 'self' 'unsafe-inline' fonts.googleapis.com",
"font-src 'self' fonts.gstatic.com",
// Camera streams load images/MJPEG from arbitrary IPs worldwide — http: https: required
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "worldwideview",
"version": "1.13.4",
"version": "1.20.0",
"private": true,
"scripts": {
"setup": "node scripts/setup.mjs",
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../dist/index.js');
+24
View File
@@ -0,0 +1,24 @@
{
"name": "@worldwideview/cli",
"version": "1.0.0",
"bin": {
"wwv": "./bin/wwv.js"
},
"scripts": {
"build": "tsc",
"test": "vitest run"
},
"dependencies": {
"archiver": "^7.0.1",
"commander": "^11.1.0",
"vite": "^8.0.8",
"ws": "^8.20.0"
},
"devDependencies": {
"@types/archiver": "^7.0.0",
"@types/node": "^20.0.0",
"@types/ws": "^8.18.1",
"typescript": "^5.0.0",
"vitest": "^1.0.0"
}
}
+64
View File
@@ -0,0 +1,64 @@
import fs from "fs";
import path from "path";
export async function createPlugin(name: string, basePath: string = process.cwd()) {
const targetDir = path.join(basePath, name);
if (fs.existsSync(targetDir)) {
throw new Error(`Directory ${name} already exists`);
}
fs.mkdirSync(targetDir, { recursive: true });
fs.mkdirSync(path.join(targetDir, "src"), { recursive: true });
const manifest = {
manifest_version: 1,
id: name,
name: name,
version: "1.0.0",
description: "A WorldWideView plugin",
type: "data-layer",
category: "custom",
icon: "Box",
capabilities: ["data:own"],
entry: "dist/frontend.mjs",
dev_entry: "src/index.ts"
};
fs.writeFileSync(
path.join(targetDir, "wwv-manifest.json"),
JSON.stringify(manifest, null, 2)
);
const indexContent = `export default class MyPlugin {
id = "${name}";
name = "${name}";
version = "1.0.0";
category = "custom";
icon = "Box";
async initialize(ctx) {
console.log("Initialized", this.id);
}
destroy() {}
async fetch(timeRange) {
return [];
}
getPollingInterval() {
return 5000;
}
getLayerConfig() {
return { color: "#3b82f6", clusterEnabled: true, clusterDistance: 50 };
}
renderEntity(entity) {
return { type: "point", color: "#3b82f6", size: 6 };
}
}
`;
fs.writeFileSync(path.join(targetDir, "src", "index.ts"), indexContent);
console.log(`Plugin ${name} scaffolded successfully in ./${name}`);
}
+61
View File
@@ -0,0 +1,61 @@
import fs from "fs";
import path from "path";
import { createServer } from "vite";
import { WebSocketServer } from "ws";
export async function startDevServer(targetUrl: string = "http://localhost:3000") {
const cwd = process.cwd();
const manifestPath = path.join(cwd, "wwv-manifest.json");
if (!fs.existsSync(manifestPath)) {
throw new Error("No wwv-manifest.json found in current directory");
}
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
const port = 24601;
// Start Vite Dev Server
const vite = await createServer({
root: cwd,
server: { port, cors: true, hmr: false }, // We handle HMR via custom WS
plugins: [{
name: 'wwv-hmr',
handleHotUpdate({ server }: any) {
// When Vite detects file changes, broadcast to our custom WS
wss.clients.forEach(client => {
client.send(JSON.stringify({ type: "plugin:updated", pluginId: manifest.id }));
});
return []; // Prevent default Vite HMR
}
}]
});
await vite.listen();
// Attach custom WebSocket server for WWV DevModeSubscriber
const wss = new WebSocketServer({ server: vite.httpServer as any, path: "/__wwv_dev__" });
wss.on("connection", (ws) => {
console.log(`[WWV CLI] Connected to WorldWideView instance`);
ws.send(JSON.stringify({ type: "plugin:added", manifest }));
});
// Notify WorldWideView via API
try {
await fetch(`${targetUrl}/api/dev/load-unpacked`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
...manifest,
entry: `http://localhost:${port}/${manifest.dev_entry || "src/index.ts"}`
})
});
console.log(`[WWV CLI] Registered with WorldWideView at ${targetUrl}`);
} catch (err: any) {
console.error(`[WWV CLI] Failed to connect to ${targetUrl}: ${err.message}`);
console.log(`Waiting for WorldWideView to connect via WebSocket...`);
}
console.log(`\n🚀 Dev server running on http://localhost:${port}`);
console.log(`Watching for file changes in ${cwd}...\n`);
}
+57
View File
@@ -0,0 +1,57 @@
import fs from "fs";
import path from "path";
import { build } from "vite";
import archiver from "archiver";
export async function packagePlugin() {
const cwd = process.cwd();
const manifestPath = path.join(cwd, "wwv-manifest.json");
if (!fs.existsSync(manifestPath)) {
throw new Error("No wwv-manifest.json found in current directory");
}
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
console.log(`[WWV CLI] Building production bundle...`);
await build({
root: cwd,
build: {
lib: {
entry: path.resolve(cwd, manifest.dev_entry || "src/index.ts"),
name: 'WWVPlugin',
formats: ['es'],
fileName: () => 'frontend.mjs'
},
outDir: 'dist',
emptyOutDir: true
}
});
const pkgName = `${manifest.id}-${manifest.version}.wwvpkg`;
const outputPath = path.join(cwd, pkgName);
console.log(`[WWV CLI] Creating archive ${pkgName}...`);
await new Promise<void>((resolve, reject) => {
const output = fs.createWriteStream(outputPath);
const archive = archiver("zip", { zlib: { level: 9 } });
output.on("close", () => resolve());
archive.on("error", (err) => reject(err));
archive.pipe(output);
archive.file(manifestPath, { name: "wwv-manifest.json" });
archive.directory(path.join(cwd, "dist"), "dist");
if (fs.existsSync(path.join(cwd, "data"))) {
archive.directory(path.join(cwd, "data"), "data");
}
archive.finalize();
});
console.log(`\n🎉 Success! Package created at ${outputPath}`);
console.log(`You can use this file to sideload the plugin into your WWV instance.`);
}
+72
View File
@@ -0,0 +1,72 @@
import fs from "fs";
import path from "path";
import { build } from "vite";
import { execSync } from "child_process";
export async function publishToNpm() {
const cwd = process.cwd();
const manifestPath = path.join(cwd, "wwv-manifest.json");
if (!fs.existsSync(manifestPath)) {
throw new Error("No wwv-manifest.json found in current directory");
}
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
console.log(`[WWV CLI] Compiling bundle for NPM...`);
await build({
root: cwd,
build: {
lib: {
entry: path.resolve(cwd, manifest.dev_entry || "src/index.ts"),
name: 'WWVPlugin',
formats: ['es'],
fileName: () => 'frontend.mjs'
},
outDir: 'dist',
emptyOutDir: true
}
});
console.log(`[WWV CLI] Generating package.json...`);
// Create a temporary package.json required for NPM publish
const packageJsonPath = path.join(cwd, "package.json");
const packageJson = {
name: manifest.id, // e.g. @username/my-plugin
version: manifest.version,
description: manifest.description,
main: "dist/frontend.mjs",
type: "module",
files: ["dist", "wwv-manifest.json", "data"],
keywords: ["worldwideview", "plugin", manifest.category],
author: manifest.author || ""
};
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
console.log(`[WWV CLI] Publishing to NPM...`);
try {
execSync(`npm publish --access public`, { stdio: "inherit", cwd });
} catch (err) {
console.error(`[WWV CLI] NPM publish failed. Please ensure you are logged in via 'npm login'.`);
throw err;
} finally {
// Clean up the generated package.json so it doesn't clutter the dev's repo
fs.unlinkSync(packageJsonPath);
}
console.log(`[WWV CLI] Notifying WorldWideView Marketplace...`);
try {
const targetUrl = process.env.WWV_MARKETPLACE_URL || "https://marketplace.worldwideview.dev";
await fetch(`${targetUrl}/api/webhooks/npm-publish`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ pluginId: manifest.id, version: manifest.version })
});
console.log(`[WWV CLI] Marketplace notified.`);
} catch (err: any) {
console.warn(`[WWV CLI] Could not notify marketplace: ${err.message}. It will be indexed on the next sweep.`);
}
console.log(`\n🚀 Success! Version ${manifest.version} published globally to NPM.`);
}
+66
View File
@@ -0,0 +1,66 @@
import { Command } from "commander";
import { createPlugin } from "./commands/create";
const program = new Command();
program
.name("wwv")
.description("WorldWideView Plugin CLI")
.version("1.0.0");
program
.command("create <name>")
.description("Scaffold a new WorldWideView plugin")
.action(async (name) => {
try {
await createPlugin(name);
} catch (err: any) {
console.error("Error:", err.message);
process.exit(1);
}
});
import { startDevServer } from "./commands/dev";
program
.command("dev")
.description("Start the plugin development server with hot-reload")
.option("-t, --target <url>", "Target WorldWideView URL", "http://localhost:3000")
.action(async (options) => {
try {
await startDevServer(options.target);
} catch (err: any) {
console.error("Error:", err.message);
process.exit(1);
}
});
import { packagePlugin } from "./commands/package";
import { publishToNpm } from "./commands/publish";
program
.command("package")
.description("Build and package the plugin into a .wwvpkg file for sideloading")
.action(async () => {
try {
await packagePlugin();
} catch (err: any) {
console.error("Error:", err.message);
process.exit(1);
}
});
program
.command("publish")
.description("Publish the plugin to NPM and notify the WWV Marketplace")
.action(async () => {
try {
await publishToNpm();
} catch (err: any) {
console.error("Error:", err.message);
process.exit(1);
}
});
program.parse();
+21
View File
@@ -0,0 +1,21 @@
import { describe, it, expect, afterEach } from "vitest";
import { createPlugin } from "../src/commands/create";
import fs from "fs";
import path from "path";
describe("create command", () => {
const testDir = path.join(__dirname, "test-plugin");
afterEach(() => {
if (fs.existsSync(testDir)) fs.rmSync(testDir, { recursive: true, force: true });
});
it("should scaffold a new plugin folder with manifest and index.ts", async () => {
await createPlugin("test-plugin", __dirname);
expect(fs.existsSync(path.join(testDir, "wwv-manifest.json"))).toBe(true);
expect(fs.existsSync(path.join(testDir, "src", "index.ts"))).toBe(true);
const manifest = JSON.parse(fs.readFileSync(path.join(testDir, "wwv-manifest.json"), "utf-8"));
expect(manifest.id).toBe("test-plugin");
});
});
+17
View File
@@ -0,0 +1,17 @@
import { describe, it, expect, vi } from "vitest";
import { startDevServer } from "../src/commands/dev";
// Mock vite and ws
vi.mock("vite", () => ({
createServer: vi.fn().mockResolvedValue({
listen: vi.fn(),
httpServer: { on: vi.fn() },
ws: { on: vi.fn() }
})
}));
describe("dev command", () => {
it("should export startDevServer function", () => {
expect(typeof startDevServer).toBe("function");
});
});
+11
View File
@@ -0,0 +1,11 @@
import { describe, it, expect } from "vitest";
import { execSync } from "child_process";
import path from "path";
describe("wwv cli", () => {
it("should print help information", () => {
const binPath = path.resolve(__dirname, "../bin/wwv.js");
const output = execSync(`node ${binPath} --help`).toString();
expect(output).toContain("Usage: wwv [options]");
});
});
+8
View File
@@ -0,0 +1,8 @@
import { describe, it, expect } from "vitest";
import { packagePlugin } from "../src/commands/package";
describe("package command", () => {
it("should export packagePlugin function", () => {
expect(typeof packagePlugin).toBe("function");
});
});
+15
View File
@@ -0,0 +1,15 @@
import { describe, it, expect, vi } from "vitest";
import { publishToNpm } from "../src/commands/publish";
vi.mock("child_process", () => ({
execSync: vi.fn()
}));
vi.mock("vite", () => ({
build: vi.fn().mockResolvedValue({})
}));
describe("publish command", () => {
it("should export publishToNpm function", () => {
expect(typeof publishToNpm).toBe("function");
});
});
+14
View File
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "NodeNext",
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*"]
}
+8
View File
@@ -0,0 +1,8 @@
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
environment: "node",
globals: true
}
});
+11
View File
@@ -105,6 +105,16 @@ export interface ServerPluginConfig {
}
export interface PluginContext {
apiBaseUrl: string;
/**
* Key-value map of generic environment variables.
* The engine surfaces any variable starting with NEXT_PUBLIC_WWV_PLUGIN_
*
* WARNING: These are exposed to the client-side browser bundle.
* DO NOT USE THIS FOR API KEYS. For sensitive tokens, use getSecret() if provided.
*/
env: Record<string, string>;
/** The running edition of the WWV engine */
edition: "local" | "cloud" | "demo";
timeRange: TimeRange;
onDataUpdate: (entities: GeoEntity[]) => void;
onError: (error: Error) => void;
@@ -228,4 +238,5 @@ export type DataBusEvents = {
globeReady: Record<string, never>;
};
export * from "./viteGlobals";
export { wwvStaticCompiler } from "./vite/wwvStaticCompiler";
//# sourceMappingURL=index.d.ts.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAKpC,MAAM,WAAW,cAAe,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EACxB,IAAI,GAAE,cAAmB,GAC1B,MAAM,CA4BR;AAGD,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGzJ,MAAM,MAAM,cAAc,GACpB,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,kBAAkB,GAClB,gBAAgB,GAChB,OAAO,GACP,OAAO,GACP,UAAU,GACV,cAAc,GACd,QAAQ,CAAC;AAGf,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACb;AAED,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;AAG5D,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yJAAyJ;IACzJ,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAGD,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mHAAmH;IACnH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;QACjC,WAAW,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,2FAA2F;IAC3F,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAGD,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAGD,MAAM,WAAW,kBAAkB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD,MAAM,WAAW,aAAa;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,6DAA6D;IAC7D,iBAAiB,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC,GAAG,SAAS,CAAC;IACpE,2DAA2D;IAC3D,cAAc,EAAE,MAAM,OAAO,CAAC;IAC9B,oEAAoE;IACpE,cAAc,EAAE,MAAM,IAAI,CAAC;CAC9B;AAGD,MAAM,WAAW,kBAAkB;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;CAAE;AACrE,MAAM,WAAW,iBAAiB;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;CAAE;AAC9E,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,MAAM,WAAW,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAG1C,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAGhB,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,IAAI,IAAI,CAAC;IAGhB,KAAK,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAClD,kBAAkB,IAAI,MAAM,CAAC;IAG7B,cAAc,IAAI,WAAW,CAAC;IAC9B,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,mBAAmB,CAAC;IAGrD,oBAAoB,CAAC,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,GAAG,IAAI,CAAC;IACnE,eAAe,CAAC,IAAI,kBAAkB,CAAC;IACvC,oBAAoB,CAAC,IAAI,gBAAgB,EAAE,CAAC;IAC5C,SAAS,CAAC,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1F,mBAAmB,CAAC,IAAI,aAAa,CAAC;QAAE,MAAM,CAAC,EAAE,GAAG,CAAA;KAAE,Line truncated
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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 truncated
+27 -7
View File
@@ -1,6 +1,21 @@
"use strict";
// ─── WorldWideView Plugin SDK ─────────────────────────────────
// The public API for building WorldWideView plugins.
// Import from "@worldwideview/wwv-plugin-sdk" in your plugin.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -12,10 +27,13 @@ var __rest = (this && this.__rest) || function (s, e) {
}
return t;
};
import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
Object.defineProperty(exports, "__esModule", { value: true });
exports.wwvStaticCompiler = exports.DEFAULT_ICON_SIZE = void 0;
exports.createSvgIconUrl = createSvgIconUrl;
const react_1 = require("react");
const server_1 = require("react-dom/server");
/** Standard SVG icon size (px) used by createSvgIconUrl when no size is given. */
export const DEFAULT_ICON_SIZE = 32;
exports.DEFAULT_ICON_SIZE = 32;
/** Default dark background color for icon circles. */
const DEFAULT_BG_COLOR = "rgba(15, 23, 42, 0.85)";
/**
@@ -23,9 +41,9 @@ const DEFAULT_BG_COLOR = "rgba(15, 23, 42, 0.85)";
* By default wraps the icon in a filled circle for visibility on any terrain.
* Pass `{ background: false }` to opt out.
*/
export function createSvgIconUrl(Icon, opts = {}) {
const { background = true, backgroundColor = DEFAULT_BG_COLOR, size = DEFAULT_ICON_SIZE } = opts, iconProps = __rest(opts, ["background", "backgroundColor", "size"]);
const innerSvg = renderToStaticMarkup(createElement(Icon, Object.assign({ size }, iconProps)));
function createSvgIconUrl(Icon, opts = {}) {
const { background = true, backgroundColor = DEFAULT_BG_COLOR, size = exports.DEFAULT_ICON_SIZE } = opts, iconProps = __rest(opts, ["background", "backgroundColor", "size"]);
const innerSvg = (0, server_1.renderToStaticMarkup)((0, react_1.createElement)(Icon, Object.assign({ size }, iconProps)));
if (!background) {
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(innerSvg)}`;
}
@@ -42,4 +60,6 @@ export function createSvgIconUrl(Icon, opts = {}) {
].join("");
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(wrappedSvg)}`;
}
export * from "./viteGlobals";
__exportStar(require("./viteGlobals"), exports);
var wwvStaticCompiler_1 = require("./vite/wwvStaticCompiler");
Object.defineProperty(exports, "wwvStaticCompiler", { enumerable: true, get: function () { return wwvStaticCompiler_1.wwvStaticCompiler; } });
+2 -1
View File
@@ -1,4 +1,5 @@
"use strict";
// ─── Plugin Manifest Types ───────────────────────────────────
// Schema for plugin.json manifest files.
// Three formats: declarative (JSON-only), static (GeoJSON), bundle (JS code).
export {};
Object.defineProperty(exports, "__esModule", { value: true });
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@worldwideview/wwv-plugin-sdk",
"version": "1.3.0",
"version": "1.5.0",
"description": "Plugin SDK — types, interfaces, and utilities for building WorldWideView globe plugins",
"main": "dist/index.js",
"types": "dist/index.d.ts",
+11
View File
@@ -178,6 +178,16 @@ export interface ServerPluginConfig {
// All plugins (built-in and 3rd party) receive the same context.
export interface PluginContext {
apiBaseUrl: string;
/**
* Key-value map of generic environment variables.
* The engine surfaces any variable starting with NEXT_PUBLIC_WWV_PLUGIN_
*
* WARNING: These are exposed to the client-side browser bundle.
* DO NOT USE THIS FOR API KEYS. For sensitive tokens, use getSecret() if provided.
*/
env: Record<string, string>;
/** The running edition of the WWV engine */
edition: "local" | "cloud" | "demo";
timeRange: TimeRange;
onDataUpdate: (entities: GeoEntity[]) => void;
onError: (error: Error) => void;
@@ -260,3 +270,4 @@ export type DataBusEvents = {
};
export * from "./viteGlobals";
export { wwvStaticCompiler } from "./vite/wwvStaticCompiler";
+1 -1
View File
@@ -6,7 +6,7 @@ import type { PluginCategory } from "./index";
export type PluginFormat = "declarative" | "static" | "bundle";
export type PluginType = "data-layer" | "extension";
export type TrustTier = "built-in" | "verified" | "unverified";
export type TrustTier = "built-in" | "verified" | "unverified" | "developer";
export type PluginCapability =
| "data:own"
@@ -0,0 +1,185 @@
import fs from "fs";
import path from "path";
/**
* Vite plugin that auto-generates a WorldPlugin class for static plugins.
*
* If the plugin's package.json has `worldwideview.format: "static"` and
* no `src/index.ts` exists, this plugin injects a virtual module that:
* - Fetches GeoJSON data from the CDN at runtime
* - Converts features into GeoEntity objects
* - Renders with the manifest's rendering config
*/
export function wwvStaticCompiler(): any {
let pluginRoot = "";
let manifest: any = null;
let generatedEntry = "";
return {
name: "wwv-static-compiler",
enforce: "pre" as const,
config(userConfig: any) {
pluginRoot = userConfig.root || process.cwd();
const pkgPath = path.join(pluginRoot, "package.json");
if (!fs.existsSync(pkgPath)) return;
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
manifest = pkg.worldwideview || null;
if (!manifest) return;
manifest._packageName = pkg.name;
manifest._packageVersion = pkg.version;
manifest._description = pkg.description || "";
const srcIndex = path.join(pluginRoot, "src", "index.ts");
if (fs.existsSync(srcIndex)) return; // real source exists
// Write a generated entry file
const srcDir = path.join(pluginRoot, "src");
if (!fs.existsSync(srcDir)) fs.mkdirSync(srcDir, { recursive: true });
generatedEntry = path.join(srcDir, "__generated_entry.js");
const source = generateStaticPluginSource(manifest);
fs.writeFileSync(generatedEntry, source, "utf-8");
// Redirect lib entry to the generated file
if (userConfig.build?.lib) {
userConfig.build.lib.entry = generatedEntry;
}
},
buildEnd() {
// Clean up the generated file, but ONLY if we are not in watch mode
const isWatchMode = process.argv.includes("--watch") || process.argv.includes("-w");
if (!isWatchMode && generatedEntry && fs.existsSync(generatedEntry)) {
fs.unlinkSync(generatedEntry);
generatedEntry = "";
}
},
closeBundle() {
// Also clean up on close (redundant safety)
const isWatchMode = process.argv.includes("--watch") || process.argv.includes("-w");
if (!isWatchMode && generatedEntry && fs.existsSync(generatedEntry)) {
fs.unlinkSync(generatedEntry);
generatedEntry = "";
}
},
};
}
function generateStaticPluginSource(manifest: any): string {
const pluginId = manifest.id;
const pluginName = manifest.name || pluginId;
const description = manifest._description || "";
const category = manifest.category || "custom";
const icon = manifest.icon || "MapPin";
const version = manifest._packageVersion || "1.0.0";
const packageName = manifest._packageName;
const color =
manifest.rendering?.defaultColor ||
manifest.rendering?.color ||
"#3b82f6";
const entityType = manifest.rendering?.entityType || "point";
const clusterEnabled = manifest.rendering?.clusterEnabled ?? true;
const clusterDistance = manifest.rendering?.clusterDistance ?? 50;
const maxEntities = manifest.rendering?.maxEntities ?? 5000;
const labelField = manifest.rendering?.labelField || "name";
const dataFileName = manifest.dataFile
? path.basename(manifest.dataFile)
: "data.json";
const renderBlock =
entityType === "billboard"
? `
const cacheKey = "default";
if (!this._iconUrls[cacheKey]) {
this._iconUrls[cacheKey] = createSvgIconUrl(${icon}, { color: ${JSON.stringify(color)} });
}
return { type: "billboard", iconUrl: this._iconUrls[cacheKey], color: ${JSON.stringify(color)}, iconScale: 0.5 };`
: `
return { type: "point", color: ${JSON.stringify(color)}, size: 6 };`;
return `
import { ${icon} } from "lucide-react";
import { createSvgIconUrl } from "@worldwideview/wwv-plugin-sdk";
import dataRaw from "../data/${dataFileName}?raw";
function representativePoint(geom) {
if (!geom) return { lat: 0, lon: 0 };
switch (geom.type) {
case "Point":
return { lat: geom.coordinates[1], lon: geom.coordinates[0], alt: geom.coordinates[2] };
case "MultiPoint":
case "LineString":
return { lat: geom.coordinates[0][1], lon: geom.coordinates[0][0] };
case "Polygon":
case "MultiLineString":
return { lat: geom.coordinates[0][0][1], lon: geom.coordinates[0][0][0] };
case "MultiPolygon":
return { lat: geom.coordinates[0][0][0][1], lon: geom.coordinates[0][0][0][0] };
default:
return { lat: 0, lon: 0 };
}
}
export default class AutoStaticPlugin {
id = ${JSON.stringify(pluginId)};
name = ${JSON.stringify(pluginName)};
description = ${JSON.stringify(description)};
icon = ${icon};
category = ${JSON.stringify(category)};
version = ${JSON.stringify(version)};
_context = null;
_entities = [];
_iconUrls = {};
async initialize(ctx) {
this._context = ctx;
let data = null;
try {
data = JSON.parse(dataRaw);
} catch(e) {
console.error("Failed to parse data for ${pluginId}", e);
}
if (data && Array.isArray(data.features)) {
this._entities = data.features.map((f, i) => {
const pt = representativePoint(f.geometry);
return {
id: "${pluginId}-" + (f.id ?? i),
pluginId: ${JSON.stringify(pluginId)},
latitude: pt.lat,
longitude: pt.lon,
altitude: pt.alt,
timestamp: new Date(),
label: f.properties?.${labelField} ?? f.properties?.name ?? undefined,
properties: { ...f.properties, _geometryType: f.geometry?.type },
};
});
}
}
destroy() { this._context = null; this._entities = []; }
async fetch(_timeRange) { return this._entities; }
getPollingInterval() { return 0; }
getLayerConfig() {
return {
color: ${JSON.stringify(color)},
clusterEnabled: ${clusterEnabled},
clusterDistance: ${clusterDistance},
maxEntities: ${maxEntities},
};
}
renderEntity(_entity) {${renderBlock}
}
}
`;
}
+1 -1
View File
@@ -66,7 +66,7 @@ export function wwvPluginGlobals(): any {
const Cesium = globalThis.__WWV_HOST__.Cesium;
export default Cesium;
// Export common bindings for direct destructuring
export const { Viewer, Entity, Cartesian3, Cartesian2, Color, CallbackProperty, DistanceDisplayCondition, NearFarScalar, HeightReference, Resource, Rectangle, PolygonHierarchy, ClassificationType, ArcType, Math, JulianDate, TimeInterval, TimeIntervalCollection, SampledPositionProperty, GeoJsonDataSource, PinBuilder } = Cesium;
export const { Viewer, Entity, Cartesian3, Cartesian2, Color, CallbackProperty, DistanceDisplayCondition, NearFarScalar, HeightReference, Resource, Rectangle, PolygonHierarchy, ClassificationType, ArcType, Math, JulianDate, TimeInterval, TimeIntervalCollection, SampledPositionProperty, GeoJsonDataSource, PinBuilder, CustomDataSource, ConstantProperty, ColorMaterialProperty, Cartographic } = Cesium;
`;
}
if (originalId === "resium") {
@@ -5,6 +5,7 @@
"declaration": true,
"declarationMap": true,
"outDir": "dist",
"module": "commonjs",
"moduleResolution": "node"
},
"include": ["src/**/*.ts", "src/**/*.tsx"]
+1057 -560
View File
File diff suppressed because it is too large. Load diff
-191
View File
@@ -1,191 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("shield-alert", [
["path", {
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}],
["path", {
d: "M12 8v4",
key: "1got3b"
}],
["path", {
d: "M12 16h.01",
key: "1drbdi"
}]
]), c = [
{
id: "taiwan-adiz",
name: "Taiwan ADIZ",
country: "Taiwan",
type: "ADIZ",
status: "Active monitoring",
centerLat: 23.5,
centerLon: 121,
polygon: [
[117.5, 21],
[117.5, 29],
[123, 29],
[124.5, 24.5],
[124.5, 21],
[117.5, 21]
]
},
{
id: "china-adiz",
name: "East China Sea ADIZ",
country: "China",
type: "ADIZ",
status: "Claimed active",
centerLat: 29.5,
centerLon: 125,
polygon: [
[121, 33],
[125, 33],
[128, 30],
[125, 25],
[121, 26],
[121, 33]
]
},
{
id: "kadiz",
name: "KADIZ (South Korea)",
country: "South Korea",
type: "ADIZ",
status: "Active monitoring",
centerLat: 36,
centerLon: 128,
polygon: [
[123, 33],
[123, 37],
[125, 39],
[131, 39],
[132, 36],
[128, 32],
[123, 33]
]
},
{
id: "jadiz",
name: "JADIZ (Japan)",
country: "Japan",
type: "ADIZ",
status: "Active monitoring",
centerLat: 35,
centerLon: 138,
polygon: [
[122, 23],
[122, 30],
[131, 39],
[138, 46],
[146, 46],
[146, 25],
[134, 25],
[122, 23]
]
},
{
id: "us-adiz-alaska",
name: "US ADIZ (Alaska)",
country: "USA",
type: "ADIZ",
status: "Active monitoring",
centerLat: 64,
centerLon: -150,
polygon: [
[-130, 54],
[-145, 54],
[-165, 50],
[-175, 55],
[-170, 70],
[-140, 70],
[-130, 54]
]
}
], l = ({ enabled: e }) => e ? /* @__PURE__ */ globalThis.__WWV_HOST__.jsxRuntime.jsx(globalThis.__WWV_HOST__.jsxRuntime.Fragment, { children: c.map((e) => {
let t = globalThis.__WWV_HOST__.Cesium.Cartesian3.fromDegreesArray(e.polygon.flatMap((e) => [e[0], e[1]])), n = e.type === "ADIZ", r = globalThis.__WWV_HOST__.Cesium.Color.fromCssColorString(n ? "#ef4444" : "#fb923c").withAlpha(.2), i = globalThis.__WWV_HOST__.Cesium.Color.fromCssColorString(n ? "#ef4444" : "#fb923c");
return /* @__PURE__ */ globalThis.__WWV_HOST__.jsxRuntime.jsx(globalThis.__WWV_HOST__.Resium.Entity, {
name: e.name,
description: `
<table class="cesium-infoBox-defaultTable">
<tbody>
<tr><th>Country</th><td>${e.country}</td></tr>
<tr><th>Type</th><td>${e.type}</td></tr>
<tr><th>Status</th><td>${e.status}</td></tr>
</tbody>
</table>
`,
children: /* @__PURE__ */ globalThis.__WWV_HOST__.jsxRuntime.jsx(globalThis.__WWV_HOST__.Resium.PolygonGraphics, {
hierarchy: t,
material: r,
outline: !0,
outlineColor: i,
outlineWidth: 2,
height: 0
})
}, e.id);
}) }) : null, u = class {
constructor() {
this.id = "air-defense", this.name = "Air Defense Zones", this.description = "Known ADIZ boundaries, no-fly zones, and restricted airspace.", this.icon = s, this.category = "conflict", this.version = "1.0.0";
}
async initialize(e) {}
destroy() {}
async fetch(e) {
return [];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: "#ef4444",
clusterEnabled: !1,
clusterDistance: 0
};
}
renderEntity(e) {
return {
type: "point",
color: "#ef4444"
};
}
getGlobeComponent() {
return l;
}
};
//#endregion
export { u as AirDefensePlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "air-defense",
"name": "air-defense",
"version": "1.0.0",
"description": "WorldWideView plugin — Known Air Defense Identification Zones (ADIZ) and boundaries.",
"capabilities": [],
"category": "Military",
"icon": "ShieldAlert",
"entry": "/plugins/air-defense/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-319
View File
@@ -1,319 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("plane", [["path", {
d: "M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",
key: "1v9wt8"
}]]), c = class {
category = "aviation";
context = null;
defaultLayerColor = "#3b82f6";
defaultTrailColor = "#00fff7";
iconUrl = "/plane-icon.svg";
modelUrl = "/airplane/scene.gltf";
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: 40,
maxEntities: 5e3
};
}
renderEntity(e) {
let t = e.properties.altitude_m, n = !e.properties.on_ground;
return {
type: "model",
iconUrl: this.iconUrl,
size: n ? 8 : 5,
modelUrl: this.modelUrl,
modelScale: 2.56,
modelMinPixelSize: 16,
modelHeadingOffset: 180,
color: this.getAltitudeColor(t),
rotation: e.heading,
labelText: e.label || void 0,
labelFont: "11px JetBrains Mono, monospace"
};
}
getSelectionBehavior(e) {
return e.properties.on_ground ? null : {
showTrail: !0,
trailDurationSec: 60,
trailStepSec: 5,
trailColor: this.defaultTrailColor,
flyToOffsetMultiplier: 3,
flyToBaseDistance: 3e4
};
}
};
//#endregion
//#region src/index.ts
function l(e) {
return e === null || e <= 0 ? "grounded" : e < 3e3 ? "low" : e < 8e3 ? "mid" : e < 12e3 ? "high" : "extreme";
}
var u = class extends c {
constructor(...e) {
super(...e), this.id = "aviation", this.name = "Aviation", this.description = "Real-time aircraft tracking via OpenSky Network", this.icon = s, this.version = "1.0.8";
}
getAltitudeColor(e) {
return e === null || e <= 0 ? "#4ade80" : e < 3e3 ? "#22d3ee" : e < 8e3 ? "#3b82f6" : e < 12e3 ? "#a78bfa" : "#f472b6";
}
mapPayloadToEntities(e) {
let t = [];
if (Array.isArray(e)) t = e;
else if (e && typeof e == "object") t = Object.values(e);
else return [];
return t.map((e) => {
let t = e.ts || e.time_position || e.last_contact || e.last_updated;
return {
id: `aviation-${e.icao24}`,
pluginId: "aviation",
latitude: e.lat,
longitude: e.lon,
altitude: (e.alt || 0) * 10,
heading: e.hdg || void 0,
speed: e.spd || void 0,
timestamp: new Date(t ? t * 1e3 : Date.now()),
label: e.callsign || e.icao24,
properties: {
icao24: e.icao24,
callsign: e.callsign,
origin_country: e.origin_country,
altitude_m: e.alt,
altitude_band: l(e.alt || 0),
velocity_ms: e.spd,
heading: e.hdg,
vertical_rate: e.vertical_rate,
on_ground: e.on_ground,
squawk: e.squawk
}
};
});
}
async fetch(e) {
try {
let e = process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL ? process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL.replace(/\/stream$/, "").replace(/^ws/, "http") : "http://localhost:5001", t;
if (this.context.isPlaybackMode()) {
let n = this.context.getCurrentTime().getTime();
t = await fetch(`${e}/data/aviation?time=${n}`);
} else t = await fetch(`${e}/data/aviation?lookback=15m`);
if (!t.ok) throw Error(`Data Engine API returned ${t.status}`);
let n = await t.json();
return this.mapPayloadToEntities(n.items);
} catch (e) {
return console.error("[AviationPlugin] Fetch error:", e), this.context?.onError && this.context.onError(e), [];
}
}
mapWebsocketPayload(e) {
return this.mapPayloadToEntities(e);
}
getServerConfig() {
return {
apiBasePath: "/api/aviation",
pollingIntervalMs: 5e3,
requiresAuth: !0,
historyEnabled: !0,
availabilityEnabled: !0
};
}
getLegend() {
return [
{
label: "0 m (Grounded)",
color: "#4ade80",
filterId: "altitude_band",
filterValue: "grounded"
},
{
label: "< 3,000 m",
color: "#22d3ee",
filterId: "altitude_band",
filterValue: "low"
},
{
label: "3,000 - 8,000 m",
color: "#3b82f6",
filterId: "altitude_band",
filterValue: "mid"
},
{
label: "8,000 - 12,000 m",
color: "#a78bfa",
filterId: "altitude_band",
filterValue: "high"
},
{
label: "> 12,000 m",
color: "#f472b6",
filterId: "altitude_band",
filterValue: "extreme"
}
];
}
getFilterDefinitions() {
return [
{
id: "origin_country",
label: "Country",
type: "select",
propertyKey: "origin_country",
options: [
{
value: "United States",
label: "United States"
},
{
value: "China",
label: "China"
},
{
value: "United Kingdom",
label: "United Kingdom"
},
{
value: "Germany",
label: "Germany"
},
{
value: "France",
label: "France"
},
{
value: "Japan",
label: "Japan"
},
{
value: "Australia",
label: "Australia"
},
{
value: "Canada",
label: "Canada"
},
{
value: "India",
label: "India"
},
{
value: "Brazil",
label: "Brazil"
},
{
value: "Russia",
label: "Russia"
},
{
value: "Turkey",
label: "Turkey"
},
{
value: "South Korea",
label: "South Korea"
},
{
value: "Indonesia",
label: "Indonesia"
},
{
value: "Mexico",
label: "Mexico"
}
]
},
{
id: "altitude",
label: "Altitude (m)",
type: "range",
propertyKey: "altitude_m",
range: {
min: 0,
max: 15e3,
step: 500
}
},
{
id: "altitude_band",
label: "Altitude Category",
type: "select",
propertyKey: "altitude_band",
options: [
{
value: "grounded",
label: "0 m (Grounded)"
},
{
value: "low",
label: "< 3,000 m"
},
{
value: "mid",
label: "3,000 - 8,000 m"
},
{
value: "high",
label: "8,000 - 12,000 m"
},
{
value: "extreme",
label: "> 12,000 m"
}
]
},
{
id: "on_ground",
label: "On Ground",
type: "boolean",
propertyKey: "on_ground"
},
{
id: "callsign",
label: "Callsign",
type: "text",
propertyKey: "callsign"
}
];
}
};
//#endregion
export { u as AviationPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "aviation",
"name": "aviation",
"version": "1.0.8",
"description": "WorldWideView plugin for real-time commercial aircraft tracking via the OpenSky Network API. Renders 3D aircraft models with altitude-based coloring, flight trails, and country/altitude/callsign filters",
"capabilities": [],
"category": "Aviation",
"icon": "Plane",
"entry": "/plugins/aviation/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-74
View File
@@ -1,74 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("map", [
["path", {
d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",
key: "169xi5"
}],
["path", {
d: "M15 5.764v15",
key: "1pn4in"
}],
["path", {
d: "M9 3.236v15",
key: "1uimfh"
}]
]), c = class {
constructor() {
this.id = "borders", this.name = "Borders & Labels", this.description = "Displays political borders and country labels on the map.", this.icon = s, this.category = "custom", this.version = "1.0.0";
}
async initialize(e) {}
destroy() {}
async fetch(e) {
return [];
}
getPollingInterval() {
return 9999999;
}
getLayerConfig() {
return {
color: "#00ffff",
clusterEnabled: !1,
clusterDistance: 0,
maxEntities: 0
};
}
renderEntity(e) {
return { type: "point" };
}
};
//#endregion
export { c as BordersPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "borders",
"name": "borders",
"version": "1.0.4",
"description": "WorldWideView plugin that displays political borders and country labels as a globe overlay",
"capabilities": [],
"category": "Custom",
"icon": "Map",
"entry": "/plugins/borders/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
File diff suppressed because it is too large. Load diff
-12
View File
@@ -1,12 +0,0 @@
{
"id": "camera",
"name": "camera",
"version": "1.0.4",
"description": "WorldWideView plugin for displaying public live cameras and traffic cameras on the globe. Supports custom data sources via URL, file upload, and GeoJSON",
"capabilities": [],
"category": "Infrastructure",
"icon": "Camera",
"entry": "/plugins/camera/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-286
View File
@@ -1,286 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("crosshair", [
["circle", {
cx: "12",
cy: "12",
r: "10",
key: "1mglay"
}],
["line", {
x1: "22",
x2: "18",
y1: "12",
y2: "12",
key: "l9bcsi"
}],
["line", {
x1: "6",
x2: "2",
y1: "12",
y2: "12",
key: "13hhkx"
}],
["line", {
x1: "12",
x2: "12",
y1: "6",
y2: "2",
key: "10w3f3"
}],
["line", {
x1: "12",
x2: "12",
y1: "22",
y2: "18",
key: "15g9kq"
}]
]), c = [
{
id: "ukraine-russia",
name: "Eastern Ukraine / Russian Border",
lat: 48.0196,
lon: 37.8028,
subtext: "High-intensity conventional warfare",
description: "Active frontline spanning eastern and southern Ukraine, including drone and missile exchanges.",
escalationScore: 5,
escalationTrend: "escalating",
status: "Active Full-Scale Conflict",
whyItMatters: "Global geopolitical stability, NATO involvement, grain and energy market impacts.",
radiusKm: 600
},
{
id: "gaza-israel",
name: "Gaza Strip & Israel",
lat: 31.5,
lon: 34.466667,
subtext: "Urban warfare and regional tension",
description: "Intense urban warfare in Gaza with frequent missile exchanges and multi-front regional escalations.",
escalationScore: 5,
escalationTrend: "stable",
status: "Active Conflict",
whyItMatters: "Humanitarian crisis, Red Sea shipping impacts, broader Middle East regional war risks.",
radiusKm: 150
},
{
id: "red-sea-houthi",
name: "Red Sea & Bab al-Mandab",
lat: 13.5135,
lon: 43.1491,
subtext: "Maritime security threat",
description: "Houthi drone and missile attacks on commercial shipping in the Red Sea and Gulf of Aden.",
escalationScore: 4,
escalationTrend: "stable",
status: "Targeted Strikes",
whyItMatters: "Disruption of ~12% of global trade relying on the Suez Canal.",
radiusKm: 400
},
{
id: "taiwan-strait",
name: "Taiwan Strait",
lat: 24.5126,
lon: 119.9304,
subtext: "Geopolitical flashpoint",
description: "High Chinese military drills, ADIZ incursions, and naval presence surrounding Taiwan.",
escalationScore: 3,
escalationTrend: "escalating",
status: "Tension / Gray Zone",
whyItMatters: "Semiconductor supply chain, US-China relations, Indo-Pacific security.",
radiusKm: 300
},
{
id: "sudan-civil-war",
name: "Sudan",
lat: 15.5007,
lon: 32.5599,
subtext: "Civil War",
description: "Widespread fighting between the SAF and RSF causing massive displacement.",
escalationScore: 5,
escalationTrend: "escalating",
status: "Active Conflict",
whyItMatters: "Severe humanitarian crisis and destabilization of the Horn of Africa.",
radiusKm: 700
},
{
id: "myanmar-civil-war",
name: "Myanmar",
lat: 21.9162,
lon: 95.956,
subtext: "Civil War",
description: "Intensified civil war between the military junta and various ethnic armed organizations.",
escalationScore: 4,
escalationTrend: "stable",
status: "Active Conflict",
whyItMatters: "Regional stability in Southeast Asia, refugee crisis.",
radiusKm: 500
},
{
id: "korean-dmz",
name: "Korean DMZ",
lat: 38.3308,
lon: 127.2406,
subtext: "Militarized boundary",
description: "Heightened tension with North Korean artillery drills, drone incursions, and rhetoric.",
escalationScore: 3,
escalationTrend: "escalating",
status: "High Tension",
whyItMatters: "Nuclear risk, East Asia security, US alliance.",
radiusKm: 150
}
];
//#endregion
//#region src/index.tsx
function l(e) {
return e >= 5 ? "#991b1b" : e >= 4 ? "#ef4444" : e >= 3 ? "#f97316" : "#fbbf24";
}
function u(e, t) {
let n = e?.cesiumElement;
n && !n._wwvEntity && (n._wwvEntity = t);
}
function d(e) {
return {
id: e.id,
pluginId: "conflict-zones",
latitude: e.lat,
longitude: e.lon,
altitude: 0,
timestamp: /* @__PURE__ */ new Date(),
properties: {
name: e.name,
description: e.description,
type: e.subtext || "N/A",
status: e.status,
escalationScore: e.escalationScore,
escalationTrend: e.escalationTrend,
whyItMatters: e.whyItMatters,
radiusKm: e.radiusKm
}
};
}
var f = ({ enabled: e }) => e ? /* @__PURE__ */ globalThis.__WWV_HOST__.jsxRuntime.jsx(globalThis.__WWV_HOST__.jsxRuntime.Fragment, { children: c.map((e) => {
let t = globalThis.__WWV_HOST__.Cesium.Cartesian3.fromDegrees(e.lon, e.lat), n = l(e.escalationScore), r = globalThis.__WWV_HOST__.Cesium.Color.fromCssColorString(n).withAlpha(.25), i = globalThis.__WWV_HOST__.Cesium.Color.fromCssColorString(n).withAlpha(.8), a = e.radiusKm * 1e3, o = d(e);
return /* @__PURE__ */ globalThis.__WWV_HOST__.jsxRuntime.jsx(globalThis.__WWV_HOST__.Resium.Entity, {
position: t,
name: e.name,
ref: (e) => u(e, o),
children: /* @__PURE__ */ globalThis.__WWV_HOST__.jsxRuntime.jsx(globalThis.__WWV_HOST__.Resium.EllipseGraphics, {
semiMajorAxis: a,
semiMinorAxis: a,
material: r,
outline: !0,
outlineColor: i,
outlineWidth: 3,
height: 0
})
}, e.id);
}) }) : null, p = class {
constructor() {
this.id = "conflict-zones", this.name = "Conflict Zones", this.description = "Active conflict zones and geopolitical hotspots worldwide.", this.icon = s, this.category = "conflict", this.version = "1.0.0", this.iconUrls = {};
}
async initialize(e) {}
destroy() {}
async fetch(e) {
return [];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: "#ef4444",
clusterEnabled: !1,
clusterDistance: 0
};
}
renderEntity(e) {
let t = l(e.properties.escalationScore || 3);
return this.iconUrls[t] || (this.iconUrls[t] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(s, { color: t })), {
type: "billboard",
iconUrl: this.iconUrls[t],
color: t
};
}
getFilterDefinitions() {
return [{
id: "severity",
label: "Severity",
type: "select",
propertyKey: "escalationScore",
options: [
{
value: "5",
label: "Critical"
},
{
value: "4",
label: "High Tension"
},
{
value: "3",
label: "Elevated"
},
{
value: "2",
label: "Watchlist"
}
]
}, {
id: "trend",
label: "Trend",
type: "select",
propertyKey: "escalationTrend",
options: [
{
value: "escalating",
label: "Escalating"
},
{
value: "stable",
label: "Stable"
},
{
value: "de-escalating",
label: "De-escalating"
}
]
}];
}
getGlobeComponent() {
return f;
}
};
//#endregion
export { p as ConflictZonesPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "conflict-zones",
"name": "conflict-zones",
"version": "1.1.0",
"description": "WorldWideView plugin — Active conflict zones and geopolitical hotspots worldwide.",
"capabilities": [],
"category": "Conflict",
"icon": "Crosshair",
"entry": "/plugins/conflict-zones/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-104
View File
@@ -1,104 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils.js
var e = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), t = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), n = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, r = globalThis.__WWV_HOST__.React.forwardRef(({ color: e = "currentColor", size: r = 24, strokeWidth: i = 2, absoluteStrokeWidth: a, className: o = "", children: s, iconNode: c, ...l }, u) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: u,
...n,
width: r,
height: r,
stroke: e,
strokeWidth: a ? Number(i) * 24 / Number(r) : i,
className: t("lucide", o),
...l
}, [...c.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(s) ? s : [s]])), i = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...o }, s) => globalThis.__WWV_HOST__.React.createElement(r, {
ref: s,
iconNode: i,
className: t(`lucide-${e(n)}`, a),
...o
}));
return a.displayName = `${n}`, a;
})("SunMoon", [
["path", {
d: "M12 8a2.83 2.83 0 0 0 4 4 4 4 0 1 1-4-4",
key: "1fu5g2"
}],
["path", {
d: "M12 2v2",
key: "tus03m"
}],
["path", {
d: "M12 20v2",
key: "1lh1kg"
}],
["path", {
d: "m4.9 4.9 1.4 1.4",
key: "b9915j"
}],
["path", {
d: "m17.7 17.7 1.4 1.4",
key: "qc3ed3"
}],
["path", {
d: "M2 12h2",
key: "1t8f8n"
}],
["path", {
d: "M20 12h2",
key: "1q8mjw"
}],
["path", {
d: "m6.3 17.7-1.4 1.4",
key: "5gca6"
}],
["path", {
d: "m19.1 4.9-1.4 1.4",
key: "wpu9u6"
}]
]), a = class {
constructor() {
this.id = "daynight", this.name = "Day / Night", this.description = "Real-time day/night terminator with sunlit and shadow regions.", this.icon = i, this.category = "custom", this.version = "1.0.0";
}
async initialize(e) {}
destroy() {}
async fetch(e) {
return [{
id: "daynight-scene",
pluginId: this.id,
latitude: 0,
longitude: 0,
timestamp: /* @__PURE__ */ new Date(),
properties: {
sceneModifier: !0,
enableLighting: !0
}
}];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: "#fbbf24",
clusterEnabled: !1,
clusterDistance: 0
};
}
renderEntity(e) {
return {
type: "point",
color: "transparent",
size: 0
};
}
};
//#endregion
export { a as DayNightPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "daynight",
"name": "daynight",
"version": "1.0.0",
"description": "WorldWideView plugin — Day/Night terminator overlay showing sunlit and dark regions of the globe in real-time.",
"capabilities": [],
"category": "Custom",
"icon": "SunMoon",
"entry": "/plugins/daynight/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-198
View File
@@ -1,198 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/defaultAttributes.js
var e = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = ((n, r) => {
let i = globalThis.__WWV_HOST__.React.forwardRef(({ color: i = "currentColor", size: a = 24, strokeWidth: o = 2, absoluteStrokeWidth: s, className: c = "", children: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...e,
width: a,
height: a,
stroke: i,
strokeWidth: s ? Number(o) * 24 / Number(a) : o,
className: [
"lucide",
`lucide-${t(n)}`,
c
].join(" "),
...u
}, [...r.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(l) ? l : [l]]));
return i.displayName = `${n}`, i;
})("Activity", [["path", {
d: "M22 12h-4l-3 9L9 3l-3 9H2",
key: "d5dnw9"
}]]), r = class {
context = null;
iconUrls = {};
defaultLayerColor = "#ef4444";
clusterDistance = 40;
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
getEntityIcon(e) {
return this.icon;
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: this.clusterDistance
};
}
renderEntity(e) {
let t = this.getSeverityValue(e), n = this.getSeverityColor(t), r = this.getSeveritySize(t), i = this.getEntityIcon(e), a = `${i?.displayName || i?.name || "default"}-${n}`;
return this.iconUrls[a] || (this.iconUrls[a] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(i, { color: n })), {
type: "billboard",
iconUrl: this.iconUrls[a],
color: n,
size: r,
outlineColor: "#000000",
outlineWidth: 1,
labelText: e.label || void 0,
labelFont: "11px JetBrains Mono, monospace"
};
}
}, i = class extends r {
constructor(...e) {
super(...e), this.id = "earthquakes", this.name = "Earthquakes", this.description = "Recent seismic activity from USGS", this.icon = n, this.category = "natural-disaster", this.version = "1.1.0", this.defaultLayerColor = "#f97316";
}
getSeverityValue(e) {
return Number(e.properties.magnitude ?? 0) || 0;
}
getSeverityColor(e) {
return e < 5 ? "#fcd34d" : e < 6 ? "#f97316" : e < 7 ? "#ef4444" : "#7f1d1d";
}
getSeveritySize(e) {
return e < 5 ? 5 : e < 6 ? 8 : e < 7 ? 12 : 16;
}
async fetch(e) {
try {
let e = await globalThis.fetch("/api/earthquake");
if (!e.ok) return this.context?.onError(/* @__PURE__ */ Error(`Earthquakes API returned ${e.status}`)), [];
let t = await e.json();
return (Array.isArray(t?.features) ? t.features : []).flatMap((e) => {
let t = e?.geometry?.coordinates, n = e?.properties?.time;
if (!Array.isArray(t) || t.length < 2 || !Number.isFinite(t[0]) || !Number.isFinite(t[1]) || !Number.isFinite(n)) return [];
let r = Number(e?.properties?.mag ?? 0) || 0;
return [{
id: `${this.id}-${e.id}`,
pluginId: this.id,
latitude: t[1],
longitude: t[0],
altitude: 0,
timestamp: new Date(n),
label: `M${e?.properties?.mag ?? "?"}`,
properties: {
magnitude: r,
depth: Number(e?.geometry?.coordinates?.[2] ?? 0) || 0,
place: e?.properties?.place ?? null,
url: e?.properties?.url ?? null,
updated: e?.properties?.updated ?? null,
status: e?.properties?.status ?? null,
tsunami: e?.properties?.tsunami ?? null,
sig: e?.properties?.sig ?? null,
magType: e?.properties?.magType ?? null
}
}];
});
} catch (e) {
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch earthquakes");
return this.context?.onError(t), [];
}
}
getPollingInterval() {
return 12e4;
}
getServerConfig() {
return {
apiBasePath: "/api/earthquake",
pollingIntervalMs: 12e4,
historyEnabled: !1
};
}
getLayerConfig() {
return {
color: "#ef4444",
clusterEnabled: !0,
clusterDistance: 40,
maxEntities: 2e3
};
}
renderEntity(e) {
let t = this.getSeverityValue(e);
return {
type: "point",
color: this.getSeverityColor(t),
size: this.getSeveritySize(t),
outlineColor: "#000000",
outlineWidth: 1,
labelText: e.label
};
}
getLegend() {
return [
{
label: "M < 5.0",
color: "#fcd34d",
filterId: "magnitude",
filterValue: "0"
},
{
label: "M 5.0 - 5.9",
color: "#f97316",
filterId: "magnitude",
filterValue: "5.0"
},
{
label: "M 6.0 - 6.9",
color: "#ef4444",
filterId: "magnitude",
filterValue: "6.0"
},
{
label: "M ≥ 7.0",
color: "#7f1d1d",
filterId: "magnitude",
filterValue: "7.0"
}
];
}
getFilterDefinitions() {
return [{
id: "magnitude",
label: "Magnitude",
type: "range",
propertyKey: "magnitude",
range: {
min: 0,
max: 10,
step: .1
}
}, {
id: "depth",
label: "Depth (km)",
type: "range",
propertyKey: "depth",
range: {
min: 0,
max: 800,
step: 10
}
}];
}
};
//#endregion
export { i as EarthquakesPlugin };
-13
View File
@@ -1,13 +0,0 @@
{
"id": "earthquakes",
"name": "Earthquakes",
"description": "Recent seismic activity from USGS via Active Proxy",
"icon": "Activity",
"category": "Natural Disasters",
"type": "data-layer",
"format": "bundle",
"entry": "/plugins/earthquakes/frontend.mjs",
"trust": "unverified",
"capabilities": ["data"],
"version": "1.1.0"
}
-109
View File
@@ -1,109 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("landmark", [
["path", {
d: "M10 18v-7",
key: "wt116b"
}],
["path", {
d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",
key: "1m329m"
}],
["path", {
d: "M14 18v-7",
key: "vav6t3"
}],
["path", {
d: "M18 18v-7",
key: "aexdmj"
}],
["path", {
d: "M3 22h18",
key: "8prr45"
}],
["path", {
d: "M6 18v-7",
key: "1ivflk"
}]
]), c = class {
context = null;
iconUrls = {};
defaultLayerColor = "#3b82f6";
clusterDistance = 50;
maxEntities = 5e3;
iconScale = 1;
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
async fetch(e) {
return [];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: this.clusterDistance,
maxEntities: this.maxEntities
};
}
getEntityColor(e) {
return this.defaultLayerColor;
}
getEntityIcon(e) {
return this.icon;
}
renderEntity(e) {
let t = this.getEntityColor(e), n = this.getEntityIcon(e), r = `${n?.displayName || n?.name || "default"}-${t}`;
return this.iconUrls[r] || (this.iconUrls[r] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(n, { color: t })), {
type: "billboard",
iconUrl: this.iconUrls[r],
color: t,
iconScale: this.iconScale
};
}
}, l = class extends c {
constructor(...e) {
super(...e), this.id = "embassies", this.name = "Embassies & Consulates", this.description = "Global embassies, consulates, and diplomatic missions from OpenStreetMap", this.icon = s, this.category = "infrastructure", this.version = "1.0.3", this.defaultLayerColor = "#a855f7", this.maxEntities = 1e3;
}
};
//#endregion
export { l as EmbassiesConsulatesPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "embassies",
"name": "embassies",
"version": "1.0.3",
"description": "WorldWideView plugin — Global embassies, consulates, and diplomatic missions from OpenStreetMap",
"capabilities": [],
"category": "Custom",
"icon": "Landmark",
"entry": "/plugins/embassies/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-255
View File
@@ -1,255 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = (n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
}, c = s("bomb", [
["circle", {
cx: "11",
cy: "13",
r: "9",
key: "hd149"
}],
["path", {
d: "M14.35 4.65 16.3 2.7a2.41 2.41 0 0 1 3.4 0l1.6 1.6a2.4 2.4 0 0 1 0 3.4l-1.95 1.95",
key: "jp4j1b"
}],
["path", {
d: "m22 2-1.5 1.5",
key: "ay92ug"
}]
]), l = s("plane", [["path", {
d: "M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",
key: "1v9wt8"
}]]), u = s("rocket", [
["path", {
d: "M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",
key: "qeys4"
}],
["path", {
d: "M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",
key: "u4xsad"
}],
["path", {
d: "M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",
key: "676m9"
}],
["path", {
d: "M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",
key: "92ym6u"
}]
]), d = s("shield-alert", [
["path", {
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}],
["path", {
d: "M12 8v4",
key: "1got3b"
}],
["path", {
d: "M12 16h.01",
key: "1drbdi"
}]
]), f = s("target", [
["circle", {
cx: "12",
cy: "12",
r: "10",
key: "1mglay"
}],
["circle", {
cx: "12",
cy: "12",
r: "6",
key: "1vlfrh"
}],
["circle", {
cx: "12",
cy: "12",
r: "2",
key: "1c9p78"
}]
]), p = class {
context = null;
iconUrls = {};
defaultLayerColor = "#ef4444";
clusterDistance = 40;
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
getEntityIcon(e) {
return this.icon;
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: this.clusterDistance
};
}
renderEntity(e) {
let t = this.getSeverityValue(e), n = this.getSeverityColor(t), r = this.getSeveritySize(t), i = this.getEntityIcon(e), a = `${i?.displayName || i?.name || "default"}-${n}`;
return this.iconUrls[a] || (this.iconUrls[a] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(i, { color: n })), {
type: "billboard",
iconUrl: this.iconUrls[a],
color: n,
size: r,
outlineColor: "#000000",
outlineWidth: 1,
labelText: e.label || void 0,
labelFont: "11px JetBrains Mono, monospace"
};
}
};
//#endregion
//#region src/index.ts
function m(e) {
switch (e.toLowerCase()) {
case "missile strike": return u;
case "air strike": return l;
case "ground combat": return f;
case "artillery": return c;
default: return d;
}
}
var h = class extends p {
constructor(...e) {
super(...e), this.id = "iranwarlive", this.name = "Iran War Live", this.description = "Live OSINT tracking — Data sourced from IranWarLive.com (Not for Life-Safety)", this.icon = d, this.category = "conflict", this.version = "1.0.2", this.defaultLayerColor = "#ef4444", this.clusterDistance = 40;
}
getSeverityValue(e) {
return e.properties.casualties || 0;
}
getSeverityColor(e) {
return "#ef4444";
}
getSeveritySize(e) {
return 16;
}
getEntityIcon(e) {
return m(e.properties.type || "Unknown");
}
async fetch(e) {
try {
let e = process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL ? process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL.replace(/\/stream$/, "").replace(/^ws/, "http") : "http://localhost:5001", t = await globalThis.fetch(`${e}/data/iranwarlive`);
if (!t.ok) throw Error(`IranWarLive Backend returned ${t.status}`);
let n = await t.json();
return !n.items || !Array.isArray(n.items) ? [] : n.items.map((e) => {
let t = e._osint_meta?.coordinates?.lat || 0, n = e._osint_meta?.coordinates?.lng || 0, r = new Date(e.timestamp), i = Math.max(0, Math.round((Date.now() - r.getTime()) / (1e3 * 60 * 60)));
return {
id: e.event_id,
pluginId: "iranwarlive",
latitude: t,
longitude: n,
timestamp: r,
label: e.type + (e.location ? ` in ${e.location}` : ""),
properties: {
hours_ago: i,
type: e.type,
confidence: e.confidence,
location: e.location,
summary: e.event_summary,
casualties: e._osint_meta?.casualties || 0,
source_url: e.source_url,
preview_image: e.preview_image,
preview_video: e.preview_video
}
};
});
} catch (e) {
return console.error("[IranWarLivePlugin] Fetch error from microservice backend:", e), [];
}
}
getServerConfig() {
return {
apiBasePath: "/api/iranwarlive",
pollingIntervalMs: 0,
historyEnabled: !0
};
}
getFilterDefinitions() {
return [
{
id: "type",
label: "Strike Type",
type: "select",
propertyKey: "type",
options: [{
value: "Missile Strike",
label: "Missile Strike"
}, {
value: "Air Strike",
label: "Air Strike"
}]
},
{
id: "confidence",
label: "Intelligence Confidence",
type: "select",
propertyKey: "confidence",
options: [{
value: "News Wire",
label: "News Wire"
}, {
value: "State Actor",
label: "State Defense Press"
}]
},
{
id: "hours_ago",
label: "Max Hours Ago",
type: "range",
propertyKey: "hours_ago",
range: {
min: 0,
max: 168,
step: 1
}
}
];
}
getLegend() {
return [{
label: "Kinetic Event",
color: "#ef4444"
}];
}
};
//#endregion
export { h as IranWarLivePlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "iranwarlive",
"name": "iranwarlive",
"version": "1.0.2",
"description": "Iran War Live — Live OSINT data sourced from IranWarLive.com",
"capabilities": [],
"category": "Conflict",
"icon": "ShieldAlert",
"entry": "/plugins/iranwarlive/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-113
View File
@@ -1,113 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = (n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
}, c = s("lamp", [
["path", {
d: "M12 12v6",
key: "3ahymv"
}],
["path", {
d: "M4.077 10.615A1 1 0 0 0 5 12h14a1 1 0 0 0 .923-1.385l-3.077-7.384A2 2 0 0 0 15 2H9a2 2 0 0 0-1.846 1.23Z",
key: "1l7kg2"
}],
["path", {
d: "M8 20a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1z",
key: "1mmzpi"
}]
]), l = s("lightbulb", [
["path", {
d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",
key: "1gvzjb"
}],
["path", {
d: "M9 18h6",
key: "x1upvd"
}],
["path", {
d: "M10 22h4",
key: "ceow96"
}]
]), u = class {
context = null;
iconUrls = {};
defaultLayerColor = "#3b82f6";
clusterDistance = 50;
maxEntities = 5e3;
iconScale = 1;
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
async fetch(e) {
return [];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: this.clusterDistance,
maxEntities: this.maxEntities
};
}
getEntityColor(e) {
return this.defaultLayerColor;
}
getEntityIcon(e) {
return this.icon;
}
renderEntity(e) {
let t = this.getEntityColor(e), n = this.getEntityIcon(e), r = `${n?.displayName || n?.name || "default"}-${t}`;
return this.iconUrls[r] || (this.iconUrls[r] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(n, { color: t })), {
type: "billboard",
iconUrl: this.iconUrls[r],
color: t,
iconScale: this.iconScale
};
}
}, d = class extends u {
constructor(...e) {
super(...e), this.id = "lighthouses", this.name = "Lighthouses", this.description = "Lighthouses worldwide from OSM", this.icon = c, this.category = "maritime", this.version = "1.0.1", this.defaultLayerColor = "#facc15";
}
getEntityIcon(e) {
return l;
}
};
//#endregion
export { d as LighthousesPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "lighthouses",
"name": "lighthouses",
"version": "1.0.1",
"description": "WorldWideView plugin — Lighthouses worldwide from OSM",
"capabilities": [],
"category": "Maritime",
"icon": "Lamp",
"entry": "/plugins/lighthouses/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
File diff suppressed because it is too large. Load diff
-12
View File
@@ -1,12 +0,0 @@
{
"id": "maritime",
"name": "maritime",
"version": "1.0.7",
"description": "WorldWideView plugin for real-time vessel tracking via AIS feeds. Color-coded by vessel type with speed and heading indicators",
"capabilities": [],
"category": "Maritime",
"icon": "Ship",
"entry": "/plugins/maritime/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
@@ -1,225 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("shield", [["path", {
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
key: "oel41y"
}]]), c = class {
category = "aviation";
context = null;
defaultLayerColor = "#3b82f6";
defaultTrailColor = "#00fff7";
iconUrl = "/plane-icon.svg";
modelUrl = "/airplane/scene.gltf";
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: 40,
maxEntities: 5e3
};
}
renderEntity(e) {
let t = e.properties.altitude_m, n = !e.properties.on_ground;
return {
type: "model",
iconUrl: this.iconUrl,
size: n ? 8 : 5,
modelUrl: this.modelUrl,
modelScale: 2.56,
modelMinPixelSize: 16,
modelHeadingOffset: 180,
color: this.getAltitudeColor(t),
rotation: e.heading,
labelText: e.label || void 0,
labelFont: "11px JetBrains Mono, monospace"
};
}
getSelectionBehavior(e) {
return e.properties.on_ground ? null : {
showTrail: !0,
trailDurationSec: 60,
trailStepSec: 5,
trailColor: this.defaultTrailColor,
flyToOffsetMultiplier: 3,
flyToBaseDistance: 3e4
};
}
};
//#endregion
//#region src/index.ts
function l(e) {
return e * .3048;
}
var u = class extends c {
constructor(...e) {
super(...e), this.id = "military-aviation", this.name = "Military Aviation", this.description = "Real-time military aircraft tracking via adsb.lol", this.icon = s, this.version = "1.0.4", this.defaultLayerColor = "#ff6f00", this.defaultTrailColor = "#ffea00", this.iconUrl = "/military-plane-icon.svg";
}
getAltitudeColor(e) {
let t = e === null ? null : e / .3048;
return t === null || t <= 0 ? "#39ff14" : t < 1e4 ? "#ff6f00" : t < 25e3 ? "#ff1744" : t < 4e4 ? "#ff4081" : "#ffea00";
}
mapPayloadToEntities(e) {
let t = [];
if (Array.isArray(e)) t = e;
else if (e && typeof e == "object") t = Object.values(e);
else return [];
return t.filter((e) => e.lat != null && e.lon != null).map((e) => {
let t = typeof e.alt_baro == "number" ? e.alt_baro : null, n = t === null ? null : l(t), r = e.alt_baro === "ground";
return {
id: `military-aviation-${e.hex}`,
pluginId: "military-aviation",
latitude: e.lat,
longitude: e.lon,
altitude: n === null ? 0 : n * 10,
heading: e.track ?? void 0,
speed: e.gs ?? void 0,
timestamp: /* @__PURE__ */ new Date(),
label: e.flight?.trim() || e.r || e.hex,
properties: {
hex: e.hex,
callsign: e.flight?.trim() || null,
registration: e.r || null,
aircraft_type: e.t || null,
altitude_ft: t,
altitude_m: n,
ground_speed_kts: e.gs ?? null,
heading: e.track ?? null,
squawk: e.squawk || null,
on_ground: r,
category: e.category || null,
emergency: e.emergency || null,
history: e.history || []
}
};
});
}
async fetch(e) {
try {
let e = "http://localhost:5001";
typeof process < "u" && process.env && process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL ? e = process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL.replace(/\/stream$/, "").replace(/^ws/, "http") : globalThis.__WWV_HOST__?.NEXT_PUBLIC_WS_ENGINE_URL && (e = globalThis.__WWV_HOST__.NEXT_PUBLIC_WS_ENGINE_URL.replace(/\/stream$/, "").replace(/^ws/, "http"));
let t = await globalThis.fetch(`${e}/data/military-aviation`);
if (!t.ok) throw Error(`Military API returned ${t.status}`);
let n = await t.json(), r = n.ac || n.items;
return this.mapPayloadToEntities(r);
} catch (e) {
return console.error("[MilitaryPlugin] Fetch error:", e), this.context?.onError && this.context.onError(e), [];
}
}
mapWebsocketPayload(e) {
return this.mapPayloadToEntities(e);
}
getServerConfig() {
return {
apiBasePath: "/api/military-aviation",
pollingIntervalMs: 0,
historyEnabled: !0
};
}
getFilterDefinitions() {
return [
{
id: "aircraft_type",
label: "Aircraft Type",
type: "text",
propertyKey: "aircraft_type"
},
{
id: "callsign",
label: "Callsign",
type: "text",
propertyKey: "callsign"
},
{
id: "registration",
label: "Registration",
type: "text",
propertyKey: "registration"
},
{
id: "altitude",
label: "Altitude (ft)",
type: "range",
propertyKey: "altitude_ft",
range: {
min: 0,
max: 6e4,
step: 1e3
}
},
{
id: "on_ground",
label: "On Ground",
type: "boolean",
propertyKey: "on_ground"
}
];
}
getLegend() {
return [
{
label: "0 ft (Surface)",
color: "#39ff14"
},
{
label: "< 10,000 ft",
color: "#ff6f00"
},
{
label: "10,000 - 25,000 ft",
color: "#ff1744"
},
{
label: "25,000 - 40,000 ft",
color: "#ff4081"
},
{
label: "> 40,000 ft",
color: "#ffea00"
}
];
}
};
//#endregion
export { u as MilitaryPlugin };
@@ -1,13 +0,0 @@
{
"id": "military-aviation",
"name": "Military Aviation",
"description": "Live WebSocket tracking of military aircraft via wwv-data-engine (Microservice)",
"icon": "Crosshair",
"category": "Aviation",
"type": "data-layer",
"format": "bundle",
"entry": "/plugins/military-aviation/frontend.mjs",
"trust": "unverified",
"capabilities": ["data", "websocket"],
"version": "1.0.4"
}
@@ -1,4 +0,0 @@
//#region src/index.ts
var e = "military-bases";
//#endregion
export { e as PLUGIN_ID };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "military-bases",
"name": "military-bases",
"version": "1.0.2",
"description": "WorldWideView plugin for worldwide military bases, airfields, and barracks from OpenStreetMap",
"capabilities": [],
"category": "Military",
"icon": "Swords",
"entry": "/plugins/military-bases/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-115
View File
@@ -1,115 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("pickaxe", [
["path", {
d: "m14 13-8.381 8.38a1 1 0 0 1-3.001-3L11 9.999",
key: "1lw9ds"
}],
["path", {
d: "M15.973 4.027A13 13 0 0 0 5.902 2.373c-1.398.342-1.092 2.158.277 2.601a19.9 19.9 0 0 1 5.822 3.024",
key: "ffj4ej"
}],
["path", {
d: "M16.001 11.999a19.9 19.9 0 0 1 3.024 5.824c.444 1.369 2.26 1.676 2.603.278A13 13 0 0 0 20 8.069",
key: "8tj4zw"
}],
["path", {
d: "M18.352 3.352a1.205 1.205 0 0 0-1.704 0l-5.296 5.296a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l5.296-5.296a1.205 1.205 0 0 0 0-1.704z",
key: "hh6h97"
}]
]), c = ({ viewer: e, enabled: t }) => {
let n = globalThis.__WWV_HOST__.React.useRef(null);
return globalThis.__WWV_HOST__.React.useEffect(() => {
if (!e || !t) {
e && n.current && (e.dataSources.remove(n.current), n.current = null);
return;
}
let r = !1;
async function i() {
if (e) try {
let t = new globalThis.__WWV_HOST__.Cesium.GeoJsonDataSource("mineral-mines");
if (await t.load("/data/mineral_mines.geojson", {
markerSymbol: "minepost",
markerColor: globalThis.__WWV_HOST__.Cesium.Color.fromCssColorString("#d97706"),
markerSize: 24,
clampToGround: !0
}), r) return;
t.clustering.enabled = !0, t.clustering.pixelRange = 40, t.clustering.minimumClusterSize = 3, t.clustering.clusterEvent.addEventListener((e, t) => {
t.label.show = !0, t.label.text = e.length.toLocaleString(), t.label.font = "bold 14px sans-serif", t.label.fillColor = globalThis.__WWV_HOST__.Cesium.Color.WHITE, t.label.outlineColor = globalThis.__WWV_HOST__.Cesium.Color.BLACK, t.label.outlineWidth = 2, t.label.style = globalThis.__WWV_HOST__.Cesium.LabelStyle.FILL_AND_OUTLINE, t.label.verticalOrigin = globalThis.__WWV_HOST__.Cesium.VerticalOrigin.CENTER, t.label.horizontalOrigin = globalThis.__WWV_HOST__.Cesium.HorizontalOrigin.CENTER, t.billboard.show = !0, t.billboard.id = t.label.id, t.billboard.verticalOrigin = globalThis.__WWV_HOST__.Cesium.VerticalOrigin.CENTER;
let n = new globalThis.__WWV_HOST__.Cesium.PinBuilder();
t.billboard.image = n.fromColor(globalThis.__WWV_HOST__.Cesium.Color.fromCssColorString("#d97706").withAlpha(.8), 48).toDataURL();
}), e.dataSources.add(t), n.current = t;
} catch (e) {
console.error("[MineralMinesPlugin] Failed to load data", e);
}
}
return i(), () => {
r = !0, e && n.current && (e.dataSources.remove(n.current), n.current = null);
};
}, [e, t]), null;
}, l = class {
constructor() {
this.id = "mineral-mines", this.name = "Mineral Mines", this.description = "Global mining sites and quarries from OpenStreetMap.", this.icon = s, this.category = "economic", this.version = "1.0.0";
}
async initialize(e) {}
destroy() {}
async fetch(e) {
return [];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: "#d97706",
clusterEnabled: !0,
clusterDistance: 50,
maxEntities: 5e4
};
}
renderEntity(e) {
return this.iconUrl ||= globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(s, { color: "#d97706" }), {
type: "billboard",
iconUrl: this.iconUrl,
color: "#d97706"
};
}
getGlobeComponent() {
return c;
}
};
//#endregion
export { l as MineralMinesPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "mineral-mines",
"name": "mineral-mines",
"version": "1.0.0",
"description": "WorldWideView plugin — Global mining sites and quarries from OpenStreetMap.",
"capabilities": [],
"category": "Economic",
"icon": "Pickaxe",
"entry": "/plugins/mineral-mines/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-181
View File
@@ -1,181 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = (n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
}, c = s("atom", [
["circle", {
cx: "12",
cy: "12",
r: "1",
key: "41hilf"
}],
["path", {
d: "M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",
key: "1l2ple"
}],
["path", {
d: "M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",
key: "1wam0m"
}]
]), l = s("radiation", [
["path", {
d: "M12 12h.01",
key: "1mp3jc"
}],
["path", {
d: "M14 15.4641a4 4 0 0 1-4 0L7.52786 19.74597 A 1 1 0 0 0 7.99303 21.16211 10 10 0 0 0 16.00697 21.16211 1 1 0 0 0 16.47214 19.74597z",
key: "1y4lzb"
}],
["path", {
d: "M16 12a4 4 0 0 0-2-3.464l2.472-4.282a1 1 0 0 1 1.46-.305 10 10 0 0 1 4.006 6.94A1 1 0 0 1 21 12z",
key: "163ggk"
}],
["path", {
d: "M8 12a4 4 0 0 1 2-3.464L7.528 4.254a1 1 0 0 0-1.46-.305 10 10 0 0 0-4.006 6.94A1 1 0 0 0 3 12z",
key: "1l9i0b"
}]
]), u = class {
context = null;
iconUrls = {};
defaultLayerColor = "#3b82f6";
clusterDistance = 50;
maxEntities = 5e3;
iconScale = 1;
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
async fetch(e) {
return [];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: this.clusterDistance,
maxEntities: this.maxEntities
};
}
getEntityColor(e) {
return this.defaultLayerColor;
}
getEntityIcon(e) {
return this.icon;
}
renderEntity(e) {
let t = this.getEntityColor(e), n = this.getEntityIcon(e), r = `${n?.displayName || n?.name || "default"}-${t}`;
return this.iconUrls[r] || (this.iconUrls[r] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(n, { color: t })), {
type: "billboard",
iconUrl: this.iconUrls[r],
color: t,
iconScale: this.iconScale
};
}
}, d = {
operational: "#22c55e",
"under construction": "#eab308",
decommissioned: "#64748b",
abandoned: "#ef4444"
}, f = class extends u {
constructor(...e) {
super(...e), this.id = "nuclear", this.name = "Nuclear Facilities", this.description = "Global nuclear power plants and reactors from OSM.", this.icon = c, this.category = "infrastructure", this.version = "1.0.2", this.defaultLayerColor = "#22d3ee", this.maxEntities = 1e3;
}
getEntityColor(e) {
return d[(e.properties?.status)?.toLowerCase() || "unknown"] || this.defaultLayerColor;
}
getEntityIcon(e) {
return d[(e.properties?.status)?.toLowerCase() || "unknown"] ? l : c;
}
getFilterDefinitions() {
return [{
id: "status",
label: "Facility Status",
propertyKey: "status",
type: "select",
options: [
{
value: "operational",
label: "Operational"
},
{
value: "under construction",
label: "Under Construction"
},
{
value: "decommissioned",
label: "Decommissioned"
},
{
value: "abandoned",
label: "Abandoned"
}
]
}];
}
getLegend() {
return [
{
label: "Operational",
color: d.operational,
filterId: "status",
filterValue: "operational"
},
{
label: "Under Const.",
color: d["under construction"],
filterId: "status",
filterValue: "under construction"
},
{
label: "Decommissioned",
color: d.decommissioned,
filterId: "status",
filterValue: "decommissioned"
},
{
label: "Abandoned",
color: d.abandoned,
filterId: "status",
filterValue: "abandoned"
}
];
}
};
//#endregion
export { f as NuclearPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "nuclear-facilities",
"name": "nuclear",
"version": "1.0.2",
"description": "WorldWideView plugin displaying global nuclear power plants, reactors, and decommissioned facilities from OpenStreetMap",
"capabilities": [],
"category": "Infrastructure",
"icon": "Atom",
"entry": "/plugins/nuclear/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-235
View File
@@ -1,235 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("satellite", [
["path", {
d: "m13.5 6.5-3.148-3.148a1.205 1.205 0 0 0-1.704 0L6.352 5.648a1.205 1.205 0 0 0 0 1.704L9.5 10.5",
key: "dzhfyz"
}],
["path", {
d: "M16.5 7.5 19 5",
key: "1ltcjm"
}],
["path", {
d: "m17.5 10.5 3.148 3.148a1.205 1.205 0 0 1 0 1.704l-2.296 2.296a1.205 1.205 0 0 1-1.704 0L13.5 14.5",
key: "nfoymv"
}],
["path", {
d: "M9 21a6 6 0 0 0-6-6",
key: "1iajcf"
}],
["path", {
d: "M9.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l4.296-4.296a1.205 1.205 0 0 0 0-1.704l-2.296-2.296a1.205 1.205 0 0 0-1.704 0z",
key: "nv9zqy"
}]
]), c = {
stations: "#00fff7",
visual: "#f0abfc",
weather: "#a78bfa",
"gps-ops": "#22c55e",
resource: "#f97316",
starlink: "#ffffff",
military: "#3b82f6"
};
function l(e) {
return c[e] ?? "#94a3b8";
}
var u = class {
constructor() {
this.id = "satellite", this.name = "Satellites", this.description = "Real-time satellite tracking (ISS, GPS, weather, military)", this.icon = s, this.category = "infrastructure", this.version = "1.0.0", this.context = null, this.iconUrls = {};
}
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
async fetch(e) {
try {
let e = process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL ? process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL.replace(/\/stream$/, "").replace(/^ws/, "http") : "http://localhost:5001", t = await globalThis.fetch(`${e}/data/satellite`);
if (!t.ok) throw Error(`Satellite API returned ${t.status}`);
let n = await t.json(), r = n.satellites || n.items || [];
return !r || !Array.isArray(r) ? [] : r.map((e) => ({
id: `satellite-${e.noradId}`,
pluginId: "satellite",
latitude: e.latitude,
longitude: e.longitude,
altitude: e.altitude * 1e3,
heading: e.heading,
speed: e.speed,
timestamp: /* @__PURE__ */ new Date(),
label: e.name,
properties: {
noradId: e.noradId,
name: e.name,
group: e.group,
country: e.country,
objectType: e.objectType,
altitudeKm: e.altitude,
period: e.period
}
}));
} catch (e) {
return console.error("[SatellitePlugin] Fetch error:", e), [];
}
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: "#00fff7",
clusterEnabled: !1,
clusterDistance: 0,
maxEntities: 1e3
};
}
renderEntity(e) {
let t = e.properties.group || "", n = t === "stations", r = l(t);
return this.iconUrls[r] || (this.iconUrls[r] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(s, { color: r })), {
type: "billboard",
iconUrl: this.iconUrls[r],
color: r,
size: n ? 12 : 6,
outlineColor: "#000000",
outlineWidth: 1,
labelText: n ? e.label : void 0,
labelFont: "12px sans-serif",
disableManualHorizonCulling: !0,
disableDepthTestDistance: 0
};
}
getSelectionBehavior(e) {
return {
showTrail: !0,
trailDurationSec: 300,
trailStepSec: 10,
trailColor: "#00fff7",
flyToOffsetMultiplier: 4,
flyToBaseDistance: 2e6
};
}
getFilterDefinitions() {
return [{
id: "group",
label: "Satellite Group",
type: "select",
propertyKey: "group",
options: [
{
value: "stations",
label: "Space Stations"
},
{
value: "visual",
label: "Brightest Satellites"
},
{
value: "weather",
label: "Weather"
},
{
value: "gps-ops",
label: "GPS"
},
{
value: "resource",
label: "Earth Observation"
}
]
}];
}
getLegend() {
return [
{
label: "Space Stations",
color: l("stations"),
filterId: "group",
filterValue: "stations"
},
{
label: "Brightest Satellites",
color: l("visual"),
filterId: "group",
filterValue: "visual"
},
{
label: "Weather",
color: l("weather"),
filterId: "group",
filterValue: "weather"
},
{
label: "GPS",
color: l("gps-ops"),
filterId: "group",
filterValue: "gps-ops"
},
{
label: "Earth Observation",
color: l("resource"),
filterId: "group",
filterValue: "resource"
},
{
label: "Starlink",
color: l("starlink"),
filterId: "group",
filterValue: "starlink"
},
{
label: "Military",
color: l("military"),
filterId: "group",
filterValue: "military"
},
{
label: "Other",
color: l("other"),
filterId: "group",
filterValue: "other"
}
];
}
getServerConfig() {
return {
apiBasePath: "/api/satellite",
pollingIntervalMs: 0,
historyEnabled: !0
};
}
};
//#endregion
export { u as SatellitePlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "satellite",
"name": "satellite",
"version": "1.0.2",
"description": "WorldWideView plugin for real-time satellite tracking using CelesTrak TLE data and SGP4 propagation. Tracks ISS, Starlink, GPS, weather, military, and reconnaissance satellites on the 3D globe.",
"capabilities": [],
"category": "Space",
"icon": "Satellite",
"entry": "/plugins/satellite/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-103
View File
@@ -1,103 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("anchor", [
["path", {
d: "M12 6v16",
key: "nqf5sj"
}],
["path", {
d: "m19 13 2-1a9 9 0 0 1-18 0l2 1",
key: "y7qv08"
}],
["path", {
d: "M9 11h6",
key: "1fldmi"
}],
["circle", {
cx: "12",
cy: "4",
r: "2",
key: "muu5ef"
}]
]), c = class {
context = null;
iconUrls = {};
defaultLayerColor = "#3b82f6";
clusterDistance = 50;
maxEntities = 5e3;
iconScale = 1;
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
async fetch(e) {
return [];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: this.clusterDistance,
maxEntities: this.maxEntities
};
}
getEntityColor(e) {
return this.defaultLayerColor;
}
getEntityIcon(e) {
return this.icon;
}
renderEntity(e) {
let t = this.getEntityColor(e), n = this.getEntityIcon(e), r = `${n?.displayName || n?.name || "default"}-${t}`;
return this.iconUrls[r] || (this.iconUrls[r] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(n, { color: t })), {
type: "billboard",
iconUrl: this.iconUrls[r],
color: t,
iconScale: this.iconScale
};
}
}, l = class extends c {
constructor(...e) {
super(...e), this.id = "seaports", this.name = "Seaports", this.description = "Harbours and seaports worldwide from OSM", this.icon = s, this.category = "maritime", this.version = "1.0.1", this.defaultLayerColor = "#0ea5e9";
}
};
//#endregion
export { l as SeaportsPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "seaports",
"name": "seaports",
"version": "1.0.1",
"description": "WorldWideView plugin — Harbours and seaports worldwide from OSM",
"capabilities": [],
"category": "Maritime",
"icon": "Anchor",
"entry": "/plugins/seaports/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-101
View File
@@ -1,101 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("rocket", [
["path", {
d: "M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",
key: "qeys4"
}],
["path", {
d: "M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",
key: "u4xsad"
}],
["path", {
d: "M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",
key: "676m9"
}],
["path", {
d: "M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",
key: "92ym6u"
}]
]), c = class {
context = null;
iconUrls = {};
defaultLayerColor = "#3b82f6";
clusterDistance = 50;
maxEntities = 5e3;
iconScale = 1;
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
async fetch(e) {
return [];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: this.clusterDistance,
maxEntities: this.maxEntities
};
}
getEntityColor(e) {
return this.defaultLayerColor;
}
getEntityIcon(e) {
return this.icon;
}
renderEntity(e) {
let t = this.getEntityColor(e), n = this.getEntityIcon(e), r = `${n?.displayName || n?.name || "default"}-${t}`;
return this.iconUrls[r] || (this.iconUrls[r] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(n, { color: t })), {
type: "billboard",
iconUrl: this.iconUrls[r],
color: t,
iconScale: this.iconScale
};
}
}, l = class extends c {
constructor(...e) {
super(...e), this.id = "spaceports", this.name = "Spaceports", this.description = "Space launch sites worldwide from OSM", this.icon = s, this.category = "space", this.version = "1.0.2", this.defaultLayerColor = "#7c3aed", this.maxEntities = 1e3;
}
};
//#endregion
export { l as SpaceportsPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "spaceports",
"name": "spaceports",
"version": "1.0.2",
"description": "WorldWideView plugin — Space launch sites worldwide from OSM",
"capabilities": [],
"category": "Space",
"icon": "Rocket",
"entry": "/plugins/spaceports/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-87
View File
@@ -1,87 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("mountain", [["path", {
d: "m8 3 4 8 5-5 5 15H2L8 3z",
key: "otkl63"
}]]), c = class {
context = null;
iconUrls = {};
defaultLayerColor = "#3b82f6";
clusterDistance = 50;
maxEntities = 5e3;
iconScale = 1;
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
async fetch(e) {
return [];
}
getPollingInterval() {
return 0;
}
getLayerConfig() {
return {
color: this.defaultLayerColor,
clusterEnabled: !0,
clusterDistance: this.clusterDistance,
maxEntities: this.maxEntities
};
}
getEntityColor(e) {
return this.defaultLayerColor;
}
getEntityIcon(e) {
return this.icon;
}
renderEntity(e) {
let t = this.getEntityColor(e), n = this.getEntityIcon(e), r = `${n?.displayName || n?.name || "default"}-${t}`;
return this.iconUrls[r] || (this.iconUrls[r] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(n, { color: t })), {
type: "billboard",
iconUrl: this.iconUrls[r],
color: t,
iconScale: this.iconScale
};
}
}, l = class extends c {
constructor(...e) {
super(...e), this.id = "volcanoes", this.name = "Volcanoes", this.description = "Active and dormant volcanoes worldwide from OSM", this.icon = s, this.category = "natural-disaster", this.version = "1.0.1", this.defaultLayerColor = "#ef4444", this.maxEntities = 1e3;
}
};
//#endregion
export { l as VolcanoesPlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "volcanoes",
"name": "volcanoes",
"version": "1.0.1",
"description": "WorldWideView plugin — Active and dormant volcanoes worldwide from OSM",
"capabilities": [],
"category": "Natural Disaster",
"icon": "Mountain",
"entry": "/plugins/volcanoes/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
-234
View File
@@ -1,234 +0,0 @@
//#region ../../node_modules/.pnpm/[email protected][email protected]/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
var e = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), t = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), n = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), r = (e) => {
let t = n(e);
return t.charAt(0).toUpperCase() + t.slice(1);
}, i = {
xmlns: "http://www.w3.org/2000/svg",
width: 24,
height: 24,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 2,
strokeLinecap: "round",
strokeLinejoin: "round"
}, a = (e) => {
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
return !1;
}, o = globalThis.__WWV_HOST__.React.forwardRef(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: o, className: s = "", children: c, iconNode: l, ...u }, d) => globalThis.__WWV_HOST__.React.createElement("svg", {
ref: d,
...i,
width: n,
height: n,
stroke: t,
strokeWidth: o ? Number(r) * 24 / Number(n) : r,
className: e("lucide", s),
...!c && !a(u) && { "aria-hidden": "true" },
...u
}, [...l.map(([e, t]) => globalThis.__WWV_HOST__.React.createElement(e, t)), ...Array.isArray(c) ? c : [c]])), s = ((n, i) => {
let a = globalThis.__WWV_HOST__.React.forwardRef(({ className: a, ...s }, c) => globalThis.__WWV_HOST__.React.createElement(o, {
ref: c,
iconNode: i,
className: e(`lucide-${t(r(n))}`, `lucide-${n}`, a),
...s
}));
return a.displayName = r(n), a;
})("flame", [["path", {
d: "M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",
key: "1slcih"
}]]);
//#endregion
//#region src/index.ts
function c(e) {
return e < 10 ? "#fbbf24" : e < 50 ? "#f97316" : e < 100 ? "#ef4444" : "#dc2626";
}
function l(e) {
return e < 10 ? 5 : e < 50 ? 7 : e < 100 ? 9 : 12;
}
function u(e) {
return e < 10 ? "low" : e < 50 ? "moderate" : e < 100 ? "high" : "extreme";
}
var d = class {
constructor() {
this.id = "wildfire", this.name = "Wildfire", this.description = "Active fire detection via NASA FIRMS (VIIRS)", this.icon = s, this.category = "natural-disaster", this.version = "1.0.0", this.context = null, this.iconUrls = {};
}
async initialize(e) {
this.context = e;
}
destroy() {
this.context = null;
}
async fetch(e) {
try {
let e = process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL ? process.env.NEXT_PUBLIC_DEFAULT_ENGINE_URL.replace(/\/stream$/, "").replace(/^ws/, "http") : "http://localhost:5001", t = await globalThis.fetch(`${e}/data/wildfires`);
if (!t.ok) throw Error(`Wildfire API returned ${t.status}`);
let n = await t.json();
return !n.items || !Array.isArray(n.items) ? [] : n.items.map((e) => ({
id: `wildfire-${e.latitude.toFixed(4)}-${e.longitude.toFixed(4)}-${e.acq_date}-${e.tier || 3}`,
pluginId: "wildfire",
latitude: e.latitude,
longitude: e.longitude,
timestamp: /* @__PURE__ */ new Date(`${e.acq_date}T${e.acq_time.padStart(4, "0").slice(0, 2)}:${e.acq_time.padStart(4, "0").slice(2)}:00Z`),
label: `FRP: ${e.frp}`,
properties: {
frp: e.frp,
frp_band: u(e.frp),
confidence: e.confidence,
satellite: e.satellite,
acq_date: e.acq_date,
acq_time: e.acq_time,
bright_ti4: e.bright_ti4,
bright_ti5: e.bright_ti5,
tier: e.tier
}
}));
} catch (e) {
return console.error("[WildfirePlugin] Fetch error:", e), [];
}
}
getPollingInterval() {
return 0;
}
getServerConfig() {
return {
apiBasePath: "/api/wildfires",
pollingIntervalMs: 0,
historyEnabled: !0
};
}
getLayerConfig() {
return {
color: "#ef4444",
clusterEnabled: !0,
clusterDistance: 30
};
}
renderEntity(e) {
let t = e.properties.frp || 0, n = c(t), r = e.properties.tier || 3, i;
return r === 1 ? i = {
near: 35e5,
far: Infinity
} : r === 2 ? i = {
near: 1e6,
far: 35e5
} : r === 3 && (i = {
near: 0,
far: 1e6
}), this.iconUrls[n] || (this.iconUrls[n] = globalThis.__WWV_HOST__.WWVPluginSDK.createSvgIconUrl(s, { color: n })), {
type: "billboard",
iconUrl: this.iconUrls[n],
color: n,
iconScale: l(t) / 10 * (r === 1 ? 2 : r === 2 ? 1.5 : 1),
distanceDisplayCondition: i
};
}
getFilterDefinitions() {
return [
{
id: "frp",
label: "Fire Radiative Power (MW)",
type: "range",
propertyKey: "frp",
range: {
min: 0,
max: 500,
step: 10
}
},
{
id: "frp_band",
label: "Intensity Category",
type: "select",
propertyKey: "frp_band",
options: [
{
value: "low",
label: "FRP < 10 (Low)"
},
{
value: "moderate",
label: "FRP 10 - 50 (Moderate)"
},
{
value: "high",
label: "FRP 50 - 100 (High)"
},
{
value: "extreme",
label: "FRP > 100 (Extreme)"
}
]
},
{
id: "confidence",
label: "Confidence",
type: "select",
propertyKey: "confidence",
options: [
{
value: "low",
label: "Low"
},
{
value: "nominal",
label: "Nominal"
},
{
value: "high",
label: "High"
}
]
},
{
id: "satellite",
label: "Satellite",
type: "select",
propertyKey: "satellite",
options: [
{
value: "N",
label: "Suomi NPP"
},
{
value: "1",
label: "NOAA-20"
},
{
value: "2",
label: "NOAA-21"
}
]
}
];
}
getLegend() {
return [
{
label: "FRP < 10 (Low)",
color: "#fbbf24",
filterId: "frp_band",
filterValue: "low"
},
{
label: "FRP 10 - 50 (Moderate)",
color: "#f97316",
filterId: "frp_band",
filterValue: "moderate"
},
{
label: "FRP 50 - 100 (High)",
color: "#ef4444",
filterId: "frp_band",
filterValue: "high"
},
{
label: "FRP > 100 (Extreme)",
color: "#dc2626",
filterId: "frp_band",
filterValue: "extreme"
}
];
}
};
//#endregion
export { d as WildfirePlugin };
-12
View File
@@ -1,12 +0,0 @@
{
"id": "wildfire",
"name": "wildfire",
"version": "1.0.7",
"description": "WorldWideView plugin for active wildfire and hotspot detection using NASA FIRMS (VIIRS) satellite data. Supports tiered LOD rendering and FRP-based sizing",
"capabilities": [],
"category": "Natural Disaster",
"icon": "Flame",
"entry": "/plugins/wildfire/frontend.mjs",
"format": "bundle",
"trust": "unverified"
}
+1 -1
View File
@@ -1,7 +1,7 @@
import fs from "fs";
import path from "path";
const packagesDir = path.resolve(process.cwd(), "packages");
const packagesDir = path.resolve(process.cwd(), "..", "worldwideview-plugins", "packages");
const publicPluginsDir = path.resolve(process.cwd(), "public", "plugins");
if (!fs.existsSync(publicPluginsDir)) {
+33 -5
View File
@@ -12,13 +12,41 @@ if (!branchName) {
}
const rootDir = process.cwd();
const worktreeDirName = branchName.replace(/\//g, '-');
const worktreePath = path.join(rootDir, '.worktrees', worktreeDirName);
// 2. Validate worktree exists
// 2. Find worktree path dynamically
let worktreePath = null;
try {
const output = execSync('git worktree list --porcelain', { encoding: 'utf8' });
const blocks = output.trim().split(/\r?\n\r?\n/);
for (const block of blocks) {
const lines = block.split(/\r?\n/);
const wtPathLine = lines.find(l => l.startsWith('worktree '));
const branchLine = lines.find(l => l.startsWith('branch '));
if (wtPathLine && branchLine) {
const currentBranch = branchLine.substring('branch refs/heads/'.length);
if (currentBranch === branchName) {
worktreePath = wtPathLine.substring('worktree '.length);
break;
}
}
}
} catch (err) {
console.warn('\x1b[33mWarning: Failed to parse git worktree list.\x1b[0m');
}
// Fallback to legacy behavior if not found via git
if (!worktreePath) {
const worktreeDirName = branchName.replace(/\//g, '-');
worktreePath = path.join(rootDir, '.worktrees', worktreeDirName);
}
// 3. Validate worktree exists
if (!fs.existsSync(worktreePath)) {
console.error(`\x1b[31mError: Worktree directory not found at ${worktreePath}\x1b[0m`);
console.error(`Ensure you have created it using 'git worktree add .worktrees/${worktreeDirName} -b ${branchName}'`);
console.error(`\x1b[31mError: Worktree directory not found for branch '${branchName}'\x1b[0m`);
console.error(`Searched path: ${worktreePath}`);
console.error(`Ensure you have created it using 'git worktree add <path> -b ${branchName}'`);
process.exit(1);
}
+62
View File
@@ -0,0 +1,62 @@
Write-Host "[*] Setting up WorldWideView for local self-hosting..."
# Check Docker
try {
$null = docker info 2>&1
if ($LASTEXITCODE -ne 0) { throw }
} catch {
Write-Host "[Error] Docker is not running or not accessible."
Write-Host "Please install or start Docker Desktop: https://docs.docker.com/get-docker/"
exit 1
}
# Check Docker Compose
try {
$null = docker compose version 2>&1
if ($LASTEXITCODE -ne 0) { throw }
} catch {
Write-Host "[Error] Docker Compose is not installed or accessible."
exit 1
}
# Generate docker-compose.yml
Write-Host "[*] Creating docker-compose.yml..."
$dockerCompose = @(
"services:"
" wwv:"
" image: ghcr.io/silvertakana/worldwideview:latest"
" ports:"
" - `"3000:3000`""
" volumes:"
" - wwv-data:/app/data"
" env_file:"
" - .env"
" restart: unless-stopped"
""
"volumes:"
" wwv-data:"
)
$dockerCompose | Out-File -FilePath docker-compose.yml -Encoding utf8
# Generate .env
if (-Not (Test-Path .env)) {
Write-Host "[*] Generating new .env file with AUTH_SECRET..."
$bytes = New-Object Byte[] 32
[System.Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes)
$secret = -join ($bytes | ForEach-Object { $_.ToString("x2") })
"AUTH_SECRET=$secret" | Out-File -FilePath .env -Encoding ascii
"NEXT_PUBLIC_WWV_EDITION=local" | Out-File -FilePath .env -Encoding ascii -Append
} else {
Write-Host "[Success] .env already exists, skipping generation."
}
Write-Host "[*] Starting Docker container..."
docker compose up -d
Write-Host "`n[Success] WorldWideView is running at http://localhost:3000"
Write-Host " Data is persisted in Docker volume 'wwv-data'"
Write-Host " Auth secret is saved in .env (don't delete this file)`n"
Write-Host "To stop the server: docker compose down"
Write-Host "To view logs: docker compose logs -f wwv"
+63
View File
@@ -0,0 +1,63 @@
#!/bin/bash
set -e
echo "🌍 Setting up WorldWideView for local self-hosting..."
# Check if docker is actually available and running
if ! docker info > /dev/null 2>&1; then
echo "❌ Error: Docker is not running or not accessible."
echo "If you are on Windows using WSL, ensure Docker Desktop is running and WSL integration is enabled for your default distro."
echo "Please install or start Docker Desktop: https://docs.docker.com/get-docker/"
exit 1
fi
# Check for docker compose plugin
if ! docker compose version > /dev/null 2>&1; then
echo "❌ Error: Docker Compose is not installed or accessible."
exit 1
fi
# 1. Generate docker-compose.yml
echo "📦 Creating docker-compose.yml..."
cat > docker-compose.yml << 'EOF'
services:
wwv:
image: ghcr.io/silvertakana/worldwideview:latest
ports:
- "3000:3000"
volumes:
- wwv-data:/app/data
env_file:
- .env
restart: unless-stopped # ← Auto-starts on boot
volumes:
wwv-data:
EOF
# 2. Generate .env with a persistent secret
if [ ! -f .env ]; then
echo "🔐 Generating new .env file with AUTH_SECRET..."
# Use openssl if available, otherwise use urandom
if command -v openssl &> /dev/null; then
SECRET=$(openssl rand -hex 32)
else
SECRET=$(head -c 32 /dev/urandom | xxd -p)
fi
echo "AUTH_SECRET=$SECRET" > .env
echo "NEXT_PUBLIC_WWV_EDITION=local" >> .env
else
echo "✅ .env already exists, skipping generation."
fi
# 3. Start it
echo "🚀 Starting Docker container..."
docker compose up -d
echo ""
echo "✅ WorldWideView is running at http://localhost:3000"
echo " Data is persisted in Docker volume 'wwv-data'"
echo " Auth secret is saved in .env (don't delete this file)"
echo ""
echo "To stop the server: docker compose down"
echo "To view logs: docker compose logs -f wwv"
+62
View File
@@ -0,0 +1,62 @@
Write-Host "[*] Setting up WorldWideView for local self-hosting..."
# Check Docker
try {
$null = docker info 2>&1
if ($LASTEXITCODE -ne 0) { throw }
} catch {
Write-Host "[Error] Docker is not running or not accessible."
Write-Host "Please install or start Docker Desktop: https://docs.docker.com/get-docker/"
exit 1
}
# Check Docker Compose
try {
$null = docker compose version 2>&1
if ($LASTEXITCODE -ne 0) { throw }
} catch {
Write-Host "[Error] Docker Compose is not installed or accessible."
exit 1
}
# Generate docker-compose.yml
Write-Host "[*] Creating docker-compose.yml..."
$dockerCompose = @(
"services:"
" wwv:"
" image: ghcr.io/silvertakana/worldwideview:latest"
" ports:"
" - `"3000:3000`""
" volumes:"
" - wwv-data:/app/data"
" env_file:"
" - .env"
" restart: unless-stopped"
""
"volumes:"
" wwv-data:"
)
$dockerCompose | Out-File -FilePath docker-compose.yml -Encoding utf8
# Generate .env
if (-Not (Test-Path .env)) {
Write-Host "[*] Generating new .env file with AUTH_SECRET..."
$bytes = New-Object Byte[] 32
[System.Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes)
$secret = -join ($bytes | ForEach-Object { $_.ToString("x2") })
"AUTH_SECRET=$secret" | Out-File -FilePath .env -Encoding ascii
"NEXT_PUBLIC_WWV_EDITION=local" | Out-File -FilePath .env -Encoding ascii -Append
} else {
Write-Host "[Success] .env already exists, skipping generation."
}
Write-Host "[*] Starting Docker container..."
docker compose up -d
Write-Host "`n[Success] WorldWideView is running at http://localhost:3000"
Write-Host " Data is persisted in Docker volume 'wwv-data'"
Write-Host " Auth secret is saved in .env (don't delete this file)`n"
Write-Host "To stop the server: docker compose down"
Write-Host "To view logs: docker compose logs -f wwv"
Executable
+63
View File
@@ -0,0 +1,63 @@
#!/bin/bash
set -e
echo "🌍 Setting up WorldWideView for local self-hosting..."
# Check if docker is actually available and running
if ! docker info > /dev/null 2>&1; then
echo "❌ Error: Docker is not running or not accessible."
echo "If you are on Windows using WSL, ensure Docker Desktop is running and WSL integration is enabled for your default distro."
echo "Please install or start Docker Desktop: https://docs.docker.com/get-docker/"
exit 1
fi
# Check for docker compose plugin
if ! docker compose version > /dev/null 2>&1; then
echo "❌ Error: Docker Compose is not installed or accessible."
exit 1
fi
# 1. Generate docker-compose.yml
echo "📦 Creating docker-compose.yml..."
cat > docker-compose.yml << 'EOF'
services:
wwv:
image: ghcr.io/silvertakana/worldwideview:latest
ports:
- "3000:3000"
volumes:
- wwv-data:/app/data
env_file:
- .env
restart: unless-stopped # ← Auto-starts on boot
volumes:
wwv-data:
EOF
# 2. Generate .env with a persistent secret
if [ ! -f .env ]; then
echo "🔐 Generating new .env file with AUTH_SECRET..."
# Use openssl if available, otherwise use urandom
if command -v openssl &> /dev/null; then
SECRET=$(openssl rand -hex 32)
else
SECRET=$(head -c 32 /dev/urandom | xxd -p)
fi
echo "AUTH_SECRET=$SECRET" > .env
echo "NEXT_PUBLIC_WWV_EDITION=local" >> .env
else
echo "✅ .env already exists, skipping generation."
fi
# 3. Start it
echo "🚀 Starting Docker container..."
docker compose up -d
echo ""
echo "✅ WorldWideView is running at http://localhost:3000"
echo " Data is persisted in Docker volume 'wwv-data'"
echo " Auth secret is saved in .env (don't delete this file)"
echo ""
echo "To stop the server: docker compose down"
echo "To view logs: docker compose logs -f wwv"
-1
View File
@@ -1 +0,0 @@
UPDATE installed_plugins SET config = json_set(config, '$.format', 'static', '$.dataFile', 'https://cdn.jsdelivr.net/npm/@worldwideview/[email protected]/data/military-bases.geojson') WHERE pluginId = 'military-bases';
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff. Show more