Problem
clients/mcpi (#1783) bundles modules straight out of clients/cli/src via a temporary build-time alias:
// clients/mcpi/tsup.config.ts
"@inspector/cli": path.resolve(dirname, "../cli/src"),
What it reaches for today:
error-handler.js — CliExitCodeError, EXIT_CODES (used across the daemon, clients, and bin)
handlers/ — method-types.js, run-method.js, servers-list.js, format-output.js, connect-timeout.js
cliOAuth.js + cli-oauth-navigation.js — connect-time OAuth flow and navigation
style.js, utils/awaitable-log.js — output styling / logging helpers
This was flagged in review on #1783 (item 2g): clients/cli/src is not a published or internal library surface, so mcpi's compile depends on cli internals that can change under it, and the "which client owns which file" rules in AGENTS.md blur.
Proposed fix
Promote the genuinely shared, node-only CLI surface out of clients/cli/src into a shared area (e.g. core/ subdirectories, or a dedicated shared client-support area) and consume it from both clients/cli and clients/mcpi:
error-handler (exit codes + CliExitCodeError)
- The method handlers and their option/format types
- The interactive OAuth connect flow (
cliOAuth, cli-oauth-navigation) — already thin wrappers over core/auth
style / awaitable-log output helpers
Then delete the @inspector/cli alias from clients/mcpi/tsup.config.ts and clients/mcpi/vitest.config.ts, and drop the layout note from clients/mcpi/README.md.
Notes
- Until this lands, the alias is documented as intentional and temporary in
clients/mcpi/README.md and AGENTS.md.
- The TUI has its own copy of some of this logic; worth checking whether it can consume the same shared surface in the same pass.
Problem
clients/mcpi(#1783) bundles modules straight out ofclients/cli/srcvia a temporary build-time alias:What it reaches for today:
error-handler.js—CliExitCodeError,EXIT_CODES(used across the daemon, clients, and bin)handlers/—method-types.js,run-method.js,servers-list.js,format-output.js,connect-timeout.jscliOAuth.js+cli-oauth-navigation.js— connect-time OAuth flow and navigationstyle.js,utils/awaitable-log.js— output styling / logging helpersThis was flagged in review on #1783 (item 2g):
clients/cli/srcis not a published or internal library surface, so mcpi's compile depends on cli internals that can change under it, and the "which client owns which file" rules in AGENTS.md blur.Proposed fix
Promote the genuinely shared, node-only CLI surface out of
clients/cli/srcinto a shared area (e.g.core/subdirectories, or a dedicated shared client-support area) and consume it from bothclients/cliandclients/mcpi:error-handler(exit codes +CliExitCodeError)cliOAuth,cli-oauth-navigation) — already thin wrappers overcore/authstyle/awaitable-logoutput helpersThen delete the
@inspector/clialias fromclients/mcpi/tsup.config.tsandclients/mcpi/vitest.config.ts, and drop the layout note fromclients/mcpi/README.md.Notes
clients/mcpi/README.mdand AGENTS.md.