Compare commits

...
Author SHA1 Message Date
Antigravity AI a1f6f88ebe fix(core): resolve generic TS errors and update type definitions across plugins [Patch]
- 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]
2026-04-16 00:56:08 +12:00
SilvertakanaandAntigravity AI 6be56b9966 feat: Expand OSM Search Plugin with curated chips and live Taginfo autocomplete (#23)
* feat(osm-search): expand quick preset tags with OSINT categories

* feat(osm-search): add live Taginfo autocomplete for unlisted tags

* chore: bump version to 1.2.0 for osm autocomplete feature

* fix(osm-search): align tsconfig to prevent TS6059 in CI

---------

Co-authored-by: Antigravity AI <[email protected]>
2026-04-16 00:23:44 +12:00
18 changed files with 111 additions and 44 deletions

No files matched your search

+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:
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "worldwideview",
"version": "1.8.2",
"version": "1.8.3",
"private": true,
"scripts": {
"setup": "node scripts/setup.mjs",
+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 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@worldwideview/wwv-plugin-osm-search",
"version": "1.1.0",
"version": "1.2.1",
"description": "OSM Search Plugin for WorldWideView",
"main": "src/index.ts",
"type": "module",
@@ -4,9 +4,20 @@ import { Eye, EyeOff } from "lucide-react";
import { useOsmStore } from "../store";
const COMMON_TAGS = [
"amenity=hospital", "amenity=school", "amenity=police", "amenity=fire_station",
"shop=supermarket", "highway=bus_stop", "building=house", "tourism=hotel",
"man_made=tower", "industrial=factory"
// 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"
];
interface OSMSidebarProps {
@@ -23,6 +34,39 @@ export function OSMSidebar({ plugin }: OSMSidebarProps) {
const [distance, setDistance] = useState(500);
const [isScanning, setIsScanning] = useState(false);
// Taginfo dynamic search states
const [dynamicTags, setDynamicTags] = useState<string[]>([]);
const [isSearchingApi, setIsSearchingApi] = useState(false);
// Fetch dynamic tags when search text changes
React.useEffect(() => {
if (searchText.length < 3) {
setDynamicTags([]);
return;
}
const timer = setTimeout(async () => {
setIsSearchingApi(true);
try {
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) {
const tags = data.data
.filter((item: any) => item.key && item.value)
.map((item: any) => `${item.key}=${item.value}`)
.slice(0, 15);
setDynamicTags(tags);
}
} catch (err) {
console.error("Taginfo fetch failed", err);
} finally {
setIsSearchingApi(false);
}
}, 500);
return () => clearTimeout(timer);
}, [searchText]);
const toggleLock = () => {
if (!bboxLocked) {
setLockedBbox(currentBbox);
@@ -106,9 +150,12 @@ out center;`;
}
};
const renderedTags = searchText
// 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]));
return (
<div style={{ display: "flex", flexDirection: "column", gap: "10px" }}>
@@ -200,20 +247,35 @@ out center;`;
/>
</div>
)}
<input
style={{
width: "100%",
padding: "8px",
backgroundColor: "rgba(0,0,0,0.3)",
color: "#fff",
border: "1px solid var(--border-subtle)",
borderRadius: "4px",
fontSize: "13px"
}}
placeholder="Filter tags (e.g. amenity=...)"
value={searchText}
onChange={e => setSearchText(e.target.value)}
/>
<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>
<div style={{ display: "flex", flexWrap: "wrap", gap: "6px", maxHeight: "150px", overflowY: "auto", padding: "4px" }}>
{renderedTags.map(tag => {
const isActive = activeTags.includes(tag);
+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
};
}
+4 -4
View File
@@ -1,9 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist/",
"rootDir": "src/",
"jsx": "react-jsx"
"noEmit": true
},
"include": ["src/**/*"]
"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
@@ -377,7 +377,7 @@ export function IntelTab() {
lat: selectedEntity.latitude,
lon: selectedEntity.longitude,
alt: selectedEntity.altitude || 0,
distance: behavior?.preferredZoomDistance
distance: behavior?.flyToBaseDistance
});
}}
>
+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 };
+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));
}