feat: ship pixelbrowse as an opencode plugin - #129
Conversation
Adds plugin/opencode/, an npm package (opencode-pixelbrowse) that registers a screenshot custom tool via @opencode-ai/plugin. The tool runs pixelshot with the same visual-readability defaults as the Claude skill (--tile-height 1568, --wait-network-idle for URLs) and returns the tile paths for the agent to read. Closes StarTrail-org#117
|
@tauanbinato is attempting to deploy a commit to the andylizf's projects Team on Vercel. A member of the Team first needs to authorize it. |
StarTrail-org#141 made tiles.json the manifest a consumer is meant to read — it carries the ordered tile list and a `complete` flag that is false when pixelshot could not confirm it measured the whole page. The Claude Code skill was updated to read it; this tool was still globbing tile_NNNN.jpg, so it would have presented a truncated capture as the whole page. Reads the manifest, falls back to the directory scan when it is missing, and passes the incompleteness warning through to the agent.
|
Nice work — merging. Clean, idiomatic, and it handles the two things these wrappers usually get wrong: a missing Verified locally: I pushed one commit before merging. #141 landed while this was open and made readdirSync(tilesDir).filter((name) => /^tile_\d+\.jpg$/.test(name)).sort()which works, but means a truncated capture gets handed to the agent as if it were the whole page — exactly the failure #141 exists to prevent. It now reads the manifest, falls back to the directory scan when it's absent (older pixelshot, or a failed write), and appends the incompleteness warning when Checked the three paths by hand: manifest present → uses its list; Two things left for you or whoever picks this up, neither blocking:
Thanks for the first contribution — this closes #117. |
|
Correction to my last comment: I said "merging" and then didn't — this is still a draft, and on re-reading your notes that's deliberate rather than an oversight, so I'm leaving it that way. The code review above stands and the commit I pushed is on the branch. Two things are genuinely blocked on the maintainer, and both are in your test plan already:
The remaining unchecked item — end-to-end in a live opencode session — is the one piece of verification neither of us has done. Everything I checked was static: plugin manifests validate, So: ready from a code standpoint, waiting on a name decision and a publish. Mark it ready for review once those land and it can go in. |
Maintainer picked the scoped name. Renamed the package and every reference to it (root README, plugin/README.md, plugin/opencode/README.md), and added publishConfig.access=public — npm defaults scoped packages to restricted, so without it `npm publish` would fail or publish privately.
|
@andylizf can you help launch the NPM |
Summary
Closes #117.
Adds
plugin/opencode/— an npm package (opencode-pixelbrowse) so opencode users can load pixelbrowse under"plugin"inopencode.json:{ "$schema": "https://opencode.ai/config.json", "plugin": ["opencode-pixelbrowse"] }The plugin registers a
screenshotcustom tool (via@opencode-ai/plugin) that:pixelshot <target> --output /tmp/pixelbrowse --tile-height 1568(plus--wait-network-idlefor URLs) — the same visual-readability defaults the Claude Code skill mandatesoutputandviewportWidthargsuv tool install pixelrag/pipx/pip) whenpixelshotis not onPATHAlso adds an opencode note in
plugin/README.mdand the main README's "Give Claude eyes" section.Notes for maintainers
npm publish --access publicfromplugin/opencode/(documented in its README). Happy to adjust the package name if you'd prefer a scoped one (e.g.@startrail/pixelbrowse).node --check,npm pack --dry-run, and an import smoke test (PixelbrowsePluginloads and registers thescreenshottool). Not yet exercised end-to-end inside a live opencode session.Test plan
npm publish --access publicfromplugin/opencode/pixelshoton PATH, add"plugin": ["opencode-pixelbrowse"]toopencode.jsonand run e.g.opencode run "screenshot https://news.ycombinator.com and summarize the top stories"