Files
Himadri Mishra 2eb135a32b fix(mcp): make keyless recovery consent-first (#363)
* fix(mcp): make keyless recovery consent-first

* fix(mcp): complete safe keyless recovery

* fix(mcp): guide invalid credential recovery

* fix(mcp): make account-only recovery fallback-first

* refactor(mcp): dedupe security-boundary guidance strings and recovery payload shape

Addresses cubic P2 (src/index.ts:1007, confidence 6): the "never put an API
key in chat/URL" and "retry after a new session/run" sentences were
duplicated verbatim across HUMAN_CONNECTION_GUIDANCE,
invalidApiKeyRecoveryPayload, and both invalidOAuthRecoveryPayload branches;
the two invalidApiKeyRecoveryPayload/invalidOAuthRecoveryPayload builders
also repeated the same code/auth_mode/docs_url/next_actions shape.

Extracts NEVER_SHARE_API_KEY_SENTENCE and RETRY_AFTER_CONFIRM_SUFFIX as the
single source for that phrasing, and a small connectionRecoveryPayload()
base builder for the two recovery payloads. Pure dedup: every emitted
message/payload byte is unchanged (verified by diffing the built dist
output against the pre-refactor build).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(mcp): gate reconnect-through-client guidance on OAuth being enabled

With CLOUD_SERVICE=false the invalid-OAuth recovery told the user to sign in
through the client's account-connection flow even though this server cannot
start one. The advertise branch now also requires isMcpOAuthEnabled(),
matching the existing composition used for tool listing; disabled-OAuth
deployments fall through to the guidance for servers that do not start
account sign-in.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor(mcp): co-locate guidance URL constants with resource defaults

Pure relocation addressing review feedback: the guidance URL constants
lived ~830 lines from the DEFAULT_* resource constants. They now share one
section, with a comment explaining why MCP_OAUTH_SERVER_URL repeats the
oauth resource value without aliasing it (protocol identity is
env-overridable per deployment; the human-facing copy is fixed).

No behavior change: bundle content is line-identical modulo ordering.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 17:20:45 +05:30

13 lines
254 B
TypeScript

import { defineConfig } from 'tsup';
export default defineConfig({
entry: ['src/index.ts', 'src/www-authenticate.ts'],
format: ['esm'],
platform: 'node',
target: 'node22',
clean: true,
splitting: false,
sourcemap: false,
dts: false,
});