mcpq's cache, interceptor onion, interaction broker, devtools hub,
transport instrumentation, and React bindings are now built on the
shared @johnhenry/agent-query-core package (proven by two sibling
consumers, a2a-query and acp-query) instead of mcpq's own from-scratch
parallel implementations — the retrofit the family plan always
scoped as "post-0.1.0 major, migrates last."
Core rename driving most of the diff: Operation.server -> Operation.peer
(and the same on InteractionBroker's Interaction/AuditEntry), matching
core's generalization. mcpq's own public types (AuthzRequest.server,
CallAuditEntry.server, PolicyContext.server) stay decoupled and
unrenamed — populated internally from op.peer — which keeps most
downstream consumers (mcp-gate's audit sink, apps/approvals's policy
engine) untouched; only direct Interaction/AuditEntry readers needed
the rename.
MCPCache and InteractionBroker are thin subclasses of core's QueryCache
and InteractionBroker, adding back MCP-specific convenience methods
(onResourceUpdated/onListChanged/markStaleByServer, a filter-object
clear()) that have no core equivalent. Adopting core's cache also
picks up 3 real bugfixes (a subscriber-count race, a gc double-check,
subscriber-count seeding on entry recreation) beyond the rename.
DevtoolsHub overrides `subscribe` back to a bound arrow property —
core's is a plain method, but mcpq's own contract (test/inspector.test.ts)
requires it stay safely callable detached from `this`.
React hooks (useResource/useToolResult/useTask's list-hooks/
useServerState) consolidate onto core's react/index.ts helpers
(useCacheEntry/useVersioned/useInteractions/useAuditLog) instead of
9 independent inline useSyncExternalStore copies.
mcp-gate (packages/mcp-gate) catches up in the same pass: its forked
rateLimit.ts/circuitBreaker.ts (built during mcp-query#21 specifically
because mcp-gate never adopted mcpq's newer keyFn-based versions) are
deleted; mcp-gate now consumes mcpq's real rateLimit()/circuitBreaker()
with an explicit per-(server,tenant) keyFn. Its own mcpq pin, three
minors stale, is caught up to 0.4.0.
apps/switchboard, apps/approvals, apps/inspector updated for the
Operation.peer/Interaction.peer/AuditEntry.peer rename.
Full monorepo (every package, every app) passes typecheck and tests.
mcpq 0.3.0 -> 0.4.0 (breaking, continuing the pre-1.0 breaking-minor
convention from #21). mcp-gate 0.1.1 -> 0.2.0.