refactor(agent): nest tool-set and MCP under agent subpaths - #102
Merged
Conversation
LukasParke
force-pushed
the
agent-subpath-packages
branch
from
August 7, 2026 19:41
d6b0253 to
ba48ee0
Compare
LukasParke
force-pushed
the
agent-subpath-packages
branch
from
August 11, 2026 18:25
ba48ee0 to
12b986f
Compare
LukasParke
force-pushed
the
agent-subpath-packages
branch
2 times, most recently
from
August 11, 2026 19:01
f60711e to
e09f4ec
Compare
LukasParke
force-pushed
the
agent-subpath-packages
branch
from
August 11, 2026 20:23
e09f4ec to
7d0a49d
Compare
LukasParke
force-pushed
the
agent-subpath-packages
branch
2 times, most recently
from
August 11, 2026 21:39
6a7476e to
afc7443
Compare
Move the tool-set and MCP implementations into @openrouter/agent subpath exports while retaining @openrouter/mcp as a compatibility facade. Keep the MCP SDK optional so base agent installs stay lean. Co-Authored-By: Claude <noreply@anthropic.com>
Load the optional MCP SDK only when a connection is requested and surface an actionable missing-peer error without pulling MCP into root imports. Mark the legacy MCP package as a migration facade and document the complete subpath surface. Add packed-install, export-map, dependency-version, resolution-condition, and architecture boundary checks. Also preserve widened ToolSet elements in dynamic FilterToolsByIds arrays and activate the maintained declaration fixtures. Co-Authored-By: Claude <noreply@anthropic.com>
Preserve current main's async-agent behavior while moving ToolSet and the MCP v2 client implementation under agent subpaths. Keep the MCP client as a lazily loaded optional peer, retain protocol negotiation behavior, and relocate implementation tests to the canonical package. Co-Authored-By: Claude <noreply@anthropic.com>
LukasParke
force-pushed
the
agent-subpath-packages
branch
from
August 12, 2026 02:17
d94b07b to
e39dbd1
Compare
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.
Summary
@openrouter/agent/tool-setsubpath and removes the unpublished standalone@openrouter/agent-tool-setpackage.@openrouter/agent/mcp, with nested/create-mcp-tools,/types,/schema, and/cacheexports.@modelcontextprotocol/sdkas an optional peer of@openrouter/agent, so base agent installs do not pull MCP dependencies.@openrouter/mcppackage into a thin compatibility facade over the canonical agent subpaths.API example
Consumers of
/mcpinstall the optional peer alongside agent:Existing
@openrouter/mcproot and nested imports continue to work.Package size / tree shaking
@openrouter/agentremainssideEffects: false./tool-setentries do not statically import MCP modules./tool-setwithout installing the MCP SDK.Verification
pnpm buildpnpm lintpnpm typecheckpnpm testpnpm changeset status/tool-set, no MCP SDK installed/mcpwith optional peer installed@openrouter/mcproot + all legacy nested exports🤖 Generated with Claude Code
Package-boundary hardening
@modelcontextprotocol/sdklazily and reports an actionableMCPMissingPeerDependencyErroronly when an MCP connection actually needs a missing peer.@openrouter/mcpand its nested paths as migration facades while preserving every existing import.pnpm verify:packages, which packs both packages, validates every export target and tarball allowlist, installs them into a clean consumer, checks optional-peer isolation, and rejects duplicate/version-skewed agent resolution.FilterToolsByIds<readonly Tool[]>fallback so widened tool IDs do not collapse tonever[].Verification
pnpm buildpnpm lintpnpm typecheckpnpm test— 779 agent tests and 17 facade testspnpm verify:packagessentrux gategit diff --check