Commit Graph
9 Commits
Author SHA1 Message Date
Silvertakana 8f58c26e27 fix(sync): inline process.env, inlineDynamicImports, and CSS copy for local plugins (#201)
* fix(sync): add process.env replacement, inlineDynamicImports, and CSS copy to syncToPublic

- Inline replace-process-env Rollup plugin transforms process.env.NODE_ENV to "production"
  to prevent ReferenceError in browser bundles that lack a Node.js environment
- Switch codeSplitting to inlineDynamicImports: true so the build produces a single
  self-contained ES module with no bare chunk specifiers that the browser cannot resolve
- Add rollup-plugin-external-globals to remap shared host deps (react, cesium, zustand, SDK)
  to globalThis.__WWV_HOST__.* at bundle time
- syncToPublic now copies any .css files emitted alongside the .mjs bundle (e.g. from
  gridstack or other CSS-importing libs) into public/plugins-local/<id>/

* docs(plugin): add bundle footguns -- CSP/CSS, inlineDynamicImports, process.env, CORS
2026-05-29 10:46:04 +12:00
SilvertakanaandClaude Sonnet 4.6 6d62ca5677 fix(ws): diagnose & fix plugin 404s, WS auth failure, and reconnect storms (#169)
* fix(ws): exponential backoff + jitter on WsClient reconnect

Replaces the fixed 5-second reconnect delay with an exponential backoff
(5s→10s→20s→40s→60s cap, +4s random jitter) so simultaneous browser
sessions don't thunder-herd the engine on restart.

- Backoff resets only after a stable 5-second connection, not on every
  successful open, so rapid reconnect cycles don't mask the retry.
- Stale-timer bookkeeping added to the cleanup/unsubscribe path.

Also bundles two companion fixes discovered during the same session:

fix(scripts): BOM-safe JSON parsing in sync/watch-local-plugins (Fix)
  PowerShell 5.1 emits a UTF-8 BOM that Node's JSON.parse rejects;
  readJsonFile() strips U+FEFF before parsing, matching pnpm behavior.

docs(agents): add UTF-8 BOM troubleshooting entry (Fix)
  Documents diagnosis, fix, and prevention for the BOM crash.

Co-Authored-By: Claude Opus 4.7 <[email protected]>

* test(ws): pin Math.random to 0 so reconnect backoff test is deterministic

With jitter (Math.random()*4000), advancing timers by exactly 5000ms no
longer guaranteed to trigger the reconnect. Mocking Math.random to 0 in
beforeEach makes the delay deterministic (base only, no jitter) across
the full test suite.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
2026-05-21 01:07:16 +12:00
SilvertakanaandClaude Sonnet 4.6 58aac77a0b fix(engine): resolve plugin 404s and local engine routing (#166)
* refactor(marketplace): drive auto-seeding from signed verified registry

Retires the hard-coded DEFAULT_PLUGIN_IDS list and makes the signed
verified registry the single source of truth for what lands in a fresh
install. Publishing a plugin to the verified registry now auto-seeds
it; no code change required to add new defaults.

Also fixes the diagnosed plugins-404: fortiguard and nz-traffic-cameras
were in the static list but not published to npm, causing every fresh
boot to hit manifest 404s. Those entries are gone with the list.

- Delete src/lib/marketplace/defaultPlugins.ts (legacy static list).
- Seeder iterates getVerifiedPluginIds() from registryClient.
- Skip markSeeded when the verified set is empty so a registry outage
  doesn't lock fresh installs into zero plugins; the next request
  retries (5-min cache in registryClient bounds the request rate).
- Stamp every seeded plugin as trust=verified by definition.
- Tests rewritten against a fake verified set; new test asserts
  empty-registry deferral.
- Sync marketplace-architecture rule + migrate-legacy-plugin skill
  with the new model.
- Patch bump: 2.15.15 -> 2.15.16.

* fix(engine): resolve plugin 404s and local engine routing (#fix/diagnose-plugins-404)

- fix: engineManifest + resolveEngineUrl: port 5001→5000 to match docker-compose
  binding; removed NEXT_PUBLIC_WWV_PLUGIN_DATA_ENGINE_URL from local engine
  detection — it was poisoning local routing with the production engine URL (Patch)
- fix: WsClient: added normalizePluginId() converting underscore IDs to kebab-case
  so engine WebSocket messages route to the correct frontend plugin (Patch)
- fix: docker-compose: added ./local-seeders:/app/seeders volume mount to
  wwv-data-engine so locally-developed seeders are visible to the engine (Patch)
- feat: sync-local-plugins: added wwvHostRedirectPlugin — Vite plugin that
  intercepts @/ host-app imports in local plugin builds and redirects them to
  runtime host globals, preventing full app tree from being bundled into plugins (Minor)
- docs: plugin-architecture.md: added Plugin Data Delivery Types section (REST-only,
  WS-only, hybrid), peerDependencies rule, .tsx extension rule, mapWebsocketPayload
  signature contract (Patch)
- docs: data-engine-architecture.md: added §7 WebSocket Payload Format Contract
  documenting WsClient's three payload handling cases and the silent-drop footgun
  for plugins that send object payloads without mapWebsocketPayload (Patch)
- docs: worldwideview-plugin-creation SKILL.md: fixed ISS example which was missing
  mapWebsocketPayload and would have silently dropped all WS data; clarified
  mapWebsocketPayload requirement for non-array payloads; fixed architecture
  decision tree (Patch)
- docs: cesium-rendering.md: added Sizing Conventions table with defaults/ranges
  for point/billboard/model, cross-plugin parity rules, and silent-ignore footgun
  warning for size on billboard entities (Patch)
- docs: added ADR-0002 documenting seeder exported name as canonical plugin ID (Patch)

Version bumps: fix × 3 (Patch), feat × 1 (Minor) → 2.15.16 → 2.16.0

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* test(engine): update resolveEngineUrl test assertion from port 5001 to 5000

Follows the port correction in engineManifest.ts and resolveEngineUrl.ts.
The test was asserting the old default (5001) instead of the corrected
local engine port (5000), causing the Unit Tests CI check to fail.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
2026-05-20 22:44:47 +12:00
GodisDeadxandAntigravity AI d675d91441 Fix(Plugins): Fix sync-local-plugins looking in wrong location (#102)
Co-authored-by: Antigravity AI <[email protected]>
2026-05-15 15:15:38 +12:00
Silvertakana cf67c5d96f docs(panels,core): complete TSDoc standardization for panels and core slices (#112)
This commit includes the work done by the Flash subagent to add comprehensive TSDoc comments to src/components/panels, src/core/state, and src/core/plugins, improving IDE intellisense and codebase maintainability.
2026-05-13 22:45:08 +12:00
Antigravity AI 42f4701fda chore(cli): bump version to 1.1.2 2026-05-13 11:37:27 +12:00
Antigravity AI 64815c114c feat: implement LayerPanel with tabbed navigation, plugin management, and search functionality alongside supporting styling and utility scripts. 2026-05-13 00:14:17 +12:00
Antigravity AI ab80dad42b refactor(plugins): migrate legacy plugins to local-plugins architecture
- Migrated wwv-plugin-gps-jamming to local-plugins and fixed WebSocket payload handling (Patch)

- Migrated wwv-plugin-fortiguard to local-plugins and refactored API proxy fetch logic (Patch)

- Migrated wwv-plugin-nz-traffic-cameras to local-plugins (Patch)

- Cleaned up tutorial plugin wwv-plugin-iss from tree (Patch)

- Added scripts/migrate-plugin.mjs for automation (Patch)
2026-05-11 19:24:19 +12:00
Antigravity AI 0625371ed4 feat: implement local plugin development workflow and nz-traffic-cameras plugin 2026-05-10 21:33:19 +12:00