Repository navigation
feat(extension): migrate Mini Games to API v2 - #9
Merged
Merged
Conversation
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.
This was referenced Sep 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andPlay Minesweeperopen 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:
fs.writecontract: feat(extensions): add shared runtimes and independent view authoring agent-code-extension-api#1 at9c30b919Validation:
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.