Compare commits

..
Author SHA1 Message Date
Silvertakana b0ce089f12 Merge branch 'main' into feat/plugin-management-ux 2026-05-30 01:26:15 +12:00
SilvertakanaandClaude 28d284046f chore: run playwright and docker CI conditionally on app code changes (#212)
Switch playwright.yml and docker-publish.yml from broad paths-ignore to
positive paths filters so the expensive 3-browser E2E matrix and Docker
multi-stage build only trigger when application code actually changes.
ci.yml gains additional paths-ignore entries for .agents/**, markdown
files, and issue templates so doc-only PRs skip the full test suite.

Skipped workflow runs are neutral passes on GitHub, so required status
checks are not affected.

https://claude.ai/code/session_01CvJ6u5bP3efXHWsGAMvgx7

Co-authored-by: Claude <[email protected]>
2026-05-30 01:25:45 +12:00
Silvertakana c08f25e0b8 feat(sdk,panel): add tagged property type helpers and Intel panel renderers (#213)
* feat(sdk,panel): add tagged property type helpers and Intel panel renderers

Adds four null-safe tag helpers to wwv-plugin-sdk (dtProp, urlProp,
imageProp, videoProp) that encode typed values as prefixed strings.
Adds DatetimePropertyRow (collapse/expand with UTC + relative time)
and VideoProperty (Watch link with PlayCircle icon). Updates
DynamicPropertiesRender to dispatch on all four prefixes before
existing heuristic checks. Bumps version 2.24.5 -> 2.25.0.

* docs: add property tag helper documentation to SDK and plugin guides
2026-05-30 01:25:03 +12:00
Antigravity AI c4f23f322b feat(plugins): plugin management UX overhaul
- feat: wrench icon on local plugin layers in Data Layers panel
- fix: plugin disable/enable lifecycle without page reload
- fix: localStorage-only disable persistence (wwv-disabled-plugins key)
- fix: hot-load plugin script on enable when disabled at startup
- fix: disable shows reload banner; enable clears it
- fix: enable no longer auto-turns layer on
- fix: PluginIcon fallback for renamed/unknown Lucide icon names
- fix: market-tracker icon LineChart -> ChartLine (Lucide rename)
- style: GeoJSON importer fully themed via CSS variables (no hardcoded cyan)
- style: Import GeoJSON button matches panel theme
- style: Browse Plugins text centered
2026-05-30 01:10:10 +12:00
Silvertakana 6f265e7267 docs(agent): make plugin-implementer use the CLI correctly (#211)
Phase 2 now gives two explicit, copy-paste invocations — polling (no
--seeder-tier) and websocket (with --seeder-tier) — instead of one combined
example that wrongly showed --seeder-tier for every plugin. Adds the
build-CLI-first step, the >= 1.3.1 requirement (the version that fixed the
polling+--yes guard), and a note that a non-zero CLI exit is a hard stop, not
a cue to scaffold by hand.

Phase 4 no longer tells the agent to create the seeder files from scratch:
the websocket scaffold already emits package.json + tsup.config.ts +
src/index.ts, so Phase 4 is reframed as implementing the generated stub. The
reference snippets are kept as the target shape to verify against.
2026-05-29 20:13:09 +12:00
Silvertakana e9a908840d fix(cli): polling plugins with --yes no longer require --seeder-tier (#210)
The --yes guard counted the conditionally-skipped seederTier prompt as a
missing required value, so `create <id> --architecture polling ... --yes`
failed even though seeders only apply to websocket plugins. The guard now
only requires seederTier when the resolved architecture is websocket.

This bug shipped in 1.3.0 and was missed in manual UAT (the polling case
was exercised interactively, not with --yes). The new test suite caught it.

Also in this change:
- Add packages/wwv-cli/test/create.test.mjs: 9 integration tests that spawn
  the built CLI into temp dirs and assert the scaffolded tree (polling vs
  websocket, community vs private seeder tier, billboard/model/point render,
  --core, kebab-id naming, icon mapping, and the --yes / invalid-flag /
  duplicate-dir failure guards). Uses Node's built-in test runner, no new deps.
- Add .github/workflows/cli.yml: path-scoped to packages/wwv-cli, runs
  build (tsc) + the integration tests. Fast versus the full app suite.
- Add paths-ignore for packages/wwv-cli to the heavy app workflows (ci,
  playwright, docker-publish, test-setup-scripts, test-local-dev push) so a
  CLI-only change runs just cli.yml instead of the whole suite.
- Bump CLI to 1.3.1 and add a test script.
2026-05-29 20:08:42 +12:00
Silvertakana a2917536e4 feat(cli): accept flags for non-interactive plugin scaffolding (#209)
The 'wwv create' command was fully interactive (prompts-only) and the
plugin-implementer agent's documented '--local' flag did not exist, so
agents fell back to slow manual scaffolding.

- Add a positional [pluginId] arg plus a flag for every prompt
  (--display-name, --description, --category, --architecture,
  --seeder-tier, --render-style) and a --yes guard that fails fast
  instead of hanging when a required value is missing. Any omitted
  flag still prompts, so interactive use is unchanged.
- Fix seeder output to the real community/private layout:
  local-seeders/<tier>/packages/<name>/{package.json,tsup.config.ts,
  src/index.ts}, exporting the canonical { name, cron, fn } shape with
  name === plugin id (kebab-case) per ADR-0002. Previously it wrote a
  bare seeder.mjs to the wrong path with an unusable context.emit stub.
- Update plugin-implementer.md: drop the bogus --local flag, document
  the flag-based invocation and the correct seeder location, and note
  the CLI build step for fresh worktrees.
- Bump CLI to 1.3.0 and fix the stale hardcoded --version string.
2026-05-29 19:29:30 +12:00
Silvertakana 41c42c0ca1 fix(worktree): make git-wt link-planning hook create real isolated .planning (#207)
The link_planning pre-start hook created a JUNCTION from each new worktree's
.planning to the shared root, which caused GSD phase bleed across simultaneous
worktree sessions. Rewrite it to create a REAL isolated .planning directory
(phases/debug/surveys + config.json + WORKSPACE/STATE/SHARED-DOCS manifests),
idempotently: preserve an existing real dir, only replace a leftover junction.

Update unlink-planning (pre-remove) to remove only a leftover junction and never
recurse into a real dir; phase history is archived by /branch-cleanup before removal.

Closes the gap flagged in WORKSPACE-OPTIMIZATION-BACKLOG.md. Verified with an
18-check harness (fresh create, idempotency, junction replacement, unlink behavior).
2026-05-29 17:09:15 +12:00
Silvertakana eb7dabfba3 feat(skill): add /plugin-new plugin pipeline conductor skill (#208)
Conductor skill that sequences a WorldWideView plugin from idea to npm-published and cleaned up, delegating to existing agents (worktree-manager, plugin-researcher, plugin-implementer, branch-finisher, branch-cleanup) and GSD (project-per-plugin in the worktree's isolated .planning).

8 stages: kickoff -> isolated worktree+scaffold -> GSD research/plan -> autonomous build+e2e -> UAT -> dual-repo PRs (independent versions) -> npm publish -> teardown. User gates only at the 4 irreversible boundaries: plan approval, UAT sign-off, npm publish, teardown. Docker resources labeled wwv-plugin=<name> at scaffold for exact teardown.

Design decisions: conductor-skill architecture (not a new orchestrator agent), project-per-plugin GSD scope, independent plugin/seeder versioning. Full design rationale in .planning/PLUGIN-PIPELINE-DESIGN.md.

Infra-only (no app code); no semver bump.
2026-05-29 17:07:12 +12:00
30 changed files with 2252 additions and 183 deletions

No files matched your search

+50 -7
View File
@@ -28,14 +28,55 @@ If any are missing, ask the user or tell them to run plugin-researcher first.
## Phase 2 — Scaffold
From the project root (`C:\dev\wwv\worldwideview`):
Always scaffold with the CLI, never by hand. From the project root (`C:\dev\wwv\worldwideview`).
**Step 1 — build the CLI if `dist/` is missing** (`dist` is gitignored, so fresh worktrees lack it):
```bash
node packages/wwv-cli/dist/index.js create <name> --local
pnpm --filter @worldwideview/wwv-cli build
```
**Step 2 — run `create` non-interactively.** The CLI accepts a flag for every prompt;
pass them all plus `--yes` so it never blocks on a prompt. Use the variant that matches
the architecture — `--seeder-tier` is **websocket-only** (passing it with `polling` does
nothing). Requires `@worldwideview/wwv-cli` **≥ 1.3.1** (earlier versions wrongly demanded
`--seeder-tier` for polling under `--yes`).
```bash
# Polling / static (frontend only — NO seeder, so NO --seeder-tier):
node packages/wwv-cli/dist/index.js create <name> \
--display-name "<Display Name>" \
--description "<short description>" \
--category <aviation|maritime|space|weather|custom> \
--architecture polling \
--render-style <billboard|model|point> \
--yes
# Real-time / WebSocket (also scaffolds a backend seeder — REQUIRES --seeder-tier):
node packages/wwv-cli/dist/index.js create <name> \
--display-name "<Display Name>" \
--description "<short description>" \
--category <aviation|maritime|space|weather|custom> \
--architecture websocket \
--seeder-tier <community|private> \
--render-style <billboard|model|point> \
--yes
pnpm install
```
This creates `local-plugins/wwv-plugin-<name>/`. Verify it exists before proceeding.
This creates `local-plugins/wwv-plugin-<name>/`. The `websocket` variant also creates the
seeder at `local-seeders/<tier>/packages/<name>/` in the correct community/private layout
(`package.json` + `tsup.config.ts` + `src/index.ts`, exporting `{ name, cron, fn }` with
`name` === the plugin id). Verify the expected directories exist before proceeding.
> No post-CLI move is required — the CLI already targets `local-seeders/<tier>/packages/<name>/`.
> (Pre-1.3.0 CLI dropped a bare `seeder.mjs` at `local-seeders/<tier>/<name>/`; if you ever see
> that shape, the CLI is stale — rebuild it with the Step 1 command.)
>
> The CLI exits non-zero with a clear message on a bad `--category`/`--architecture`/etc., a
> missing required value under `--yes`, or an existing target directory. Treat a non-zero exit
> as a hard stop — fix the inputs and re-run; do not fall back to manual scaffolding.
**NEVER:**
- Scaffold manually (always use the CLI)
@@ -116,13 +157,15 @@ export class MyPlugin implements WorldPlugin {
---
## Phase 4 — Implement the Seeder (skip for static plugins)
## Phase 4 — Implement the Seeder (skip for static / polling-only plugins)
Seeders live in `local-seeders/community/` — **this is an independent git repo** (`github.com/silvertakana/wwv-seeders`). Never commit seeder files to the worldwideview repo.
Seeders live in `local-seeders/<tier>/` — **independent git repos** (`github.com/silvertakana/wwv-seeders` for community, `wwv-seeders-private` for private). Never commit seeder files to the worldwideview repo.
### Create `local-seeders/community/packages/<name>/`
If you scaffolded with `--architecture websocket`, **the CLI already created the seeder skeleton** at `local-seeders/<tier>/packages/<name>/` (`package.json` + `tsup.config.ts` + `src/index.ts` with a `{ name, cron, fn }` stub). Do **not** recreate those files — open the generated `src/index.ts` and replace the stub body with real fetch + map logic. The snippets below are the target shapes the CLI emits; use them to verify/adjust what was generated, not to create files from scratch.
**`package.json`:**
### Generated layout: `local-seeders/<tier>/packages/<name>/`
**`package.json`** (CLI-generated — only adjust `dependencies` for what your seeder imports):
```json
{
"name": "@wwv-seeders/<name>",
+17
View File
@@ -72,6 +72,23 @@ mapWebsocketPayload(payload: any, existingEntities: GeoEntity[]): GeoEntity[]
- `existingEntities` — current entities in the store for this plugin (use for incremental updates)
- Must return a **complete replacement** `GeoEntity[]` (not a diff)
### Property Tag Helpers
Always wrap typed property values with the SDK helpers so the Intel panel renders them richly:
```ts
import { dtProp, urlProp, imageProp, videoProp } from "@worldwideview/wwv-plugin-sdk";
properties: {
updated: dtProp(item.updated_at ?? null), // renders as expandable datetime row
source: urlProp(item.source_url ?? null), // renders as clickable link
preview: imageProp(item.image ?? null), // renders as inline thumbnail
stream: videoProp(item.video_url ?? null), // renders as "Watch" link
}
```
All helpers are null-safe and return `null` for empty input. Plain string/number values that don't need rich rendering need no wrapper.
---
## Plugin Architectures (Manifest Formats)
+93
View File
@@ -0,0 +1,93 @@
---
name: plugin-new
description: End-to-end pipeline that takes a WorldWideView plugin from idea to npm-published and cleaned up. Conducts an isolated worktree + scaffold, GSD research/plan/build/UAT, dual-repo PRs (plugin + seeder), npm publish, and teardown, with user gates only at plan approval, UAT sign-off, npm publish, and teardown. Use when the user says "/plugin-new", "new plugin", "build a plugin end to end", "ship a plugin", or "run the plugin pipeline".
---
# Plugin Pipeline (`/plugin-new`)
A **conductor** skill: it runs the staged pipeline in the main conversation and **delegates** the real work to existing agents and GSD. It does not reimplement research, planning, execution, or worktree mechanics; it sequences them and enforces the gates.
## Principles
- **Don't reinvent GSD.** Research, spec, plan, execute, verify, and UAT are GSD phases (running in the plugin's own isolated `.planning`). The pipeline adds only the plugin-specific bookends: isolated-worktree scaffolding at the front, and dual-repo PR + npm publish + teardown at the back.
- **Compose existing agents.** Reuse `plugin-researcher`, `plugin-implementer`, `worktree-manager`, `branch-finisher`, `branch-cleanup`. Never write logic these already provide.
- **Gate only the irreversible.** Autonomous within a stage; stop for the user only at the 4 gates below.
- **One isolated worktree per plugin**, with a project-per-plugin GSD project in its own real `.planning` (per the per-worktree isolation model). This keeps each plugin's planning private and teardown clean.
- **Stop on red.** A failed stage halts the pipeline with a clear report. Never continue past a failed gate. Resume with `/gsd:resume-work`.
## Gates (the only stops)
| Stage | Gate | Why |
|---|---|---|
| 2 | Plan approval | Don't build the wrong thing |
| 4 | UAT sign-off | Human judges the live result |
| 6 | npm publish | Public, irreversible |
| 7 | Teardown | Destroys worktree + Docker volume |
---
## Stage 0: Kickoff
1. Read the plugin name from the invocation (kebab-case). If missing, ask for it.
2. Validate: name is kebab-case and not already present in `local-plugins/` or on npm. If taken, stop and ask.
3. Capture the one-line idea (ask if not given).
## Stage 1: Isolated worktree + scaffold
1. Delegate worktree creation to the **worktree-manager** agent: a sibling worktree `feat/plugin-<name>` based off `origin/main`. (Delegating keeps the verbose git-wt/hook output out of the main session.)
2. Bootstrap it with the **worktree-bootstrap** skill, ensuring its `.planning` is a REAL isolated directory (Step 5 of that skill), NOT a junction. If git-wt's `link_planning` hook left a junction, convert it to a real dir before proceeding (see worktree-bootstrap Step 5).
3. Scaffold the plugin skeleton (`WorldPlugin` entry + seeder stub + `package.json`) using the **worldwideview-plugin-creation** skill / **plugin-implementer** agent.
4. **Label Docker resources** for this plugin so teardown is exact: when the seeder/data-engine containers and volumes are created for this plugin, tag them with `wwv-plugin=<name>` (compose label or naming convention `wwv-<name>-*`). Record the labels in the worktree's `.planning/WORKSPACE.md`.
5. Verify the scaffold builds clean. If it errors, STOP and report (do not limp forward).
- **Gate:** none.
## Stage 2: Idea -> research -> plan (GSD, project-per-plugin)
1. In the worktree, run `/gsd:new-project` scoped to this plugin (its own GSD project in the isolated `.planning`).
2. Run the **plugin-researcher** agent: find the data API, rate limits, auth, endpoints, update cadence; produce an implementation-ready research brief.
3. Run GSD `discuss-phase` then `plan-phase` to produce the phase plan, weaving in the research.
- **Gate: user approves the plan** (GSD plan-review). Do not proceed without it.
## Stage 3: Autonomous build + e2e test (handoff)
1. Run GSD `execute-phase`, which drives the **plugin-implementer** agent to build per the approved plan.
2. Test end to end: `pnpm dev` (frontend), Docker (data engine + Redis + seeder), and Playwright (**playwright-testing** skill) for on-globe rendering.
3. Loop on failures via GSD (`tdd-loop` / `code-review` / `autofix`) until green. No user intervention in this stage.
- **Gate:** none (autonomous until all issues are fixed).
## Stage 4: UAT (servers already up)
1. Spin up the relevant servers (frontend + data engine + seeder) and run GSD `audit-uat`.
2. Present the plugin live on the globe and ask the user to try it.
- **Gate: user UAT sign-off.** If the user reports issues, loop back to Stage 3 (standard GSD fix cycle), then re-run UAT.
## Stage 5: Ship (dual PRs, independent versions)
1. The plugin (`local-plugins/`) and seeder (`local-seeders/`) are independent git repos with their own remotes. Bump each repo's semver **independently** (only bump the side that changed) and open a PR for each via the **branch-finisher** agent, once per repo.
2. Wait for BOTH PRs' CI to pass. If either fails, STOP and report (do not publish a half-shipped pair).
- **Gate:** none to open; the pipeline waits for both green.
## Stage 6: npm publish (user-confirmed)
1. After both PRs succeed, ASK the user whether to publish the plugin to npm.
2. On confirm, publish with bundled assets for CDN distribution (reuse the existing publish workflow / the market-tracker v1.0.x package.json bundling config + `syncToPublic`).
- **Gate: user confirms publish.** Never publish without it.
## Stage 7: Teardown (user-confirmed)
1. ASK the user if they are ready to clean up.
2. On confirm, run **`/branch-cleanup`** (it archives the worktree's isolated `.planning` to the shared archive, then removes the worktree via worktree-manager).
3. Tear down this plugin's Docker resources using the `wwv-plugin=<name>` labels from Stage 1 (containers + volumes). Verify nothing for this plugin remains.
- **Gate: user confirms teardown.**
---
## State, resume, and failure handling
- State lives in the worktree's isolated `.planning` (GSD STATE.md + phases). After any interruption, resume with `/gsd:resume-work` without re-paying for completed stages.
- A failed stage stops the pipeline with a clear report. The user fixes and resumes; nothing continues silently past a red gate.
- Dual-PR coordination (Stage 5): if one PR's CI fails, report and pause; do not publish (Stage 6) until both are green.
## Reused components (must exist)
`worktree-manager`, `worktree-bootstrap`, `worldwideview-plugin-creation`, `plugin-researcher`, `plugin-implementer`, `branch-finisher`, `branch-cleanup`, GSD phase skills (`new-project`, `discuss-phase`, `plan-phase`, `execute-phase`, `tdd-loop`, `audit-uat`, `resume-work`), `playwright-testing`, and the npm publish workflow.
@@ -202,7 +202,40 @@ import { Plane } from "lucide-react";
const iconUrl = createSvgIconUrl(Plane, { color: "#3b82f6" });
```
### 1.5 Registration (3 Paths)
### 1.5 Property Tag Helpers
Use these SDK helpers to wrap property values so the Intel panel renders them richly. Without the tag prefix, the panel falls back to plain text.
```ts
import { dtProp, urlProp, imageProp, videoProp } from "@worldwideview/wwv-plugin-sdk";
```
| Helper | Tag format stored | Panel renders as |
|---|---|---|
| `dtProp(iso)` | `"datetime:2026-06-01T05:00:00Z"` | Expandable row: local time (collapsed), UTC + relative (expanded) |
| `urlProp(href)` | `"url:https://..."` | Clickable link with external icon |
| `imageProp(src)` | `"image:https://..."` | Inline thumbnail |
| `videoProp(href)` | `"video:https://..."` | "Watch" link with play icon |
All four helpers return `null` for empty, `null`, or `undefined` input — safe to call unconditionally.
**Usage pattern:**
```ts
properties: {
// dates — pass ISO 8601 strings
updated_at: dtProp(item.updated_at ?? null),
// URLs
source_url: urlProp(item.url ?? null),
// images and video
preview: imageProp(item.image_url ?? null),
stream: videoProp(item.video_url ?? null),
// plain values — no helper needed
name: item.name,
count: item.count,
}
```
### 1.6 Registration (3 Paths)
**A. Built-in (monorepo package):**
@@ -224,7 +257,7 @@ await pluginManager.registerPlugin(plugin);
**C. Dynamic import (runtime):**
For user-imported GeoJSON layers, call `pluginManager.loadFromManifest(manifest)` directly.
### 1.6 Build Configuration (Core Monorepo Packages Only)
### 1.7 Build Configuration (Core Monorepo Packages Only)
If you decide to manually move a plugin from the local sandbox into the core `packages/` directory, you must manually add it to the build pipeline:
@@ -652,6 +685,10 @@ Categories are **lowercase**: `"aviation"` not `"Aviation"`, `"natural-disaster"
- [ ] **Frontend:** Added path alias in `tsconfig.json`
- [ ] **Frontend:** Registered via `pluginRegistry` + `pluginManager` in `AppShell.tsx`
- [ ] **Frontend:** `renderEntity()` doesn't mix point/billboard properties
- [ ] **Frontend:** Date/time fields wrapped with `dtProp()`
- [ ] **Frontend:** External links wrapped with `urlProp()`
- [ ] **Frontend:** Image URLs wrapped with `imageProp()`
- [ ] **Frontend:** Video/stream URLs wrapped with `videoProp()`
- [ ] **Engine:** Seeder file in `wwv-seeders/src/seeders/<name>.ts` (or private repo)
- [ ] **Engine:** `registerSeeder({ name })` matches frontend plugin `id`
- [ ] **Engine:** Calls `setLiveSnapshot()` with correct plugin ID key
+16
View File
@@ -1,10 +1,26 @@
name: CI
# CLI-only changes are covered by cli.yml; skip the full app suite for them.
# Docs/agent-rules/issue-template changes also skip the suite.
on:
push:
branches: [main]
paths-ignore:
- "packages/wwv-cli/**"
- ".agents/**"
- "**/*.md"
- ".github/ISSUE_TEMPLATE/**"
- ".github/PULL_REQUEST_TEMPLATE.md"
- ".github/gc/**"
pull_request:
branches: [main]
paths-ignore:
- "packages/wwv-cli/**"
- ".agents/**"
- "**/*.md"
- ".github/ISSUE_TEMPLATE/**"
- ".github/PULL_REQUEST_TEMPLATE.md"
- ".github/gc/**"
jobs:
# Non-blocking dependency audit. Surfaces high / critical vulnerabilities
+36
View File
@@ -0,0 +1,36 @@
name: CLI
# Scoped to the plugin CLI package only. Heavy app workflows (ci.yml,
# playwright.yml, docker-publish.yml, ...) exclude this path, so a CLI-only
# change runs just this fast build + test instead of the full suite.
on:
push:
branches: [main]
paths:
- "packages/wwv-cli/**"
- ".github/workflows/cli.yml"
pull_request:
branches: [main]
paths:
- "packages/wwv-cli/**"
- ".github/workflows/cli.yml"
permissions:
contents: read
jobs:
build-and-test:
name: Build & Test CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
# `build` runs tsc — this also type-checks the CLI source.
- run: pnpm --filter @worldwideview/wwv-cli build
# Integration tests spawn the built CLI and assert the scaffolded tree.
- run: pnpm --filter @worldwideview/wwv-cli test
+23
View File
@@ -1,10 +1,33 @@
name: Docker Image CI
# Only rebuild the image when files that affect the final container change.
# Doc/agent-rules/test-only changes skip the expensive multi-stage build.
# Skipped workflow runs satisfy GitHub required status checks (neutral pass).
on:
push:
branches: [ "main" ]
paths:
- "src/**"
- "prisma/**"
- "packages/**"
- "scripts/**"
- "Dockerfile"
- "package.json"
- "pnpm-lock.yaml"
- "next.config.ts"
- ".github/workflows/docker-publish.yml"
pull_request:
branches: [ "main" ]
paths:
- "src/**"
- "prisma/**"
- "packages/**"
- "scripts/**"
- "Dockerfile"
- "package.json"
- "pnpm-lock.yaml"
- "next.config.ts"
- ".github/workflows/docker-publish.yml"
env:
REGISTRY: ghcr.io
+23
View File
@@ -1,9 +1,32 @@
name: Playwright Tests
# Only run E2E tests when application code actually changes.
# Doc/agent-rules/config-only changes skip the full 3-browser matrix.
# Skipped workflow runs satisfy GitHub required status checks (neutral pass).
on:
push:
branches: [ main, master ]
paths:
- "src/**"
- "tests/**"
- "prisma/**"
- "public/**"
- "package.json"
- "pnpm-lock.yaml"
- "next.config.ts"
- "playwright.config.ts"
- ".github/workflows/playwright.yml"
pull_request:
branches: [ main, master ]
paths:
- "src/**"
- "tests/**"
- "prisma/**"
- "public/**"
- "package.json"
- "pnpm-lock.yaml"
- "next.config.ts"
- "playwright.config.ts"
- ".github/workflows/playwright.yml"
permissions:
contents: read
jobs:
+2
View File
@@ -3,6 +3,8 @@ name: Test Local Dev Environment
on:
push:
branches: [main]
paths-ignore:
- "packages/wwv-cli/**"
pull_request:
branches: [main]
paths:
+5
View File
@@ -1,10 +1,15 @@
name: Test Setup Scripts
# CLI-only changes are covered by cli.yml; skip setup-script tests for them.
on:
push:
branches: [ "main" ]
paths-ignore:
- "packages/wwv-cli/**"
pull_request:
branches: [ "main" ]
paths-ignore:
- "packages/wwv-cli/**"
permissions:
contents: read
+1 -2
View File
@@ -1,6 +1,6 @@
{
"name": "worldwideview",
"version": "2.24.5",
"version": "2.25.3",
"private": true,
"type": "module",
"packageManager": "[email protected]",
@@ -120,4 +120,3 @@
"pnpm": ">=9.0.0"
}
}
+3 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@worldwideview/wwv-cli",
"version": "1.2.0",
"version": "1.3.1",
"type": "module",
"description": "WorldWideView CLI",
"main": "dist/index.js",
@@ -10,7 +10,8 @@
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"clean": "rm -rf dist"
"clean": "rm -rf dist",
"test": "node --test \"test/**/*.test.mjs\""
},
"dependencies": {
"commander": "^14.0.3",
+180 -72
View File
@@ -4,29 +4,74 @@ import fs from 'fs';
import path from 'path';
import prompts from 'prompts';
const VALID_CATEGORIES = ['aviation', 'maritime', 'space', 'weather', 'custom'];
const VALID_ARCHITECTURES = ['polling', 'websocket'];
const VALID_SEEDER_TIERS = ['community', 'private'];
const VALID_RENDER_STYLES = ['billboard', 'model', 'point'];
interface CreateOptions {
core?: boolean;
displayName?: string;
description?: string;
category?: string;
architecture?: string;
seederTier?: string;
renderStyle?: string;
yes?: boolean;
}
function assertChoice(label: string, value: string | undefined, valid: string[]): void {
if (value !== undefined && !valid.includes(value)) {
console.error(`Error: invalid --${label} "${value}". Valid values: ${valid.join(', ')}`);
process.exit(1);
}
}
export const createCommand = new Command('create')
.description('Interactively scaffold a new WorldWideView plugin')
.description('Scaffold a new WorldWideView plugin (flags skip the matching prompt; omit them for interactive mode)')
.argument('[pluginId]', 'Unique kebab-case plugin ID (e.g. my-tracker)')
.option('-c, --core', 'Create inside packages instead of local-plugins (for core contributors)')
.action(async (options) => {
const response = await prompts([
{
.option('-n, --display-name <name>', 'Display name (e.g. "My Live Tracker")')
.option('-d, --description <text>', 'Short description')
.option('--category <category>', `One of: ${VALID_CATEGORIES.join(', ')}`)
.option('--architecture <architecture>', `One of: ${VALID_ARCHITECTURES.join(', ')}`)
.option('--seeder-tier <tier>', `One of: ${VALID_SEEDER_TIERS.join(', ')} (websocket only)`)
.option('--render-style <style>', `One of: ${VALID_RENDER_STYLES.join(', ')}`)
.option('-y, --yes', 'Non-interactive: fail instead of prompting for missing values')
.action(async (pluginIdArg: string | undefined, options: CreateOptions) => {
// Validate any flags supplied up front so we fail fast and consistently.
assertChoice('category', options.category, VALID_CATEGORIES);
assertChoice('architecture', options.architecture, VALID_ARCHITECTURES);
assertChoice('seeder-tier', options.seederTier, VALID_SEEDER_TIERS);
assertChoice('render-style', options.renderStyle, VALID_RENDER_STYLES);
// Build the prompt list, skipping any value already supplied via flag/arg.
// In --yes mode we never prompt; missing required values are an error.
const promptList: prompts.PromptObject[] = [];
if (!pluginIdArg) {
promptList.push({
type: 'text',
name: 'pluginId',
message: 'What is the unique ID for your plugin? (e.g. my-tracker)',
validate: value => value.length > 0 ? true : 'Plugin ID is required'
},
{
validate: value => value.length > 0 ? true : 'Plugin ID is required',
});
}
if (options.displayName === undefined) {
promptList.push({
type: 'text',
name: 'displayName',
message: 'What is the display name? (e.g. My Live Tracker)',
initial: (prev: string) => prev.replace(/-/g, ' ').replace(/\b\w/g, (l: string) => l.toUpperCase())
},
{
type: 'text',
name: 'description',
message: 'Enter a short description:'
},
{
initial: pluginIdArg
? pluginIdArg.replace(/-/g, ' ').replace(/\b\w/g, (l: string) => l.toUpperCase())
: undefined,
});
}
if (options.description === undefined) {
promptList.push({ type: 'text', name: 'description', message: 'Enter a short description:' });
}
if (options.category === undefined) {
promptList.push({
type: 'select',
name: 'category',
message: 'Which category does this plugin belong to?',
@@ -35,46 +80,78 @@ export const createCommand = new Command('create')
{ title: 'Maritime (Ship icon)', value: 'maritime' },
{ title: 'Space (Satellite icon)', value: 'space' },
{ title: 'Weather (Cloud icon)', value: 'weather' },
{ title: 'Custom (Box icon)', value: 'custom' }
]
},
{
{ title: 'Custom (Box icon)', value: 'custom' },
],
});
}
if (options.architecture === undefined) {
promptList.push({
type: 'select',
name: 'architecture',
message: 'How will your plugin receive data?',
choices: [
{ title: 'REST Polling / Static Data (Frontend only)', value: 'polling' },
{ title: 'Real-Time WebSockets (Generates backend seeder)', value: 'websocket' }
]
},
{
type: (prev: string) => prev === 'websocket' ? 'select' : null,
{ title: 'Real-Time WebSockets (Generates backend seeder)', value: 'websocket' },
],
});
}
if (options.seederTier === undefined) {
promptList.push({
// Only ask about seeder tier when architecture resolves to websocket.
type: (_prev, values) => {
const arch = options.architecture ?? values.architecture;
return arch === 'websocket' ? 'select' : null;
},
name: 'seederTier',
message: 'Which tier should your backend seeder belong to?',
choices: [
{ title: 'Community (Open data, shared)', value: 'community' },
{ title: 'Private (Requires API keys, restricted)', value: 'private' }
]
},
{
{ title: 'Private (Requires API keys, restricted)', value: 'private' },
],
});
}
if (options.renderStyle === undefined) {
promptList.push({
type: 'select',
name: 'renderStyle',
message: 'How should entities be rendered on the 3D globe?',
choices: [
{ title: '2D Billboard (Great for static icons)', value: 'billboard' },
{ title: '3D Model with LOD (Transitions 2D to 3D)', value: 'model' },
{ title: 'Simple Point (High performance dots)', value: 'point' }
]
}
]);
{ title: 'Simple Point (High performance dots)', value: 'point' },
],
});
}
if (!response.pluginId) {
if (options.yes && promptList.length > 0) {
// Only count prompts that would actually fire. seederTier is irrelevant
// unless the resolved architecture is websocket, so a polling plugin with
// --yes must not be forced to supply it.
const missing = promptList
.map(p => p.name as string)
.filter(name => (name === 'seederTier' ? options.architecture === 'websocket' : true));
if (missing.length > 0) {
console.error(`Error: --yes given but these required values are missing: ${missing.join(', ')}`);
process.exit(1);
}
}
const answers = promptList.length > 0 ? await prompts(promptList) : {};
// Merge flags/args (authoritative) over interactive answers.
const pluginId: string | undefined = pluginIdArg ?? answers.pluginId;
const displayName: string = options.displayName ?? answers.displayName ?? '';
const description: string = options.description ?? answers.description ?? '';
const category: string = options.category ?? answers.category;
const architecture: string = options.architecture ?? answers.architecture;
const seederTier: string | undefined = options.seederTier ?? answers.seederTier;
const renderStyle: string = options.renderStyle ?? answers.renderStyle;
if (!pluginId) {
console.log('Plugin creation cancelled.');
return;
}
const { pluginId, displayName, description, category, architecture, seederTier, renderStyle } = response;
const targetBaseDir = options.core ? 'packages' : 'local-plugins';
const pluginDir = path.join(process.cwd(), targetBaseDir, `wwv-plugin-${pluginId}`);
@@ -85,21 +162,19 @@ export const createCommand = new Command('create')
fs.mkdirSync(pluginDir, { recursive: true });
// Determine category icon
const iconMap: Record<string, string> = {
aviation: 'Plane',
maritime: 'Ship',
space: 'Satellite',
weather: 'Cloud',
custom: 'Box'
custom: 'Box',
};
const defaultIcon = iconMap[category] || 'Box';
// Package.json boilerplate
const streamUrlField = architecture === 'websocket'
? `\n "streamUrl": "wss://dataenginev2.worldwideview.dev/stream",`
const streamUrlField = architecture === 'websocket'
? `\n "streamUrl": "wss://dataenginev2.worldwideview.dev/stream",`
: '';
const packageJsonContent = `{
"name": "@worldwideview/wwv-plugin-${pluginId}",
"version": "1.0.0",
@@ -131,7 +206,6 @@ export const createCommand = new Command('create')
}
`;
// index.ts boilerplate
const renderBoilerplate = {
billboard: `return {
type: 'billboard',
@@ -152,14 +226,14 @@ export const createCommand = new Command('create')
size: 8,
outlineColor: '#ffffff',
outlineWidth: 2
};`
};`,
}[renderStyle as string] || `return {};`;
const fetchBoilerplate = architecture === 'polling'
const fetchBoilerplate = architecture === 'polling'
? `\n async fetch(): Promise<GeoEntity[]> {
// Implement REST polling logic here
return [];
}\n`
}\n`
: '';
const indexTsContent = `import { WorldPlugin, GeoEntity, CesiumEntityOptions } from '@worldwideview/wwv-plugin-sdk';
@@ -195,41 +269,75 @@ ${fetchBoilerplate}
console.log(`\n✅ Successfully created plugin frontend at ${pluginDir}`);
// Generate seeder backend if requested
// Generate seeder backend if requested. Matches the real community/private
// seeder layout: local-seeders/<tier>/packages/<pluginId>/ with a tsup build
// and a src/index.ts that exports the canonical { name, cron, fn } shape.
if (architecture === 'websocket' && seederTier) {
const seederDir = path.join(process.cwd(), 'local-seeders', seederTier, pluginId);
if (!fs.existsSync(seederDir)) {
fs.mkdirSync(seederDir, { recursive: true });
const seederContent = `// WWV Data Engine Seeder for ${pluginId}
export default async function run(context) {
console.log('Starting ${displayName} seeder...');
// Example: Emit a mock entity to the engine
setInterval(() => {
context.emit({
id: '${pluginId}-mock-1',
lat: 0,
lng: 0,
alt: 10000,
heading: 0,
velocity: 250,
properties: {
status: 'active'
}
});
}, 1000);
const seederDir = path.join(process.cwd(), 'local-seeders', seederTier, 'packages', pluginId);
if (fs.existsSync(seederDir)) {
console.error(`Warning: Seeder directory ${seederDir} already exists. Skipping seeder scaffold.`);
} else {
fs.mkdirSync(path.join(seederDir, 'src'), { recursive: true });
const seederPackageJson = `{
"name": "@wwv-seeders/${pluginId}",
"version": "1.0.0",
"main": "dist/index.mjs",
"scripts": {
"build": "tsup"
},
"dependencies": {
"@worldwideview/seeder-sdk": "^1.0.0"
}
}
`;
fs.writeFileSync(path.join(seederDir, 'seeder.mjs'), seederContent);
const tsupConfig = `import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm'],
clean: true,
shims: true,
noExternal: [/@wwv-seeders\\/.*/],
external: [/^(?!@wwv-seeders)[a-z@].*/],
});
`;
// The seeder's exported `name` MUST equal the frontend plugin id
// (kebab-case). See ADR-0002 / data-engine-architecture.md section 6.
const seederIndexTs = `import { setLiveSnapshot, fetchWithTimeout, withRetry } from '@worldwideview/seeder-sdk';
async function seed${pluginId.replace(/-/g, '')}() {
// TODO: fetch from the real data source and map into GeoEntity-shaped items.
const items: Array<{ id: string; lat: number; lon: number; name: string }> = [];
await setLiveSnapshot('${pluginId}', {
source: '${pluginId}',
fetchedAt: new Date().toISOString(),
items,
totalCount: items.length,
}, 3600);
}
export default {
name: '${pluginId}', // MUST match the frontend plugin id exactly (kebab-case)
cron: '*/15 * * * *',
fn: seed${pluginId.replace(/-/g, '')},
};
`;
fs.writeFileSync(path.join(seederDir, 'package.json'), seederPackageJson);
fs.writeFileSync(path.join(seederDir, 'tsup.config.ts'), tsupConfig);
fs.writeFileSync(path.join(seederDir, 'src', 'index.ts'), seederIndexTs);
console.log(`✅ Successfully created plugin seeder at ${seederDir}`);
}
}
console.log(`\nNext steps:
1. Run \`pnpm install\` from the project root.
2. Edit \`index.ts\` in your plugin directory.
${architecture === 'websocket' ? '3. Edit `seeder.mjs` in your local-seeders directory.' : ''}
2. Edit \`src/index.ts\` in your plugin directory.
${architecture === 'websocket' && seederTier ? `3. Edit \`src/index.ts\` in local-seeders/${seederTier}/packages/${pluginId}/, then \`pnpm build\` it.` : ''}
`);
});
+1 -1
View File
@@ -9,7 +9,7 @@ const program = new Command();
program
.name('wwv')
.description('WorldWideView Plugin CLI')
.version('1.1.2');
.version('1.3.1');
program.addCommand(createCommand);
program.addCommand(publishCommand);
+219
View File
@@ -0,0 +1,219 @@
// Integration tests for `wwv create`.
//
// These spawn the *built* CLI (dist/index.js) into a throwaway temp directory
// and assert the generated file tree. No mocking — this is the real scaffold
// path agents and humans use. Run with: `node --test test/` (the CLI must be
// built first; the cli.yml workflow runs `pnpm build` before this).
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { spawnSync } from 'node:child_process';
import { mkdtempSync, readFileSync, existsSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
const CLI = resolve(import.meta.dirname, '..', 'dist', 'index.js');
function freshDir() {
return mkdtempSync(join(tmpdir(), 'wwv-cli-test-'));
}
function runCreate(cwd, args) {
const res = spawnSync(process.execPath, [CLI, 'create', ...args], {
cwd,
encoding: 'utf8',
// Empty stdin so a stray prompt (a bug) fails fast instead of hanging CI.
input: '',
});
return { status: res.status, stdout: res.stdout ?? '', stderr: res.stderr ?? '' };
}
function readPkg(dir, ...segments) {
return JSON.parse(readFileSync(join(dir, ...segments), 'utf8'));
}
function readText(dir, ...segments) {
return readFileSync(join(dir, ...segments), 'utf8');
}
// --- Happy-path plugin types -------------------------------------------------
test('polling plugin: frontend only, no seeder, no streamUrl, has fetch()', () => {
const dir = freshDir();
try {
const r = runCreate(dir, [
'poll-test', '-n', 'Poll Test', '-d', 'A polling plugin',
'--category', 'custom', '--architecture', 'polling', '--render-style', 'point', '--yes',
]);
assert.equal(r.status, 0, r.stderr);
const pkg = readPkg(dir, 'local-plugins', 'wwv-plugin-poll-test', 'package.json');
assert.equal(pkg.name, '@worldwideview/wwv-plugin-poll-test');
assert.equal(pkg.worldwideview.pluginId, 'poll-test');
assert.equal(pkg.worldwideview.category, 'custom');
assert.equal(pkg.worldwideview.streamUrl, undefined, 'polling plugin must not declare streamUrl');
const idx = readText(dir, 'local-plugins', 'wwv-plugin-poll-test', 'src', 'index.ts');
assert.match(idx, /id = 'poll-test'/);
assert.match(idx, /getPollingInterval\(\): number \{\s*return 10000/);
assert.match(idx, /async fetch\(/);
assert.match(idx, /type: 'point'/);
assert.ok(!existsSync(join(dir, 'local-seeders')), 'polling plugin must not scaffold a seeder');
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
test('websocket + community + billboard: seeder under community/packages, streamUrl, Plane icon', () => {
const dir = freshDir();
try {
const r = runCreate(dir, [
'ws-comm', '-n', 'WS Comm', '-d', 'desc',
'--category', 'aviation', '--architecture', 'websocket', '--seeder-tier', 'community',
'--render-style', 'billboard', '--yes',
]);
assert.equal(r.status, 0, r.stderr);
const pkg = readPkg(dir, 'local-plugins', 'wwv-plugin-ws-comm', 'package.json');
assert.equal(pkg.worldwideview.icon, 'Plane');
assert.ok(pkg.worldwideview.streamUrl, 'websocket plugin must declare a streamUrl');
const seederBase = join(dir, 'local-seeders', 'community', 'packages', 'ws-comm');
assert.ok(existsSync(join(seederBase, 'package.json')), 'seeder package.json missing');
assert.ok(existsSync(join(seederBase, 'tsup.config.ts')), 'seeder tsup.config.ts missing');
const seederPkg = readPkg(dir, 'local-seeders', 'community', 'packages', 'ws-comm', 'package.json');
assert.equal(seederPkg.name, '@wwv-seeders/ws-comm');
assert.equal(seederPkg.main, 'dist/index.mjs');
const seederIdx = readText(dir, 'local-seeders', 'community', 'packages', 'ws-comm', 'src', 'index.ts');
assert.match(seederIdx, /name: 'ws-comm'/, "seeder name must equal the plugin id (ADR-0002)");
assert.match(seederIdx, /cron:/);
const idx = readText(dir, 'local-plugins', 'wwv-plugin-ws-comm', 'src', 'index.ts');
assert.match(idx, /getPollingInterval\(\): number \{\s*return 0;/);
assert.match(idx, /type: 'billboard'/);
assert.doesNotMatch(idx, /async fetch\(/, 'websocket plugin should not generate a fetch() stub');
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
test('websocket + private + model: seeder under private/packages, Satellite icon, model render', () => {
const dir = freshDir();
try {
const r = runCreate(dir, [
'ws-priv', '-n', 'WS Priv', '-d', 'desc',
'--category', 'space', '--architecture', 'websocket', '--seeder-tier', 'private',
'--render-style', 'model', '--yes',
]);
assert.equal(r.status, 0, r.stderr);
assert.ok(
existsSync(join(dir, 'local-seeders', 'private', 'packages', 'ws-priv', 'src', 'index.ts')),
'private seeder must land under local-seeders/private/packages/',
);
const pkg = readPkg(dir, 'local-plugins', 'wwv-plugin-ws-priv', 'package.json');
assert.equal(pkg.worldwideview.icon, 'Satellite');
const idx = readText(dir, 'local-plugins', 'wwv-plugin-ws-priv', 'src', 'index.ts');
assert.match(idx, /modelUrl/, 'model render style should reference modelUrl');
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
test('--core flag scaffolds into packages/ instead of local-plugins/', () => {
const dir = freshDir();
try {
const r = runCreate(dir, [
'core-test', '--core', '-n', 'Core', '-d', 'desc',
'--category', 'custom', '--architecture', 'polling', '--render-style', 'point', '--yes',
]);
assert.equal(r.status, 0, r.stderr);
assert.ok(existsSync(join(dir, 'packages', 'wwv-plugin-core-test', 'package.json')));
assert.ok(!existsSync(join(dir, 'local-plugins', 'wwv-plugin-core-test')));
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
test('multi-word id: kebab id preserved, class and seeder fn names strip dashes', () => {
const dir = freshDir();
try {
const r = runCreate(dir, [
'multi-word-plugin', '-n', 'Multi Word', '-d', 'desc',
'--category', 'custom', '--architecture', 'websocket', '--seeder-tier', 'community',
'--render-style', 'point', '--yes',
]);
assert.equal(r.status, 0, r.stderr);
const idx = readText(dir, 'local-plugins', 'wwv-plugin-multi-word-plugin', 'src', 'index.ts');
assert.match(idx, /class multiwordpluginPlugin/);
assert.match(idx, /id = 'multi-word-plugin'/);
const seederIdx = readText(dir, 'local-seeders', 'community', 'packages', 'multi-word-plugin', 'src', 'index.ts');
assert.match(seederIdx, /name: 'multi-word-plugin'/);
assert.match(seederIdx, /function seedmultiwordplugin\(/);
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
test('category icon mapping: maritime -> Ship, weather -> Cloud', () => {
const dir = freshDir();
try {
const base = ['-d', 'desc', '--architecture', 'polling', '--render-style', 'point', '--yes'];
assert.equal(runCreate(dir, ['sea', '-n', 'Sea', '--category', 'maritime', ...base]).status, 0);
assert.equal(runCreate(dir, ['sky', '-n', 'Sky', '--category', 'weather', ...base]).status, 0);
assert.equal(readPkg(dir, 'local-plugins', 'wwv-plugin-sea', 'package.json').worldwideview.icon, 'Ship');
assert.equal(readPkg(dir, 'local-plugins', 'wwv-plugin-sky', 'package.json').worldwideview.icon, 'Cloud');
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
// --- Failure / guard cases ---------------------------------------------------
test('--yes with a missing required value exits non-zero and creates nothing', () => {
const dir = freshDir();
try {
const r = runCreate(dir, ['fail-test', '--architecture', 'websocket', '--yes']);
assert.notEqual(r.status, 0, 'should fail when required values are missing');
assert.match(r.stderr, /missing/i);
assert.ok(!existsSync(join(dir, 'local-plugins', 'wwv-plugin-fail-test')), 'must not create a partial scaffold');
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
test('invalid --category exits non-zero with a clear message', () => {
const dir = freshDir();
try {
const r = runCreate(dir, [
'bad-cat', '-n', 'x', '-d', 'y', '--category', 'nonsense',
'--architecture', 'polling', '--render-style', 'point', '--yes',
]);
assert.notEqual(r.status, 0);
assert.match(r.stderr, /invalid --category/i);
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
test('creating into an existing plugin directory exits non-zero', () => {
const dir = freshDir();
try {
const args = [
'dup-test', '-n', 'x', '-d', 'y', '--category', 'custom',
'--architecture', 'polling', '--render-style', 'point', '--yes',
];
assert.equal(runCreate(dir, args).status, 0);
const second = runCreate(dir, args);
assert.notEqual(second.status, 0);
assert.match(second.stderr, /already exists/i);
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
+32
View File
@@ -52,6 +52,38 @@ export class MyPlugin implements WorldPlugin {
}
```
## Property Tag Helpers
Wrap entity property values with these helpers so the WorldWideView Intel panel renders them as rich UI elements instead of plain text.
```ts
import { dtProp, urlProp, imageProp, videoProp } from "@worldwideview/wwv-plugin-sdk";
```
| Helper | Wraps | Panel renders as |
|---|---|---|
| `dtProp(iso: string \| null)` | ISO 8601 date string | Expandable datetime row — local time collapsed, UTC + relative time expanded |
| `urlProp(href: string \| null)` | Any URL | Clickable link with external-link icon |
| `imageProp(src: string \| null)` | Image URL | Inline thumbnail |
| `videoProp(href: string \| null)` | Video/stream URL | "Watch" link with play icon |
All helpers are **null-safe**: passing `null`, `undefined`, or `""` returns `null`, which the panel skips cleanly.
```ts
// In your entity mapper:
properties: {
last_seen: dtProp(item.timestamp ?? null),
source_url: urlProp(item.url ?? null),
preview: imageProp(item.image_url ?? null),
live_stream: videoProp(item.stream ?? null),
// Plain values need no wrapper
name: item.name,
severity: item.severity,
}
```
Values without a tag prefix fall back to plain-text rendering, so existing plugins continue to work unchanged.
## Changelog
- **v1.0.3** — Added README with core interfaces and usage docs.
+42
View File
@@ -313,3 +313,45 @@ export * from "./viteGlobals";
// ─── Auth Contracts ──────────────────────────────────────────
export * from "./auth-contracts";
// ─── Tagged Property Helpers ─────────────────────────────────
/**
* Wraps an ISO 8601 date string for rich rendering in the Intel panel.
* The panel displays local time (collapsed) and UTC + relative time (expanded).
* @param iso - ISO 8601 string (e.g. "2026-06-01T05:00:00Z"), or null/undefined
* @returns Tagged string `"datetime:{iso}"`, or `null` if input is empty
*/
export function dtProp(iso: string | undefined | null): string | null {
if (!iso) return null;
return `datetime:${iso}`;
}
/**
* Wraps a URL for rich rendering in the Intel panel as a clickable external link.
* @param href - Any URL string, or null/undefined
* @returns Tagged string `"url:{href}"`, or `null` if input is empty
*/
export function urlProp(href: string | undefined | null): string | null {
if (!href) return null;
return `url:${href}`;
}
/**
* Wraps an image URL for rich rendering in the Intel panel as an inline thumbnail.
* @param src - Image URL string, or null/undefined
* @returns Tagged string `"image:{src}"`, or `null` if input is empty
*/
export function imageProp(src: string | undefined | null): string | null {
if (!src) return null;
return `image:${src}`;
}
/**
* Wraps a video or stream URL for rich rendering in the Intel panel as a "Watch" link.
* @param href - Video or stream URL string, or null/undefined
* @returns Tagged string `"video:{href}"`, or `null` if input is empty
*/
export function videoProp(href: string | undefined | null): string | null {
if (!href) return null;
return `video:${href}`;
}
+1149
View File
File diff suppressed because it is too large. Load diff
+3 -2
View File
@@ -38,8 +38,9 @@ export function PluginIcon({ icon, size = 18, color }: PluginIconProps) {
if (typeof icon === "string") {
const Resolved = icons[icon as keyof typeof icons] as LucideIcon | undefined;
if (Resolved) return <Resolved size={size} color={color} />;
// Treat as emoji or text fallback
return <span>{icon}</span>;
// Emoji: render as text. Unresolved ASCII icon name: render fallback so stale names don't leak as text.
if (/[^\x00-\x7F]/.test(icon)) return <span>{icon}</span>;
return <FallbackIcon size={size} />;
}
const IconComponent = icon;
+2 -11
View File
@@ -36,6 +36,7 @@ import { FeedbackDialog } from "@/components/common/FeedbackDialog";
import { isDemo } from "@/core/edition";
import { injectHostGlobals } from "@/core/plugins/hostGlobals";
import { getDisabledPluginIds } from "@/core/plugins/pluginPreferences";
import { initLogCatcher } from "@/lib/logCatcher";
import { MobileCameraStats } from "./MobileCameraStats";
import { MobileHudBar } from "./MobileHudBar";
@@ -88,17 +89,7 @@ export function AppShell() {
await injectHostGlobals();
setHostReady(true);
// Fetch disabled built-in plugins before registration
let disabledIds = new Set<string>();
try {
const res = await fetch("/api/marketplace/disabled-builtins");
if (res.ok) {
const data = await res.json();
disabledIds = new Set<string>(data.disabledIds ?? []);
}
} catch {
// Non-critical — load all built-ins if endpoint fails
}
const disabledIds = getDisabledPluginIds();
// Setup demo defaults
const demoDefaultPlugins = new Set<string>();
+13
View File
@@ -74,6 +74,19 @@
margin-top: 3px;
}
/* ─── Local Icon ─────────────────────────────────── */
.layer-item__local-icon-wrapper {
position: relative;
display: inline-flex;
align-items: center;
}
.layer-item__local-icon {
color: var(--accent-cyan);
flex-shrink: 0;
cursor: help;
}
/* ─── Unverified Icon ────────────────────────────── */
.layer-item__unverified-icon-wrapper {
position: relative;
+37 -22
View File
@@ -7,7 +7,7 @@
* @module src/components/panels
*/
import { ShieldAlert } from "lucide-react";
import { ShieldAlert, Wrench } from "lucide-react";
import { PluginIcon } from "@/components/common/PluginIcon";
import { Tooltip } from "@/components/ui/Tooltip";
import { pluginManager } from "@/core/plugins/PluginManager";
@@ -27,29 +27,46 @@ const CATEGORY_LABELS: Record<string, string> = {
custom: "Custom",
};
// ─── Trust Helpers ──────────────────────────────────────────
// ─── Source / Trust Helpers ─────────────────────────────────
type TrustTier = "built-in" | "verified" | "unverified";
function getTrust(pluginId: string): TrustTier {
function isLocalPlugin(pluginId: string): boolean {
const manifest = pluginManager.getManifest(pluginId);
return manifest?.trust ?? "unverified";
if (!manifest) return true;
const entry = manifest.entry ?? "";
return entry.startsWith("/plugins-local/") || entry.startsWith("http://localhost") || entry.startsWith("http://127.0.0.1");
}
function TrustIcon({ trust }: { trust: TrustTier }) {
if (trust !== "unverified") return null;
function TrustIcon({ pluginId, pluginName }: { pluginId: string; pluginName: string }) {
if (isLocalPlugin(pluginId)) {
return (
<Tooltip content={`Local plugin: ${pluginName}`}>
<span className="layer-item__local-icon-wrapper">
<Wrench
size={11}
className="layer-item__local-icon"
aria-label="Local plugin"
/>
</span>
</Tooltip>
);
}
return (
<Tooltip content="Unverified plugin, use at your own risk">
<span className="layer-item__unverified-icon-wrapper">
<ShieldAlert
size={12}
className="layer-item__unverified-icon"
aria-label="Unverified plugin"
/>
</span>
</Tooltip>
);
const manifest = pluginManager.getManifest(pluginId);
if (manifest?.trust === "unverified") {
return (
<Tooltip content="Unverified plugin, use at your own risk">
<span className="layer-item__unverified-icon-wrapper">
<ShieldAlert
size={12}
className="layer-item__unverified-icon"
aria-label="Unverified plugin"
/>
</span>
</Tooltip>
);
}
return null;
}
// ─── LayerItem Component ────────────────────────────────────
@@ -88,8 +105,6 @@ export function LayerItem({
onToggle,
onSelect,
}: LayerItemProps) {
const trust = getTrust(plugin.id);
return (
<div
className={`layer-item ${isSelected ? "layer-item--selected" : ""}`}
@@ -102,7 +117,7 @@ export function LayerItem({
<div className="layer-item__info">
<div className="layer-item__header">
<span className="layer-item__name">{plugin.name}</span>
<TrustIcon trust={trust} />
<TrustIcon pluginId={plugin.id} pluginName={plugin.name} />
</div>
<div className="layer-item__desc">{plugin.description}</div>
<div className="layer-item__footer">
+3 -3
View File
@@ -69,6 +69,7 @@
.plugin-item__header {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 1px;
}
@@ -77,9 +78,7 @@
font-size: 13px;
font-weight: 500;
color: var(--text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
word-break: break-word;
}
.plugin-item__version {
@@ -184,6 +183,7 @@
text-decoration: none;
font-size: 13px;
font-weight: 500;
text-align: center;
cursor: pointer;
transition: all var(--duration-normal) var(--ease-spring);
flex-shrink: 0%;
+65 -34
View File
@@ -11,12 +11,16 @@
import { useState, useEffect, useCallback } from "react";
import {
Trash2, ExternalLink, RefreshCw, Download, PowerOff, Power,
ShieldCheck, ShieldAlert, Shield
ShieldCheck, ShieldAlert, HardDrive
} from "lucide-react";
import { PluginIcon } from "@/components/common/PluginIcon";
import type { ComponentType } from "react";
import { pluginManager } from "@/core/plugins/PluginManager";
import { useStore } from "@/core/state/store";
import { getDisabledPluginIds, setPluginDisabled } from "@/core/plugins/pluginPreferences";
import { trackEvent } from "@/lib/analytics";
import { isPluginInstallEnabled } from "@/core/edition";
import type { PluginManifest } from "@/core/plugins/PluginManifest";
import "./PluginsTab.css";
// ─── Types ──────────────────────────────────────────────────
@@ -35,9 +39,9 @@ function TrustBadge({ trust }: { trust: string }) {
if (trust === "built-in") {
return (
<span className="trust-badge trust-badge--builtin">
<Shield size={9} />
<HardDrive size={9} />
{' '}
Built-in
Local
</span>
);
}
@@ -96,13 +100,9 @@ function getTrust(record: PluginRecord): string {
}
}
function getIcon(record: PluginRecord): string {
function getIcon(record: PluginRecord): string | ComponentType<{ size?: number; color?: string }> {
const managed = pluginManager.getPlugin(record.pluginId);
if (managed) {
return typeof managed.plugin.icon === "string"
? managed.plugin.icon
: "📦";
}
if (managed) return managed.plugin.icon ?? "📦";
try {
return JSON.parse(record.config).icon ?? "📦";
} catch {
@@ -120,6 +120,11 @@ function getName(record: PluginRecord): string {
}
}
function getVersion(record: PluginRecord): string {
if (record.version !== "built-in") return record.version;
return pluginManager.getManifest(record.pluginId)?.version ?? "";
}
// ─── PluginsTab ─────────────────────────────────────────────
/**
@@ -145,7 +150,8 @@ export function PluginsTab() {
const dbPlugins: PluginRecord[] = data.plugins ?? [];
const dbPluginMap = new Map(dbPlugins.map((p) => [p.pluginId, p]));
// Add built-in and local plugins that don't have a DB record yet (enabled by default)
// Add built-in and local plugins that don't have a DB record yet
const disabledIds = getDisabledPluginIds();
const allManaged = pluginManager.getAllPlugins();
for (const managed of allManaged) {
if (!dbPluginMap.has(managed.plugin.id)) {
@@ -154,11 +160,16 @@ export function PluginsTab() {
version: "built-in",
config: "{}",
installedAt: new Date().toISOString(),
enabled: true
enabled: !disabledIds.has(managed.plugin.id)
});
}
}
// Apply localStorage disabled state to all records
dbPlugins.forEach((p) => {
if (disabledIds.has(p.pluginId)) p.enabled = false;
});
setPlugins(dbPlugins);
if (typeof data.canManagePlugins === "boolean") {
setCanInstall(data.canManagePlugins);
@@ -192,32 +203,48 @@ export function PluginsTab() {
const handleDisable = async (pluginId: string) => {
setRemoving(pluginId);
try {
await fetch("/api/marketplace/disable", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ pluginId }),
});
trackEvent("plugin-disable", { plugin: pluginId });
setNeedsReload(true);
} catch {
setRemoving(null);
}
setPluginDisabled(pluginId, true);
pluginManager.disablePlugin(pluginId);
const state = useStore.getState();
state.setLayerEnabled(pluginId, false);
state.clearEntities(pluginId);
state.setEntityCount(pluginId, 0);
if (state.hoveredEntity?.pluginId === pluginId) state.setHoveredEntity(null, null);
if (state.selectedEntity?.pluginId === pluginId) state.setSelectedEntity(null);
setNeedsReload(true);
trackEvent("plugin-disable", { plugin: pluginId });
await loadPlugins();
setRemoving(null);
};
const handleEnable = async (pluginId: string) => {
setRemoving(pluginId);
try {
await fetch("/api/marketplace/enable", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ pluginId }),
});
trackEvent("plugin-enable", { plugin: pluginId });
setNeedsReload(true);
} catch {
setRemoving(null);
setPluginDisabled(pluginId, false);
setNeedsReload(false);
const alreadyRegistered = pluginManager.getPlugin(pluginId);
if (!alreadyRegistered) {
// Plugin was disabled at startup — its script was never loaded.
// Hot-load the script so it's available; leave the layer toggle off.
try {
const res = await fetch("/api/marketplace/load");
if (res.ok) {
const { manifests } = await res.json() as { manifests: PluginManifest[] };
const manifest = manifests.find((m) => m.id === pluginId);
if (manifest) {
await pluginManager.loadFromManifest(manifest);
useStore.getState().initLayer(pluginId, false);
}
}
} catch (err) {
console.error("[PluginsTab] Failed to hot-load plugin:", pluginId, err);
}
}
// Layer stays off — user controls it via the Data Layers toggle.
trackEvent("plugin-enable", { plugin: pluginId });
await loadPlugins();
setRemoving(null);
};
const handleCheckUpdates = async () => {
@@ -352,10 +379,12 @@ export function PluginsTab() {
<span className="plugin-item__name">
{getName(record)}
</span>
{getVersion(record) && (
<span className="plugin-item__version">
v
{record.version}
{getVersion(record)}
</span>
)}
</div>
<div className="plugin-item__meta">
<TrustBadge trust={getTrust(record)} />
@@ -415,10 +444,12 @@ export function PluginsTab() {
<span className="plugin-item__name">
{getName(record)}
</span>
{getVersion(record) && (
<span className="plugin-item__version">
v
{record.version}
{getVersion(record)}
</span>
)}
</div>
<div className="plugin-item__meta">
<TrustBadge trust={getTrust(record)} />
@@ -0,0 +1,66 @@
import { useState } from "react";
import { IntelPropertyRow } from "./IntelPropertyRow";
function formatLocal(iso: string): string {
return new Date(iso).toLocaleString(undefined, {
day: "numeric", month: "2-digit", year: "numeric",
hour: "numeric", minute: "2-digit", hour12: true, timeZoneName: "short",
});
}
function formatUtc(iso: string): string {
return new Date(iso).toISOString().slice(0, 16).replace("T", " ") + " UTC";
}
function formatRelative(iso: string): string {
const diff = new Date(iso).getTime() - Date.now();
const abs = Math.abs(diff);
const future = diff > 0;
if (abs < 60_000) return "just now";
if (abs < 3_600_000) {
const n = Math.round(abs / 60_000);
return future ? `in ${n}m` : `${n}m ago`;
}
if (abs < 86_400_000) {
const n = Math.round(abs / 3_600_000);
return future ? `in ${n}h` : `${n}h ago`;
}
const n = Math.round(abs / 86_400_000);
return future ? `in ${n}d` : `${n}d ago`;
}
interface DatetimePropertyRowProps {
label: string;
iso: string;
classNamePrefix?: string;
}
export function DatetimePropertyRow({ label, iso, classNamePrefix = "intel-panel" }: DatetimePropertyRowProps) {
const [expanded, setExpanded] = useState(false);
if (expanded) {
return (
<IntelPropertyRow label={label} isColumn classNamePrefix={classNamePrefix}>
<span
style={{ cursor: "pointer", fontWeight: 600 }}
onClick={() => setExpanded(false)}
>
{formatLocal(iso)}
</span>
<span style={{ opacity: 0.6, fontSize: "0.85em" }}>{formatUtc(iso)}</span>
<span style={{ opacity: 0.6, fontSize: "0.85em" }}>{formatRelative(iso)}</span>
</IntelPropertyRow>
);
}
return (
<IntelPropertyRow label={label} classNamePrefix={classNamePrefix}>
<span
style={{ cursor: "pointer", textDecoration: "underline dotted" }}
onClick={() => setExpanded(true)}
>
{formatLocal(iso)}
</span>
</IntelPropertyRow>
);
}
@@ -11,6 +11,8 @@ import { ImageProperty } from './ImageProperty';
import { UrlProperty } from './UrlProperty';
import { LongTextProperty } from './LongTextProperty';
import { IntelPropertyRow } from './IntelPropertyRow';
import { DatetimePropertyRow } from "./DatetimePropertyRow";
import { VideoProperty } from "./VideoProperty";
/**
* @interface DynamicPropertiesRenderProps
@@ -37,6 +39,52 @@ export function DynamicPropertiesRender({ entity, classNamePrefix = "intel-panel
const label = key.replace(/_/g, " ");
const stringValue = String(value);
// Tagged dispatch - explicit type prefix, checked before heuristics
if (typeof value === "string") {
if (value.startsWith("datetime:")) {
return (
<DatetimePropertyRow
key={key}
label={label}
iso={value.slice(9)}
classNamePrefix={classNamePrefix}
/>
);
}
if (value.startsWith("url:")) {
return (
<UrlProperty
key={key}
label={label}
url={value.slice(4)}
classNamePrefix={classNamePrefix}
/>
);
}
if (value.startsWith("image:")) {
return (
<ImageProperty
key={key}
label={label}
imageUrl={value.slice(6)}
entityId={entity.id}
entityLabel={entity.label ?? ""}
classNamePrefix={classNamePrefix}
/>
);
}
if (value.startsWith("video:")) {
return (
<VideoProperty
key={key}
label={label}
href={value.slice(6)}
classNamePrefix={classNamePrefix}
/>
);
}
}
// Identify property type
const isImage = typeof value === "string" && key.toLowerCase().includes("image") && /^https?:\/\//i.test(value);
const isUrl = !isImage && typeof value === "string" && /^https?:\/\//i.test(value);
@@ -0,0 +1,24 @@
import { PlayCircle } from "lucide-react";
import { IntelPropertyRow } from "./IntelPropertyRow";
interface VideoPropertyProps {
label: string;
href: string;
classNamePrefix?: string;
}
export function VideoProperty({ label, href, classNamePrefix = "intel-panel" }: VideoPropertyProps) {
return (
<IntelPropertyRow label={label} classNamePrefix={classNamePrefix}>
<a
href={href}
target="_blank"
rel="noopener noreferrer"
style={{ display: "flex", alignItems: "center", gap: 4, color: "var(--accent-cyan)" }}
>
<PlayCircle size={14} />
Watch
</a>
</IntelPropertyRow>
);
}
+2
View File
@@ -10,6 +10,7 @@ import {
getApprovedUnverifiedIds,
approveUnverifiedPlugin,
} from "@/lib/marketplace/trustedPlugins";
import { getDisabledPluginIds } from "@/core/plugins/pluginPreferences";
import { isDemo } from "@/core/edition";
/**
@@ -66,6 +67,7 @@ export function useMarketplaceSync(hostReady: boolean) {
async function loadManifest(manifest: PluginManifest) {
if (!manifest.id || loadedIds.current.has(manifest.id)) return;
if (getDisabledPluginIds().has(manifest.id)) return;
if (pluginManager.getPlugin(manifest.id)) {
loadedIds.current.add(manifest.id);
return;
+25
View File
@@ -0,0 +1,25 @@
const DISABLED_KEY = "wwv-disabled-plugins";
export function getDisabledPluginIds(): Set<string> {
try {
const raw = localStorage.getItem(DISABLED_KEY);
if (!raw) return new Set();
return new Set<string>(JSON.parse(raw));
} catch {
return new Set();
}
}
export function setPluginDisabled(pluginId: string, disabled: boolean): void {
try {
const ids = getDisabledPluginIds();
if (disabled) {
ids.add(pluginId);
} else {
ids.delete(pluginId);
}
localStorage.setItem(DISABLED_KEY, JSON.stringify([...ids]));
} catch {
// ignore storage errors
}
}
+33 -25
View File
@@ -24,28 +24,36 @@
}
.geojson-btn--primary {
background: linear-gradient(135deg, #00e5ff 0%, #00b0ff 100%);
color: #0a0e17;
background: var(--bg-glass);
color: var(--text-primary);
border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.geojson-btn--primary:hover:not(:disabled) {
box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
background: var(--bg-glass-hover);
box-shadow: var(--glass-shadow-inner);
transform: translateY(-1px);
}
.geojson-btn--primary:active:not(:disabled) {
transform: scale(0.98);
}
.geojson-btn--primary:disabled {
opacity: 0.4;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
.geojson-btn--secondary {
background: rgba(255, 255, 255, 0.08);
background: var(--bg-glass);
color: var(--text-primary);
border: 1px solid rgba(255, 255, 255, 0.12);
border: 1px solid var(--glass-border-inner);
}
.geojson-btn--secondary:hover:not(:disabled) {
background: rgba(255, 255, 255, 0.14);
background: var(--bg-glass-hover);
}
.geojson-btn--secondary:disabled {
@@ -87,7 +95,7 @@
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
border-bottom: 1px solid var(--glass-border-inner);
}
.geojson-modal__header h3 {
@@ -117,7 +125,7 @@
display: flex;
gap: 4px;
padding: 12px 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
border-bottom: 1px solid var(--glass-border-inner);
}
.geojson-tab {
@@ -136,13 +144,13 @@
}
.geojson-tab:hover {
background: rgba(255, 255, 255, 0.06);
background: rgba(var(--accent-rgb), 0.06);
color: var(--text-primary);
}
.geojson-tab--active {
background: rgba(0, 229, 255, 0.12);
color: #00e5ff;
background: rgba(var(--accent-rgb), 0.12);
color: var(--accent-cyan);
}
/* ─── Body ────────────────────────────────────────────────── */
@@ -163,7 +171,7 @@
justify-content: center;
gap: 8px;
padding: 32px 20px;
border: 2px dashed rgba(255, 255, 255, 0.15);
border: 2px dashed rgba(var(--accent-rgb), 0.2);
border-radius: 10px;
color: var(--text-muted);
cursor: pointer;
@@ -173,9 +181,9 @@
.geojson-dropzone:hover,
.geojson-dropzone--active {
border-color: #00e5ff;
background: rgba(0, 229, 255, 0.04);
color: #00e5ff;
border-color: var(--accent-cyan);
background: rgba(var(--accent-rgb), 0.04);
color: var(--accent-cyan);
}
.geojson-dropzone p {
@@ -194,9 +202,9 @@
width: 100%;
min-height: 140px;
padding: 12px;
border: 1px solid rgba(255, 255, 255, 0.1);
border: 1px solid var(--glass-border-inner);
border-radius: 8px;
background: rgba(0, 0, 0, 0.3);
background: var(--bg-secondary);
color: var(--text-primary);
font-family: "JetBrains Mono", "Fira Code", monospace;
font-size: 12px;
@@ -206,7 +214,7 @@
.geojson-textarea:focus {
outline: none;
border-color: #00e5ff;
border-color: var(--accent-cyan);
}
/* ─── Inputs ──────────────────────────────────────────────── */
@@ -214,9 +222,9 @@
.geojson-input {
width: 100%;
padding: 8px 12px;
border: 1px solid rgba(255, 255, 255, 0.1);
border: 1px solid var(--glass-border-inner);
border-radius: 6px;
background: rgba(0, 0, 0, 0.3);
background: var(--bg-secondary);
color: var(--text-primary);
font-size: 13px;
transition: border-color 0.2s;
@@ -224,7 +232,7 @@
.geojson-input:focus {
outline: none;
border-color: #00e5ff;
border-color: var(--accent-cyan);
}
.geojson-input::placeholder {
@@ -245,7 +253,7 @@
width: 32px;
height: 32px;
padding: 0;
border: 2px solid rgba(255, 255, 255, 0.15);
border: 2px solid var(--glass-border-inner);
border-radius: 6px;
background: none;
cursor: pointer;
@@ -256,8 +264,8 @@
.geojson-preview {
padding: 10px 14px;
border-radius: 8px;
background: rgba(0, 229, 255, 0.06);
border: 1px solid rgba(0, 229, 255, 0.15);
background: rgba(var(--accent-rgb), 0.06);
border: 1px solid rgba(var(--accent-rgb), 0.15);
display: flex;
flex-direction: column;
gap: 4px;
@@ -299,7 +307,7 @@
justify-content: flex-end;
gap: 8px;
padding: 12px 20px;
border-top: 1px solid rgba(255, 255, 255, 0.06);
border-top: 1px solid var(--glass-border-inner);
}
/* ─── Layer List ──────────────────────────────────────────── */