liam — the Kapture fork
"I am a particular set of skills."
A hard fork of williamkapke/kapture (MIT, dormant
since 2026-07-06). Source at ~/code/liam, public at
delorenj/liam. origin is the fork, upstream is William's
— kept for cherry-picking, not for merge discipline.
This skill is about working on liam. It is not how you drive a browser. For that, use
kapture — which is still the live tool on this machine, because liam's extension has to be
loaded by hand and the two servers cannot share port 61822.
Why the fork exists
Three things a skill could document but not fix:
- MCP is a context tax. 32 tool schemas ≈ 25 KB ≈ 7-8k tokens resident on every turn of
every session, for a capability most sessions never use. Here HTTP and the CLI are the
product; MCP becomes
liam mcp, an opt-in adapter over a protocol-neutral core. - There is no way to read text. Upstream gives you an element's geometry or a
half-megabyte of
outerHTML, and nothing in between. - Nothing reports to the platform. Five browser drivers exist on this box and none emit a Bloodbank event, deposit an artifact, or remember anything about a site.
What is already done
Phase 1 landed: renamed, re-keyed, upstream couplings cut, 62/62 unit tests green.
- Own extension id
nikmjmdooglaejpjjjpnffpcockkboaj, from a new RSA keypair. This is not cosmetic — Chrome refuses two extensions with the same id, and upstream's is installed in four profiles here. The private key is in 1Password (Liam Chrome Extension Signing Key), never in the repo. If you regenerate it, the id changes andserver/src/origin-policy.tsmust change with it or every connection 403s silently behind an infinite reconnect backoff. new_tabno longer needs the internet. It openedwilliamkapke.github.io/kapture/how-to.htmland waited 15s for that page to self-connect; it now opens this server's own/welcome, which self-connects by the same CustomEvent. The page's CSS and images are vendored intoserver/static/assetsand served by an/assetsroute.- One source of truth for the port in
server/src/config.ts. Upstream declaredPORTinindex.ts, hardcoded 61822 again inbridge.ts, and hardcoded the derived origins a third time inorigin-policy.ts— soKAPTURE_PORTmoved the server and left the bridge and the allow-list behind.LIAM_PORTmoves all of it. - Page-facing contracts renamed in lockstep:
liam-message,liam-loaded,liam-connect,liam-connected,liam://resource URIs,liam-Nelement ids.
Installing it (the human step)
cd ~/code/liam/server && npm install && npm run build
node dist/index.js # binds 127.0.0.1:61822
Stop the Kapture server first — one process owns 61822, and starting a second prints a
banner suggesting kill -9 that you should not act on blindly.
Then the part no agent can do: chrome://extensions → Developer mode → Load unpacked →
~/code/liam/extension. The key in the manifest pins the id, so it stays stable across
reloads and coexists with the Web Store Kapture. Connect a tab with the toolbar toggle, or open
http://127.0.0.1:61822/welcome.
Working on it
The tool surface is a declarative registry: server/src/tools.yaml (32 tools, types,
defaults, ranges), from which yaml-loader.ts generates the Zod validation schema and the MCP
JSON Schema in one loop. The whole fork thesis is that the CLI becomes a third face on that same
registry.
Adding a tool costs 2-3 files — tools.yaml, plus extension/page-helpers.js (page/DOM work)
or extension/modules/background-*.js and its entry in background-commands.js (CDP/tabs
work). But eligibility is duplicated across five hardcoded lists that tools.yaml knows
nothing about, so a new tool silently works over MCP and silently 404s over HTTP:
HTTP_TAB_COMMANDS (index.ts), ELIGIBLE_COMPOSE_TOOLS and TERMINAL_COMPOSE_TOOLS
(compose.ts), the URI table (resource-handler.ts), and DIALOG_EXEMPT_COMMANDS
(extension/modules/tab-manager.js). Collapsing those into the registry is the next
architectural task.
cd ~/code/liam/server && npm test # 62 tests, node --test via tsx
Two traps the suite already encodes. tools-schema.test.ts guards a real regression: re-adding
a top-level oneOf to an advertised schema 400s every Anthropic request while every behavioural
test stays green. And index.integration.test.ts must import origin-policy dynamically —
it transitively pulls in config.ts, which reads LIAM_PORT at module load, and a static import
hoists above the test's env assignment, silently binding the real 61822 instead of the test's 61999.
Known upstream bug, inherited
No default: in tools.yaml is ever applied. yaml-loader.ts builds each optional property
.default(x).optional(), and zod's optional wrapper resolves an absent key to undefined
without consulting the inner default — so whatever the receiving function falls back to is what
you actually get. Measured: screenshot.scale is 0.5, not the advertised 0.3; navigate.timeout
is 5000, not 30000. Fixing this is Phase 2, and it needs a test asserting a declared default
actually reaches the extension.
Roadmap
Neutral core (drop the MCP content-block envelope from the internal calling convention) →
generated CLI → text/extract and a settle primitive → Bloodbank events on
bloodbank.agent.tool.* with screenshots to ssbnk → per-site learnings persisted through
Hindsight. The full plan, with the verification gates, is in the session plan file.
Scope
Building liam. Driving a browser is kapture today and will be liam once its extension is
loaded and the CLI ships — at which point this skill and that one merge and the sets swap over.