Skip to content

feat(extension): migrate Mini Games to API v2 - #9

Merged
Juliusolsson05 merged 1 commit into
mainfrom
feat/extension-api-v2
Sep 13, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
feat/extension-api-v2

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Mini Games still shipped as a legacy API v1 same-document extension, so its four palette commands depended on view-local registration and could not exercise the managed runtime/view boundary being completed in Agent Code.

This migrates the extension to API v2. It ships an intentionally empty managed runtime and one sandboxed view module shared by four declarative modal views. Each command id equals its target view id, so Play Snake, Play Blackjack, and Play Minesweeper open directly into the requested game without moving animation, timers, or audio into the hidden runtime. The built artifacts and manifest move together to version 0.8.0, while saved game keys remain unchanged.

The migration also narrows game code to the storage capability it actually uses, updates the browser development harness to construct a real v2 view context, and adds a packaging contract that checks command/view routing, activation events, importable runtime/view exports, every committed artifact's host size bound, and removal of the stale v1 bundle.

Depends on:

Validation:

  • npm run verify — 22 deterministic game/engine checks and 2 extension packaging contracts pass; production build and TypeScript check pass.
  • CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" npm run test:browser — Snake, Blackjack, Minesweeper, focus/touch/keyboard behavior, and the exact production view bundle pass with no page errors.
  • Agent Code's full production Electron journey installs this source directory, mounts all four modal ids through the real installer/custom scheme/Dialog shell, closes each one, reopens into a fresh sandbox document, and passes the existing lifecycle, input, security, service, and theme matrix.

Split the shipped bundle into a managed runtime and a sandboxed view module. Map each palette command to its own modal view so direct game launches need no background DOM bridge, and add build/manifest contracts for the committed artifacts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant