rename reject to decline

This commit is contained in:
ihrpr 2025-07-03 15:51:16 +01:00
commit 25048b9eaf
No known key found for this signature in database
5 changed files with 12 additions and 12 deletions

View file

@ -1041,7 +1041,7 @@ Client-side: Handle elicitation requests
```typescript
// This is a placeholder - implement based on your UI framework
async function getInputFromUser(message: string, schema: any): Promise<{
action: "accept" | "reject" | "cancel";
action: "accept" | "decline" | "cancel";
data?: Record<string, any>;
}> {
// This should be implemented depending on the app

View file

@ -363,7 +363,7 @@ async function connect(url?: string): Promise<void> {
continue;
} else {
console.log('Maximum attempts reached. Declining request.');
return { action: 'reject' };
return { action: 'decline' };
}
}
@ -381,7 +381,7 @@ async function connect(url?: string): Promise<void> {
continue;
} else {
console.log('Maximum attempts reached. Declining request.');
return { action: 'reject' };
return { action: 'decline' };
}
}
@ -408,13 +408,13 @@ async function connect(url?: string): Promise<void> {
console.log('Please re-enter the information...');
continue;
} else {
return { action: 'reject' };
return { action: 'decline' };
}
}
}
console.log('Maximum attempts reached. Declining request.');
return { action: 'reject' };
return { action: 'decline' };
});
transport = new StreamableHTTPClientTransport(

View file

@ -206,12 +206,12 @@ const getServer = () => {
},
],
};
} else if (result.action === 'reject') {
} else if (result.action === 'decline') {
return {
content: [
{
type: 'text',
text: `No information was collected. User rejected ${infoType} information request.`,
text: `No information was collected. User declined ${infoType} information request.`,
},
],
};
@ -433,7 +433,7 @@ if (useOAuth) {
const mcpServerUrl = new URL(`http://localhost:${MCP_PORT}/mcp`);
const authServerUrl = new URL(`http://localhost:${AUTH_PORT}`);
const oauthMetadata: OAuthMetadata = setupAuthServer({authServerUrl, mcpServerUrl, strictResource: strictOAuth});
const oauthMetadata: OAuthMetadata = setupAuthServer({ authServerUrl, mcpServerUrl, strictResource: strictOAuth });
const tokenVerifier = {
verifyAccessToken: async (token: string) => {
@ -499,7 +499,7 @@ const transports: { [sessionId: string]: StreamableHTTPServerTransport } = {};
// MCP POST endpoint with optional auth
const mcpPostHandler = async (req: Request, res: Response) => {
const sessionId = req.headers['mcp-session-id'] as string | undefined;
console.log(sessionId? `Received MCP request for session: ${sessionId}`: 'Received MCP request:', req.body);
console.log(sessionId ? `Received MCP request for session: ${sessionId}` : 'Received MCP request:', req.body);
if (useOAuth && req.auth) {
console.log('Authenticated user:', req.auth);
}

View file

@ -538,7 +538,7 @@ test("should allow elicitation reject and cancel without validation", async () =
client.setRequestHandler(ElicitRequestSchema, (request) => {
requestCount++;
if (requestCount === 1) {
return { action: "reject" };
return { action: "decline" };
} else {
return { action: "cancel" };
}
@ -566,7 +566,7 @@ test("should allow elicitation reject and cancel without validation", async () =
requestedSchema: schema,
}),
).resolves.toEqual({
action: "reject",
action: "decline",
});
// Test cancel - should not validate

View file

@ -1238,7 +1238,7 @@ export const ElicitResultSchema = ResultSchema.extend({
/**
* The user's response action.
*/
action: z.enum(["accept", "reject", "cancel"]),
action: z.enum(["accept", "decline", "cancel"]),
/**
* The collected user input content (only present if action is "accept").
*/