Compare commits

...
Author SHA1 Message Date
Antigravity AI 5012fd1377 feat(sanctions,conflict-zones): enable selection and hover intel for sanctioned countries and conflict zones [Minor]
- Attach _wwvEntity to Resium Entity refs via bindWwvEntity() so InteractionHandler picks them [Minor]
- Build synthetic GeoEntity payloads from static ConflictZone data for conflict-zones plugin [Minor]
- Add sanctions-specific hover fields (country, severity, OFAC count) to EntityInfoCard [Minor]
- Add conflict zone hover intel (escalation score, status, trend) to EntityInfoCard [Minor]
- Bump wwv-plugin-international-sanctions 1.0.0 → 1.1.0 [Minor]
- Bump wwv-plugin-conflict-zones 1.0.0 → 1.1.0 [Minor]
- Bump root 1.9.1 → 1.10.0 [Minor]

Closes #27
2026-04-16 12:25:22 +12:00
Antigravity AI 1a984251b6 chore(core): update configurations and roadmap [Patch]
- set default edition back to local in .env [Patch]

- add AI & Sharing feature stage to ROADMAP [Patch]

- configure workspace limits in tsconfig and rootDir for osm-search [Patch]

- add superpowers documentation for expanding chips and plugin versioning [Patch]
2026-04-16 01:26:00 +12:00
SilvertakanaandAntigravity AI 67ca2abdbc feat: configure demo defaults via env vars (#26)
* feat(core): configure default demo plugins via env vars [Minor]

- parse NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS in AppShell [Minor]

- inject defaultEnabled in layersSlice initLayer [Patch]

- document demo defaults in .env.example [Patch]

* fix(core): enable plugin polling on boot and fix gps ID string [Patch]

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-16 01:20:05 +12:00
SilvertakanaandAntigravity AI b10e7d0a7f fix(core): resolve generic TS errors and update type definitions across plugins [Patch] (#24)
- add npx prisma generate to CI action before type checks [Patch]

- fix missing globSync import in workspace type tests [Patch]

- fix GlobeView undefined indexing for entity rendering [Patch]

- fix OSMSearchPlugin zoom property to flyToBaseDistance [Patch]

- allow getSidebarComponent to accept an optional plugin prop [Patch]

- map categories for embassies and spaceports [Patch]

Co-authored-by: Antigravity AI <[email protected]>
2026-04-16 00:57:03 +12:00
31 changed files with 600 additions and 58 deletions

No files matched your search

+4
View File
@@ -1,5 +1,9 @@
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
# Edition: "local" | "cloud" | "demo"
NEXT_PUBLIC_WWV_EDITION=local
+4
View File
@@ -48,6 +48,10 @@ ACLED_PASSWORD=
# Generate any random string, then set the same value in the marketplace instance config.
WWV_BRIDGE_TOKEN=
# Default plugins enabled on boot for demo edition
# Comma-separated list of plugin IDs
NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS=
# Edition: "local" | "cloud" | "demo"
NEXT_PUBLIC_WWV_EDITION=local
+1
View File
@@ -18,6 +18,7 @@ jobs:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: npx prisma generate
- run: pnpm exec tsc --noEmit
test:
+17 -5
View File
@@ -54,7 +54,19 @@ Each stage is **self-contained and demo-able**. Any stage can be shipped indepen
---
## Stage 5: Publisher Workflow
## Stage 5: AI & Sharing Features (Immediate User Value)
**Demo:** "Chat with the AI to explore the globe, record a narrated briefing, and share the view via a URL."
- [ ] Unified Data Format schema (WWVDocument) with snapshot radius bounding
- [ ] Base64url view link sharing (`#v=...`)
- [ ] Shared `ActionExecutor` core for Animation & Copilot
- [ ] Animation Engine (TrackScheduler, Player, overlays, TTS voice)
- [ ] MCP Server (tools wrapping the action vocabulary)
- [ ] Hybrid Spatial Awareness (Pre-computed summaries + MCP spatial query tools)
---
## Stage 6: Publisher Workflow
**Demo:** "A plugin author submits their plugin. After review, it appears in the catalog."
- [ ] Marketplace user accounts (Supabase Auth — email/password + GitHub OAuth)
@@ -66,7 +78,7 @@ Each stage is **self-contained and demo-able**. Any stage can be shipped indepen
---
## Stage 6: Cloud Platform & Accounts
## Stage 7: Cloud Platform & Accounts
**Demo:** "User registers, gets [user].app.worldwideview.dev, installs plugins from marketplace."
- [ ] `app.worldwideview.dev` — auth/register/dashboard
@@ -81,7 +93,7 @@ Each stage is **self-contained and demo-able**. Any stage can be shipped indepen
---
## Stage 7: Built-In Data Services
## Stage 8: Built-In Data Services
**Demo:** "Aviation and maritime data with full history, served from api.worldwideview.dev."
- [ ] `api.worldwideview.dev` — aviation/maritime polling + persistence
@@ -93,7 +105,7 @@ Each stage is **self-contained and demo-able**. Any stage can be shipped indepen
---
## Stage 8: Trust Tiers, Extensions & Polish
## Stage 9: Trust Tiers, Extensions & Polish
**Demo:** "Install a verified extension plugin that adds cockpit view to aviation."
- [x] Ed25519-signed plugin registry (`GET /api/registry` on marketplace)
@@ -111,7 +123,7 @@ Each stage is **self-contained and demo-able**. Any stage can be shipped indepen
---
## Stage 9: Infrastructure & Monetization
## Stage 10: Infrastructure & Monetization
**Demo:** "Buy Pro, paste license key, unlock snapshot history and higher rate limits."
- [ ] Coolify on ThinkPad T480s — deploy all services
@@ -0,0 +1,145 @@
# Expand OSM Chips Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Expand the available OSM search chips to include a curated list of ~30 pre-loaded OSINT-relevant tags, and add a live Taginfo API autocomplete search to dynamically find and select any of the millions of other OSM tags.
**Architecture:** We will replace the current small `COMMON_TAGS` array with a richer, categorized list inside the `OSMSidebar` file. To allow access to "all" tags without crashing the UI, we will add a debounced fetch hook that hits `https://taginfo.openstreetmap.org/api/4/tags/popular` (or the equivalent search endpoint) when the user types in the filter box. These dynamically fetched tags will temporarily populate the chip list.
**Tech Stack:** React, TypeScript, Taginfo API
---
### Task 1: Update Pre-Loaded COMMON_TAGS
**Files:**
- Modify: `c:\dev\worldwideview\packages\wwv-plugin-osm-search\src\components\OSMSidebar.tsx:6-11`
- [ ] **Step 1: Replace existing COMMON_TAGS array**
```tsx
const COMMON_TAGS = [
// Military & Security
"military=base", "military=bunker", "amenity=police", "amenity=prison",
// Aviation & Maritime
"aeroway=aerodrome", "aeroway=helipad", "aeroway=hangar", "man_made=pier", "harbour=yes",
// Infrastructure & Utilities
"power=plant", "power=substation", "telecom=antenna", "man_made=communications_tower", "man_made=water_tower",
// Transport
"highway=bus_stop", "railway=station", "amenity=fuel", "amenity=parking",
// Medical & Emergency
"amenity=hospital", "amenity=fire_station", "amenity=clinic",
// General Commercial & Industrial
"shop=supermarket", "tourism=hotel", "industrial=factory", "landuse=industrial",
// Education & Amenities
"amenity=school", "amenity=university", "amenity=cafe", "building=house"
];
```
- [ ] **Step 2: Commit**
```bash
git add packages/wwv-plugin-osm-search/src/components/OSMSidebar.tsx
git commit -m "feat(osm-search): expand quick preset tags with OSINT categories"
```
### Task 2: Implement Taginfo Dynamic Autocomplete
**Files:**
- Modify: `c:\dev\worldwideview\packages\wwv-plugin-osm-search\src\components\OSMSidebar.tsx`
- [ ] **Step 1: Add state and debounced fetch logic inside OSMSidebar component**
```tsx
const [searchText, setSearchText] = useState("");
const [activeTags, setActiveTags] = useState<string[]>([]);
const [dynamicTags, setDynamicTags] = useState<string[]>([]);
const [isSearchingApi, setIsSearchingApi] = useState(false);
// Add this useEffect below the useState hooks
React.useEffect(() => {
if (searchText.length < 3) {
setDynamicTags([]);
return;
}
const timer = setTimeout(async () => {
setIsSearchingApi(true);
try {
// Fetch tags matching the search term from OSM Taginfo
const res = await fetch(`https://taginfo.openstreetmap.org/api/4/search/by_keyword?query=${encodeURIComponent(searchText)}`);
const data = await res.json();
if (data && data.data) {
// Extract exact key=value pairs or just keys, format as "key=value"
const tags = data.data
.filter((item: any) => item.key && item.value)
.map((item: any) => `${item.key}=${item.value}`)
.slice(0, 15); // Limit to top 15 results
setDynamicTags(tags);
}
} catch (err) {
console.error("Taginfo fetch failed", err);
} finally {
setIsSearchingApi(false);
}
}, 500); // 500ms debounce
return () => clearTimeout(timer);
}, [searchText]);
```
- [ ] **Step 2: Update rendering logic to merge static and dynamic tags**
Look for the `renderedTags` definition and replace it:
```tsx
// Combine filtered common tags with newly fetched dynamic tags, removing duplicates
const filteredCommon = searchText
? COMMON_TAGS.filter(t => t.toLowerCase().includes(searchText.toLowerCase()))
: COMMON_TAGS;
const renderedTags = Array.from(new Set([...filteredCommon, ...dynamicTags]));
```
- [ ] **Step 3: Add loading indicator to the search input area**
Look for the `<input>` element for `searchText` and wrap it/add a loading indicator:
```tsx
<div style={{ position: "relative" }}>
<input
style={{
width: "100%",
padding: "8px",
paddingRight: "24px",
backgroundColor: "rgba(0,0,0,0.3)",
color: "#fff",
border: "1px solid var(--border-subtle)",
borderRadius: "4px",
fontSize: "13px"
}}
placeholder="Filter or search OSM for tags..."
value={searchText}
onChange={e => setSearchText(e.target.value)}
/>
{isSearchingApi && (
<span style={{
position: "absolute",
right: "8px",
top: "50%",
transform: "translateY(-50%)",
fontSize: "10px",
color: "var(--text-muted)"
}}>
⏳
</span>
)}
</div>
```
- [ ] **Step 4: Commit**
```bash
git add packages/wwv-plugin-osm-search/src/components/OSMSidebar.tsx
git commit -m "feat(osm-search): add live Taginfo autocomplete for unlisted tags"
```
@@ -0,0 +1,139 @@
# Plugin Versioning Streamlining Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Refactor all WorldWideView plugin classes to derive their `version` property dynamically from their local `package.json` file rather than hardcoding string literals.
**Architecture:** We will replace the hardcoded `version = "x.y.z"` strings in the core `WorldPlugin` interface implementations across all monorepo packages. We will utilize TypeScript's JSON module resolution feature to `import pkg from "../package.json"` and map `version = pkg.version`. This ensures that `pnpm version patch` is the single source of truth and eliminates the double-bookkeeping that previously made CI fixes tedious.
**Tech Stack:** TypeScript, Next.js / bundler (JSON module resolution), pnpm workspaces.
---
## Task 1: Verify TypeScript Configuration
**Files:**
- Modify: N/A (Verification step)
- [ ] **Step 1: Check `tsconfig.json` for JSON resolution**
Run: `cat tsconfig.json | grep resolveJsonModule`
Expected: `"resolveJsonModule": true`
- [ ] **Step 2: Check compiler compatibility**
Run: `pnpm exec tsc --noEmit`
Expected: PASS (exit code 0)
## Task 2: Refactor Group A Plugins (Core Infrastructure)
**Files:**
- Modify: `packages/wwv-plugin-aviation/src/index.ts`
- Modify: `packages/wwv-plugin-maritime/src/index.ts`
- Modify: `packages/wwv-plugin-military-aviation/src/index.ts`
- [ ] **Step 1: Update plugin classes**
For each file above, modify the imports and the class body:
```typescript
import pkg from "../package.json";
// ...
export class AviationPlugin implements WorldPlugin { // (or extends BasePlugin)
// ...
version = pkg.version;
```
- [ ] **Step 2: Verify compilation**
Run: `pnpm exec tsc --noEmit`
Expected: PASS
- [ ] **Step 3: Commit**
```bash
git commit -am "refactor(plugins): derive version dynamically for core infrastructure plugins [Patch]"
```
## Task 3: Refactor Group B Plugins (Facilities & Infrastructure)
**Files:**
- Modify: `packages/wwv-plugin-airports/src/index.ts`
- Modify: `packages/wwv-plugin-seaports/src/index.ts`
- Modify: `packages/wwv-plugin-spaceports/src/index.ts`
- Modify: `packages/wwv-plugin-embassies/src/index.ts`
- Modify: `packages/wwv-plugin-lighthouses/src/index.ts`
- Modify: `packages/wwv-plugin-nuclear/src/index.ts`
- Modify: `packages/wwv-plugin-undersea-cables/src/index.ts`
- Modify: `packages/wwv-plugin-mineral-mines/src/index.ts`
- [ ] **Step 1: Update plugin classes**
For each file above, replace `version = "..."` with `version = pkg.version` and add `import pkg from "../package.json";`.
- [ ] **Step 2: Verify compilation**
Run: `pnpm exec tsc --noEmit`
Expected: PASS
- [ ] **Step 3: Commit**
```bash
git commit -am "refactor(plugins): derive version dynamically for facility plugins [Patch]"
```
## Task 4: Refactor Group C Plugins (Hazards & Events)
**Files:**
- Modify: `packages/wwv-plugin-earthquakes/src/index.ts`
- Modify: `packages/wwv-plugin-volcanoes/src/index.ts`
- Modify: `packages/wwv-plugin-wildfire/src/index.ts`
- Modify: `packages/wwv-plugin-conflict-events/src/index.tsx`
- Modify: `packages/wwv-plugin-conflict-zones/src/index.tsx`
- Modify: `packages/wwv-plugin-civil-unrest/src/index.tsx`
- Modify: `packages/wwv-plugin-cyber-attacks/src/index.tsx`
- Modify: `packages/wwv-plugin-international-sanctions/src/index.tsx`
- [ ] **Step 1: Update plugin classes**
For each file above, replace `version = "..."` with `version = pkg.version` and add `import pkg from "../package.json";`. Note that some files are `.tsx`.
- [ ] **Step 2: Verify compilation**
Run: `pnpm exec tsc --noEmit`
Expected: PASS
- [ ] **Step 3: Commit**
```bash
git commit -am "refactor(plugins): derive version dynamically for event and hazard plugins [Patch]"
```
## Task 5: Refactor Group D Plugins (Misc & Utilities)
**Files:**
- Modify: `packages/wwv-plugin-satellite/src/index.ts`
- Modify: `packages/wwv-plugin-surveillance-satellites/src/index.tsx`
- Modify: `packages/wwv-plugin-osm-search/src/index.ts`
- Modify: `packages/wwv-plugin-iranwarlive/src/index.ts`
- Modify: `packages/wwv-plugin-daynight/src/index.ts`
- Modify: `packages/wwv-plugin-camera/src/index.ts`
- Modify: `packages/wwv-plugin-borders/src/index.ts`
- Modify: `packages/wwv-plugin-gps-jamming/src/index.tsx`
- Modify: `packages/wwv-plugin-air-defense/src/index.tsx`
- [ ] **Step 1: Update plugin classes**
For each file above, replace `version = "..."` with `version = pkg.version` and add `import pkg from "../package.json";`.
- [ ] **Step 2: Verify compilation and tests**
Run: `pnpm exec tsc --noEmit`
Run: `pnpm test`
Expected: PASS
- [ ] **Step 3: Commit**
```bash
git commit -am "refactor(plugins): derive version dynamically for utility plugins [Patch]"
```
@@ -0,0 +1,124 @@
# Demo Default Plugins Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Enable specific plugins by default on the demo edition via environment variables so the user is immediately impressed.
**Architecture:** Update `layersSlice.ts` to accept an optional `defaultEnabled` parameter in `initLayer`. In `AppShell.tsx`, look up `NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS` when the edition is `demo`, and pass the flag true to `initLayer` for matching plugins during registration. Document the variable in `.env.example`.
**Tech Stack:** Next.js, Zustand, TypeScript.
---
### Task 1: Update layer slice definition
**Files:**
- Modify: `src/core/state/layersSlice.ts`
- [ ] **Step 1: Write the implementation**
Update `initLayer` in `src/core/state/layersSlice.ts` to accept a second parameter:
```typescript
// Add defaultEnabled parameter to the interface
export interface LayersSlice {
// ...
initLayer: (pluginId: string, defaultEnabled?: boolean) => void;
}
// ...
// Use the parameter in the state updater
initLayer: (pluginId, defaultEnabled = false) =>
set((state) => ({
layers: {
...state.layers,
[pluginId]: state.layers[pluginId] || { enabled: defaultEnabled, entityCount: 0, loading: false },
},
})),
```
- [ ] **Step 2: Commit**
```bash
git add src/core/state/layersSlice.ts
npm run commit -- "feat: add defaultEnabled param to initLayer in layers slice"
```
### Task 2: Apply default configuration in AppShell
**Files:**
- Modify: `src/components/layout/AppShell.tsx`
- [ ] **Step 1: Write the implementation**
Add `isDemo` import at the top of `src/components/layout/AppShell.tsx`:
```typescript
import { isDemo } from "@/core/edition";
```
In `AppShell.tsx`, around line 71, inside `startPlatform()`, fetch the value from the environment if the instance is demo:
```typescript
// Fetch disabled built-in plugins before registration
let disabledIds = new Set<string>();
// ... (keep existing try/catch block)
// Setup demo defaults
const demoDefaultPlugins = new Set<string>();
if (isDemo) {
const envVar = process.env.NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS || "";
envVar.split(",").forEach(s => {
const clean = s.trim();
if (clean) demoDefaultPlugins.add(clean);
});
}
```
Then update the `pluginManager` registration loop to inject the boolean for `initLayer`:
```typescript
for (const plugin of pluginRegistry.getAll()) {
await pluginManager.registerPlugin(plugin);
initLayer(plugin.id, demoDefaultPlugins.has(plugin.id));
}
```
- [ ] **Step 2: Run test to verify it passes**
Run type checks to verify no compilation issues:
`npx tsc --noEmit`
- [ ] **Step 3: Commit**
```bash
git add src/components/layout/AppShell.tsx
npm run commit -- "feat: parse and apply default demo plugins via NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS"
```
### Task 3: Document environment definitions
**Files:**
- Modify: `.env.example`
- Modify: `.env`
- [ ] **Step 1: Write the implementation**
Update `.env.example` and `.env` around the `NEXT_PUBLIC_WWV_EDITION=local` definition:
```dotenv
# Default plugins enabled on boot for demo edition
# Comma-separated list of plugin IDs (e.g. aviation,maritime,iranwarlive)
NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS=
# Edition: "local" | "cloud" | "demo"
NEXT_PUBLIC_WWV_EDITION=local
```
- [ ] **Step 2: Commit**
```bash
git add .env.example .env
npm run commit -- "docs: add NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS to env templates"
```
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "worldwideview",
"version": "1.8.2",
"version": "1.10.0",
"private": true,
"scripts": {
"setup": "node scripts/setup.mjs",
@@ -1,6 +1,6 @@
{
"name": "@worldwideview/wwv-plugin-conflict-zones",
"version": "1.0.0",
"version": "1.1.0",
"description": "WorldWideView plugin — Active conflict zones and geopolitical hotspots worldwide.",
"main": "src/index.tsx",
"types": "src/index.tsx",
@@ -17,6 +17,36 @@ function severityToColor(score: number): string {
return "#fbbf24"; // Monitoring — yellow
}
/** Attach _wwvEntity to a Resium Entity ref so InteractionHandler can pick it. */
function bindWwvEntity(ref: any, geoEntity: GeoEntity): void {
const cesiumEntity = ref?.cesiumElement;
if (cesiumEntity && !cesiumEntity._wwvEntity) {
cesiumEntity._wwvEntity = geoEntity;
}
}
/** Build a synthetic GeoEntity from a static ConflictZone definition. */
function zoneToGeoEntity(zone: typeof CONFLICT_ZONES[number]): GeoEntity {
return {
id: zone.id,
pluginId: "conflict-zones",
latitude: zone.lat,
longitude: zone.lon,
altitude: 0,
timestamp: new Date(),
properties: {
name: zone.name,
description: zone.description,
type: zone.subtext || "N/A",
status: zone.status,
escalationScore: zone.escalationScore,
escalationTrend: zone.escalationTrend,
whyItMatters: zone.whyItMatters,
radiusKm: zone.radiusKm,
},
};
}
const ConflictZonesRenderer: React.FC<{ viewer: Cesium.Viewer | null; enabled: boolean }> = ({ enabled }) => {
if (!enabled) return null;
@@ -28,24 +58,14 @@ const ConflictZonesRenderer: React.FC<{ viewer: Cesium.Viewer | null; enabled: b
const fillColor = Cesium.Color.fromCssColorString(colorHex).withAlpha(0.25);
const outlineColor = Cesium.Color.fromCssColorString(colorHex).withAlpha(0.8);
const radiusMeters = zone.radiusKm * 1000;
const geoEntity = zoneToGeoEntity(zone);
return (
<Entity
key={zone.id}
position={position}
name={zone.name}
description={`
<table class="cesium-infoBox-defaultTable">
<tbody>
<tr><th>Overview</th><td>${zone.description}</td></tr>
<tr><th>Type</th><td>${zone.subtext || "N/A"}</td></tr>
<tr><th>Status</th><td>${zone.status}</td></tr>
<tr><th>Escalation Score</th><td>${zone.escalationScore} / 5</td></tr>
<tr><th>Trend</th><td>${zone.escalationTrend}</td></tr>
<tr><th>Why It Matters</th><td>${zone.whyItMatters}</td></tr>
</tbody>
</table>
`}
ref={(ref: any) => bindWwvEntity(ref, geoEntity)}
>
<EllipseGraphics
semiMajorAxis={radiusMeters}
@@ -118,3 +138,4 @@ export class ConflictZonesPlugin implements WorldPlugin {
return ConflictZonesRenderer;
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@worldwideview/wwv-plugin-embassies",
"version": "1.0.2",
"version": "1.0.3",
"description": "WorldWideView plugin — Global embassies, consulates, and diplomatic missions from OpenStreetMap",
"main": "src/index.ts",
"types": "src/index.ts",
+2 -2
View File
@@ -6,8 +6,8 @@ export class EmbassiesConsulatesPlugin extends BaseFacilityPlugin {
name = "Embassies & Consulates";
description = "Global embassies, consulates, and diplomatic missions from OpenStreetMap";
icon = Landmark;
category = "government" as const;
version = "1.0.2";
category = "infrastructure" as const;
version = "1.0.3";
protected defaultLayerColor = "#a855f7";
protected maxEntities = 1000;
@@ -1,6 +1,6 @@
{
"name": "@worldwideview/wwv-plugin-international-sanctions",
"version": "1.0.0",
"version": "1.1.0",
"main": "src/index.tsx",
"dependencies": {
"lucide-react": "^0.364.0"
@@ -1,4 +1,4 @@
import React, { useEffect, useState, useMemo } from "react";
import React, { useEffect, useState, useMemo, useCallback } from "react";
import { Scale } from "lucide-react";
import { Color, PolygonHierarchy, GeoJsonDataSource, JulianDate } from "cesium";
import { Entity, PolygonGraphics } from "resium";
@@ -20,6 +20,14 @@ const LEVEL_COLORS: Record<string, string> = {
"high": "#ef4444", // Red
};
/** Attach _wwvEntity to a Resium Entity ref so InteractionHandler can pick it. */
function bindWwvEntity(ref: any, geoEntity: GeoEntity): void {
const cesiumEntity = ref?.cesiumElement;
if (cesiumEntity && !cesiumEntity._wwvEntity) {
cesiumEntity._wwvEntity = geoEntity;
}
}
export class InternationalSanctionsPlugin implements WorldPlugin {
id = "international-sanctions";
name = "International Sanctions";
@@ -164,10 +172,13 @@ export class InternationalSanctionsPlugin implements WorldPlugin {
const elements = useMemo(() => {
if (!enabled || Object.keys(countryPolygons).length === 0 || this.data.length === 0) return [];
const results = [];
const results: Array<{
id: string; name: string; geoEntity: GeoEntity;
color: Color; outlineColor: Color; height: number;
hierarchies: PolygonHierarchy[];
}> = [];
for (const entity of this.data) {
const code = entity.properties.countryCode as string;
const count = entity.properties.count as number;
const level = (entity.properties.level as string) || "low";
const hexStr = LEVEL_COLORS[level] || LEVEL_COLORS["low"];
const color = Color.fromCssColorString(hexStr).withAlpha(0.65);
@@ -180,13 +191,7 @@ export class InternationalSanctionsPlugin implements WorldPlugin {
results.push({
id: entity.id,
name: `Sanctioned Country: ${code}`,
description: `
<div class="p-3">
<div class="mb-2"><span class="font-semibold text-gray-300">Target Area:</span> ${code}</div>
<div class="mb-2"><span class="font-semibold text-gray-300">Level:</span> <span style="color: ${hexStr}">${level.toUpperCase()}</span></div>
<div class="mb-2"><span class="font-semibold text-gray-300">Active OFAC Sanctions:</span> ${count}</div>
</div>
`,
geoEntity: entity,
color,
outlineColor,
height,
@@ -205,7 +210,7 @@ export class InternationalSanctionsPlugin implements WorldPlugin {
<Entity
key={`${rc.id}-${idx}`}
name={rc.name}
description={rc.description}
ref={(ref: any) => bindWwvEntity(ref, rc.geoEntity)}
>
<PolygonGraphics
hierarchy={hier}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@worldwideview/wwv-plugin-osm-search",
"version": "1.2.0",
"version": "1.2.2",
"description": "OSM Search Plugin for WorldWideView",
"main": "src/index.ts",
"type": "module",
+1 -1
View File
@@ -43,7 +43,7 @@ export class OSMSearchPlugin implements WorldPlugin {
return {
// Default "go-to" distance in meters.
// 500m provides a good "street-level" view for OSM features.
preferredZoomDistance: 500,
flyToBaseDistance: 500,
showTrail: false
};
}
+2 -1
View File
@@ -1,7 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"noEmit": true
"noEmit": true,
"rootDir": "../.."
},
"include": [
"src"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@worldwideview/wwv-plugin-sdk",
"version": "1.2.0",
"version": "1.2.1",
"description": "Plugin SDK — types, interfaces, and utilities for building WorldWideView globe plugins",
"main": "dist/index.js",
"types": "dist/index.d.ts",
+1 -1
View File
@@ -231,7 +231,7 @@ export interface WorldPlugin {
getServerConfig?(): ServerPluginConfig;
getFilterDefinitions?(): FilterDefinition[];
getLegend?(): { label: string; color: string; filterId?: string; filterValue?: string }[];
getSidebarComponent?(): ComponentType;
getSidebarComponent?(): ComponentType<{ plugin?: any } | any>;
getDetailComponent?(): ComponentType<{ entity: GeoEntity }>;
getSettingsComponent?(): ComponentType<{ pluginId: string }>;
/** Custom React component injected into the Globe view for rendering primitives/data sources (e.g. GeoJSON). */
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@worldwideview/wwv-plugin-spaceports",
"version": "1.0.1",
"version": "1.0.2",
"description": "WorldWideView plugin — Space launch sites worldwide from OSM",
"main": "src/index.ts",
"types": "src/index.ts",
+2 -2
View File
@@ -6,8 +6,8 @@ export class SpaceportsPlugin extends BaseFacilityPlugin {
name = "Spaceports";
description = "Space launch sites worldwide from OSM";
icon = Rocket;
category = "science" as const;
version = "1.0.1";
category = "space" as const;
version = "1.0.2";
protected defaultLayerColor = "#7c3aed";
protected maxEntities = 1000;
+3 -3
View File
@@ -35,7 +35,7 @@ export async function GET(request: Request) {
]);
const manifests = records
.map((r): PluginManifest | null => {
.map((r: any): PluginManifest | null => {
try {
const manifest = JSON.parse(r.config);
if (!manifest.id) manifest.id = r.pluginId;
@@ -44,7 +44,7 @@ export async function GET(request: Request) {
return null;
}
})
.filter((m): m is PluginManifest => {
.filter((m: any): m is PluginManifest => {
if (!m) return false;
// Skip built-in plugins — already registered by AppShell
if (m.trust === "built-in") return false;
@@ -62,7 +62,7 @@ export async function GET(request: Request) {
const { valid } = validateManifest(m);
return valid;
})
.map((m) => {
.map((m: any) => {
// Re-stamp trust against the live registry so revoked plugins
// are correctly gated by the unverified dialog on the client.
if (m.trust !== "built-in") {
+2 -2
View File
@@ -26,10 +26,10 @@ export async function GET(request: Request) {
try {
const dbPlugins = await getInstalledPlugins();
const dbMap = new Map(dbPlugins.map((p) => [p.pluginId, p]));
const dbMap = new Map(dbPlugins.map((p: any) => [p.pluginId, p]));
// Collect active DB plugins (exclude disabled ones)
const activeDbPlugins = dbPlugins.filter((p) => p.enabled !== false);
const activeDbPlugins = dbPlugins.filter((p: any) => p.enabled !== false);
// Add built-in plugins that aren't in the DB at all (default = installed)
const builtInRecords = BUILT_IN_PLUGIN_IDS
+16 -1
View File
@@ -45,6 +45,7 @@ import ReloadToast from "@/components/ui/ReloadToast";
import ErrorToast from "@/components/ui/ErrorToast";
import UnverifiedPluginBatchDialog from "@/components/marketplace/UnverifiedPluginBatchDialog";
import { FeedbackDialog } from "@/components/common/FeedbackDialog";
import { isDemo } from "@/core/edition";
import { injectHostGlobals } from "@/core/plugins/hostGlobals";
import { initLogCatcher } from "@/lib/logCatcher";
@@ -80,6 +81,16 @@ export function AppShell() {
// Non-critical — load all built-ins if endpoint fails
}
// Setup demo defaults
const demoDefaultPlugins = new Set<string>();
if (isDemo) {
const envVar = process.env.NEXT_PUBLIC_DEMO_DEFAULT_PLUGINS || "";
envVar.split(",").forEach(s => {
const clean = s.trim();
if (clean) demoDefaultPlugins.add(clean);
});
}
const builtIns = [
new AviationPlugin(),
new MaritimePlugin(),
@@ -113,7 +124,11 @@ export function AppShell() {
for (const plugin of pluginRegistry.getAll()) {
await pluginManager.registerPlugin(plugin);
initLayer(plugin.id);
const shouldEnable = demoDefaultPlugins.has(plugin.id);
initLayer(plugin.id, shouldEnable);
if (shouldEnable) {
await pluginManager.enablePlugin(plugin.id);
}
}
console.log("[AppShell] Platform Ready. Waiting for globe tiles...");
@@ -377,7 +377,7 @@ export function IntelTab() {
lat: selectedEntity.latitude,
lon: selectedEntity.longitude,
alt: selectedEntity.altitude || 0,
distance: behavior?.preferredZoomDistance
distance: behavior?.flyToBaseDistance
});
}}
>
+65
View File
@@ -11,6 +11,14 @@ const OFFSET_X = 16;
const OFFSET_Y = 16;
const EDGE_PADDING = 12;
const LEVEL_COLORS: Record<string, string> = {
low: "#facc15", medium: "#f97316", high: "#ef4444",
};
const SEVERITY_LABELS: Record<number, string> = {
5: "Critical", 4: "High", 3: "Elevated", 2: "Watchlist",
};
export function EntityInfoCard() {
const hoveredEntity = useStore((s) => s.hoveredEntity);
const screenPos = useStore((s) => s.hoveredScreenPosition);
@@ -67,6 +75,18 @@ export function EntityInfoCard() {
const casualtiesDisplay =
hoveredEntity.properties?.casualties !== undefined ? String(hoveredEntity.properties.casualties) : null;
// Sanctions-specific fields
const sanctionLevel = hoveredEntity.properties?.level as string | undefined;
const sanctionCount = hoveredEntity.properties?.count as number | undefined;
const countryCode = hoveredEntity.properties?.countryCode as string | undefined;
const isSanctions = hoveredEntity.pluginId === "international-sanctions";
// Conflict zone-specific fields
const escalationScore = hoveredEntity.properties?.escalationScore as number | undefined;
const zoneStatus = hoveredEntity.properties?.status as string | undefined;
const escalationTrend = hoveredEntity.properties?.escalationTrend as string | undefined;
const isConflictZone = hoveredEntity.pluginId === "conflict-zones";
return (
<div
className="entity-info-card"
@@ -149,6 +169,50 @@ export function EntityInfoCard() {
</span>
</div>
)}
{/* Sanctions-specific hover intel */}
{isSanctions && countryCode && (
<div className="entity-info-card__prop">
<span className="entity-info-card__prop-key">Country</span>
<span className="entity-info-card__prop-value">{countryCode}</span>
</div>
)}
{isSanctions && sanctionLevel && (
<div className="entity-info-card__prop">
<span className="entity-info-card__prop-key">Severity</span>
<span className="entity-info-card__prop-value" style={{ color: LEVEL_COLORS[sanctionLevel] || "inherit" }}>
{sanctionLevel.toUpperCase()}
</span>
</div>
)}
{isSanctions && sanctionCount !== undefined && (
<div className="entity-info-card__prop">
<span className="entity-info-card__prop-key">OFAC Sanctions</span>
<span className="entity-info-card__prop-value">{sanctionCount}</span>
</div>
)}
{/* Conflict zone-specific hover intel */}
{isConflictZone && escalationScore !== undefined && (
<div className="entity-info-card__prop">
<span className="entity-info-card__prop-key">Escalation</span>
<span className="entity-info-card__prop-value" style={{ color: escalationScore >= 5 ? "#991b1b" : escalationScore >= 4 ? "#ef4444" : escalationScore >= 3 ? "#f97316" : "#fbbf24" }}>
{SEVERITY_LABELS[escalationScore] || escalationScore} / 5
</span>
</div>
)}
{isConflictZone && zoneStatus && (
<div className="entity-info-card__prop">
<span className="entity-info-card__prop-key">Status</span>
<span className="entity-info-card__prop-value">{zoneStatus}</span>
</div>
)}
{isConflictZone && escalationTrend && (
<div className="entity-info-card__prop">
<span className="entity-info-card__prop-key">Trend</span>
<span className="entity-info-card__prop-value">{escalationTrend}</span>
</div>
)}
</div>
{/* Footer hint */}
@@ -156,3 +220,4 @@ export function EntityInfoCard() {
</div>
);
}
+7 -3
View File
@@ -1,5 +1,5 @@
import { expect, test, describe } from "vitest";
import { readFileSync, globSync } from "fs";
import * as fs from "fs";
import { join } from "path";
describe("Monorepo Workspace Integrity", () => {
@@ -8,15 +8,19 @@ describe("Monorepo Workspace Integrity", () => {
// __dirname is dist/core/__tests__ when transpiled or src/core/__tests__ when running tsx/vitest natively
const rootDir = process.cwd(); // vitest runs from workspace root
const packageDirs = fs.readdirSync(join(rootDir, "packages"), { withFileTypes: true })
.filter(d => d.isDirectory())
.map(d => `packages/${d.name}/package.json`)
.filter(p => fs.existsSync(join(rootDir, p)));
const packageJsonFiles = [
"package.json",
...globSync("packages/**/package.json", { cwd: rootDir, ignore: ["**/node_modules/**"] })
...packageDirs
];
let failedFiles: string[] = [];
for (const file of packageJsonFiles) {
const content = readFileSync(join(rootDir, file), "utf-8");
const content = fs.readFileSync(join(rootDir, file), "utf-8");
const pkg = JSON.parse(content);
const deps = { ...pkg.dependencies, ...pkg.devDependencies, ...pkg.peerDependencies };
+1 -1
View File
@@ -89,7 +89,7 @@ export default function GlobeView() {
// Apply color overrides
let options = originalOptions;
if (colorOverrides && colorOverrides[originalOptions.color]) {
if (originalOptions.color && colorOverrides && colorOverrides[originalOptions.color]) {
options = { ...originalOptions, color: colorOverrides[originalOptions.color] };
} else if (customLayerColor) {
options = { ...originalOptions, color: customLayerColor };
+3 -3
View File
@@ -14,7 +14,7 @@ export interface LayersSlice {
setLayerEnabled: (pluginId: string, enabled: boolean) => void;
setEntityCount: (pluginId: string, count: number) => void;
setLayerLoading: (pluginId: string, loading: boolean) => void;
initLayer: (pluginId: string) => void;
initLayer: (pluginId: string, defaultEnabled?: boolean) => void;
}
export const createLayersSlice: StateCreator<AppStore, [], [], LayersSlice> = (set) => ({
@@ -50,11 +50,11 @@ export const createLayersSlice: StateCreator<AppStore, [], [], LayersSlice> = (s
[pluginId]: { ...state.layers[pluginId], loading },
},
})),
initLayer: (pluginId) =>
initLayer: (pluginId, defaultEnabled = false) =>
set((state) => ({
layers: {
...state.layers,
[pluginId]: state.layers[pluginId] || { enabled: false, entityCount: 0, loading: false },
[pluginId]: state.layers[pluginId] || { enabled: defaultEnabled, entityCount: 0, loading: false },
},
})),
});
+1 -1
View File
@@ -55,5 +55,5 @@ export async function getDisabledPluginIds(): Promise<Set<string>> {
where: { enabled: false },
select: { pluginId: true },
});
return new Set(records.map((r) => r.pluginId));
return new Set(records.map((r: any) => r.pluginId));
}
+3 -1
View File
@@ -82,6 +82,8 @@
"node_modules",
"scripts",
"packages/wwv-data-engine",
"packages/*/backend"
"packages/*/backend",
"worldmonitor",
".worktrees"
]
}