feat(render): dual-driver render layer — omp-native browser on omp, playwright on pi/CLI - #24
Merged
Merged
Conversation
…laywright on pi/CLI Split the render flow out of extensions/render.ts into engine/render-core.mjs behind a driver interface: - engine/driver-playwright.mjs — playwright-core, lazy specifier (unchanged loader-preload avoidance, #21); used by the CLI child process and the pi extension tool - engine/driver-omp-native.mjs — omp's built-in Puppeteer browser via the eval-kernel `browser` global (viewport-per-tab, string-evaluate bridging through tab.run args, screenshot temp-path copy); omp hosts import engine/render-omp.mjs instead of loading any browser driver - extensions/render.ts now skips tool registration on omp (engine/host.mjs detects the bun-compiled runtime via argv0/bunfs entry — env is unreliable, omp mirrors OMP_* to PI_*); pi registration unchanged - check-gates.mjs/audit.mjs import engine/render.mjs directly — the tsx bootstrap is gone, tsx dropped from dependencies - SKILL.md § 7.2 branches by host: keystone_render tool on pi, one-line eval-kernel import of engine/render-omp.mjs on omp; engine.md/gates.md/README updated to the render-layer framing omp no longer loads playwright-core at all: the extension path is inert there and the skill renders through the host's own browser, removing the install drift + loader preload exposure class entirely (can1357/oh-my-pi#11090, #11091 context). Verified: full suite 179 pass / 1 skip (~5s), playwright render suite 4/4 with real Chromium, omp-native driver end-to-end on omp 18.1.12 (exact viewport metrics, OKLCH computed pairs, hero at 1280 only, clickables at 1280+375, real screenshot bytes), CLI audit --render full artifacts, extension skip live on omp (no keystone tool registered, zero startup warnings), tsc clean.
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.
What
Removes keystone's dependency on bundling/loading a browser driver on omp by splitting the render flow (
engine/render-core.mjs) behind two drivers:engine/driver-playwright.mjs(lazy specifier, #21 trick unchanged)engine/render.mjscheck-gates --render,audit) + thekeystone_renderpi extension toolengine/driver-omp-native.mjs(omp's built-in Puppeteer browser via the eval-kernelbrowserglobal)engine/render-omp.mjsextensions/render.tsnow skips registration on omp (engine/host.mjs: argv0/bunfs detection — env vars are unreliable, omp mirrorsOMP_*toPI_*). Pi behavior is unchanged. The tsx bootstrap incheck-gates.mjs/audit.mjsis gone; tsx dropped from deps.Skill § 7.2 branches by host:
keystone_rendertool on pi, one-line eval-kernel import ofengine/render-omp.mjson omp. engine.md / gates.md / README updated to the render-layer framing.Why
ctx.invokeToolcan't reachbrowsertoday, so the eval-kernel import is the working seam).omp-native driver specifics (discovered live on omp 18.1.12)
tab.screenshot()returns a temp-file path → copy to artifacttab.runserializes fns — closures don't cross; expressions bridge via{ args }waitForSelector("body")(playwright'snetworkidleisn't exposed)Verification
pnpm test179 pass / 1 skip (~5s);pnpm test:render4/4 with real Chromium;test:lint103/103;typecheckclean; lockfile regenerated (--frozen-lockfilegreen)audit.mjspath mode: full 5-viewport artifact set + report in 3.3skeystonetool registered (NONE), zero startup warningsVersion
1.1.0 (package.json bumped here; tag
v1.1.0after merge triggers the release workflow).