SPEC COMPLIANCE: Remove loose/passthrough types not allowed/defined by MCP spec + Task types (#1242)
This commit is contained in:
parent
4d6c3b8284
commit
a606fb1790
2 changed files with 866 additions and 488 deletions
|
|
@ -1982,11 +1982,8 @@ describe('createMessage backwards compatibility', () => {
|
|||
|
||||
// Verify result is returned correctly
|
||||
expect(result.model).toBe('test-model');
|
||||
expect(result.content.type).toBe('text');
|
||||
// With tools param, result.content can be array (CreateMessageResultWithTools type)
|
||||
// This would fail type-check if we used CreateMessageResult which doesn't allow arrays
|
||||
const contentArray = Array.isArray(result.content) ? result.content : [result.content];
|
||||
expect(contentArray.length).toBe(1);
|
||||
expect(result.content).toMatchObject({ type: 'text', text: 'I will use the weather tool' });
|
||||
expect(result.content).not.toBeInstanceOf(Array);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -2285,7 +2285,7 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
|
|||
|
||||
// Verify we received the notification that was sent while disconnected
|
||||
expect(allText).toContain('Missed while disconnected');
|
||||
}, 10000);
|
||||
}, 15000);
|
||||
});
|
||||
|
||||
// Test onsessionclosed callback
|
||||
|
|
|
|||
Loading…
Reference in a new issue