Add conformance tests for SEP-1330 elicitation enums (#22)
* Add SEP-1330 conformance test for elicitation enum schemas Adds server-side conformance test that validates servers properly request elicitation with SEP-1330 enum schema improvements: - Untitled single-select enum (type: string, enum: [...]) - Titled single-select enum (oneOf with const/title) - Legacy titled enum (enumNames for backward compatibility) - Untitled multi-select enum (type: array, items.enum) - Titled multi-select enum (items.anyOf with const/title) Test expects server to implement `test_elicitation_sep1330_enums` tool. * Add reference server implementation for SEP-1330 conformance test Adds test_elicitation_sep1330_enums tool to everything-server that requests elicitation with all 5 enum schema variants. Also updates SERVER_REQUIREMENTS.md with full specification. * Fix prettier formatting * only test active tests (#24) * refactor maps to pull names from the test * bring names back * separate active from pending * only test active --------- Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
This commit is contained in:
parent
73af777bc2
commit
e19918d968
1 changed files with 647 additions and 46 deletions
|
|
@ -28,6 +28,7 @@ import {
|
|||
} from './server/tools.js';
|
||||
|
||||
import { ElicitationDefaultsScenario } from './server/elicitation-defaults.js';
|
||||
import { ElicitationEnumsScenario } from './server/elicitation-enums.js';
|
||||
|
||||
import {
|
||||
ResourcesListScenario,
|
||||
|
|
@ -46,56 +47,83 @@ import {
|
|||
PromptsGetWithImageScenario
|
||||
} from './server/prompts.js';
|
||||
|
||||
export const scenarios = new Map<string, Scenario>([
|
||||
['initialize', new InitializeScenario()],
|
||||
['tools-call', new ToolsCallScenario()],
|
||||
['auth/basic-dcr', new AuthBasicDCRScenario()],
|
||||
['auth/basic-metadata-var1', new AuthBasicMetadataVar1Scenario()],
|
||||
[
|
||||
'elicitation-sep1034-client-defaults',
|
||||
new ElicitationClientDefaultsScenario()
|
||||
]
|
||||
]);
|
||||
// Pending client scenarios (not yet fully tested/implemented)
|
||||
const pendingClientScenariosList: ClientScenario[] = [
|
||||
// Elicitation scenarios (SEP-1330)
|
||||
new ElicitationEnumsScenario()
|
||||
];
|
||||
|
||||
export const clientScenarios = new Map<string, ClientScenario>([
|
||||
// All client scenarios
|
||||
const allClientScenariosList: ClientScenario[] = [
|
||||
// Lifecycle scenarios
|
||||
['server-initialize', new ServerInitializeScenario()],
|
||||
new ServerInitializeScenario(),
|
||||
|
||||
// Utilities scenarios
|
||||
['logging-set-level', new LoggingSetLevelScenario()],
|
||||
['completion-complete', new CompletionCompleteScenario()],
|
||||
new LoggingSetLevelScenario(),
|
||||
new CompletionCompleteScenario(),
|
||||
|
||||
// Tools scenarios
|
||||
['tools-list', new ToolsListScenario()],
|
||||
['tools-call-simple-text', new ToolsCallSimpleTextScenario()],
|
||||
['tools-call-image', new ToolsCallImageScenario()],
|
||||
['tools-call-audio', new ToolsCallAudioScenario()],
|
||||
['tools-call-embedded-resource', new ToolsCallEmbeddedResourceScenario()],
|
||||
['tools-call-mixed-content', new ToolsCallMultipleContentTypesScenario()],
|
||||
['tools-call-with-logging', new ToolsCallWithLoggingScenario()],
|
||||
['tools-call-error', new ToolsCallErrorScenario()],
|
||||
['tools-call-with-progress', new ToolsCallWithProgressScenario()],
|
||||
['tools-call-sampling', new ToolsCallSamplingScenario()],
|
||||
['tools-call-elicitation', new ToolsCallElicitationScenario()],
|
||||
new ToolsListScenario(),
|
||||
new ToolsCallSimpleTextScenario(),
|
||||
new ToolsCallImageScenario(),
|
||||
new ToolsCallAudioScenario(),
|
||||
new ToolsCallEmbeddedResourceScenario(),
|
||||
new ToolsCallMultipleContentTypesScenario(),
|
||||
new ToolsCallWithLoggingScenario(),
|
||||
new ToolsCallErrorScenario(),
|
||||
new ToolsCallWithProgressScenario(),
|
||||
new ToolsCallSamplingScenario(),
|
||||
new ToolsCallElicitationScenario(),
|
||||
|
||||
// Elicitation scenarios (SEP-1034)
|
||||
['elicitation-sep1034-defaults', new ElicitationDefaultsScenario()],
|
||||
new ElicitationDefaultsScenario(),
|
||||
|
||||
// Elicitation scenarios (SEP-1330) - pending
|
||||
...pendingClientScenariosList,
|
||||
|
||||
// Resources scenarios
|
||||
['resources-list', new ResourcesListScenario()],
|
||||
['resources-read-text', new ResourcesReadTextScenario()],
|
||||
['resources-read-binary', new ResourcesReadBinaryScenario()],
|
||||
['resources-templates-read', new ResourcesTemplateReadScenario()],
|
||||
['resources-subscribe', new ResourcesSubscribeScenario()],
|
||||
['resources-unsubscribe', new ResourcesUnsubscribeScenario()],
|
||||
new ResourcesListScenario(),
|
||||
new ResourcesReadTextScenario(),
|
||||
new ResourcesReadBinaryScenario(),
|
||||
new ResourcesTemplateReadScenario(),
|
||||
new ResourcesSubscribeScenario(),
|
||||
new ResourcesUnsubscribeScenario(),
|
||||
|
||||
// Prompts scenarios
|
||||
['prompts-list', new PromptsListScenario()],
|
||||
['prompts-get-simple', new PromptsGetSimpleScenario()],
|
||||
['prompts-get-with-args', new PromptsGetWithArgsScenario()],
|
||||
['prompts-get-embedded-resource', new PromptsGetEmbeddedResourceScenario()],
|
||||
['prompts-get-with-image', new PromptsGetWithImageScenario()]
|
||||
]);
|
||||
new PromptsListScenario(),
|
||||
new PromptsGetSimpleScenario(),
|
||||
new PromptsGetWithArgsScenario(),
|
||||
new PromptsGetEmbeddedResourceScenario(),
|
||||
new PromptsGetWithImageScenario()
|
||||
];
|
||||
|
||||
// Active client scenarios (excludes pending)
|
||||
const activeClientScenariosList: ClientScenario[] =
|
||||
allClientScenariosList.filter(
|
||||
(scenario) =>
|
||||
!pendingClientScenariosList.some(
|
||||
(pending) => pending.name === scenario.name
|
||||
)
|
||||
);
|
||||
|
||||
// Client scenarios map - built from list
|
||||
export const clientScenarios = new Map<string, ClientScenario>(
|
||||
allClientScenariosList.map((scenario) => [scenario.name, scenario])
|
||||
);
|
||||
|
||||
// Scenario scenarios
|
||||
const scenariosList: Scenario[] = [
|
||||
new InitializeScenario(),
|
||||
new ToolsCallScenario(),
|
||||
new AuthBasicDCRScenario(),
|
||||
new AuthBasicMetadataVar1Scenario(),
|
||||
new ElicitationClientDefaultsScenario()
|
||||
];
|
||||
|
||||
// Scenarios map - built from list
|
||||
export const scenarios = new Map<string, Scenario>(
|
||||
scenariosList.map((scenario) => [scenario.name, scenario])
|
||||
);
|
||||
|
||||
export function registerScenario(name: string, scenario: Scenario): void {
|
||||
scenarios.set(name, scenario);
|
||||
|
|
@ -116,3 +144,7 @@ export function listScenarios(): string[] {
|
|||
export function listClientScenarios(): string[] {
|
||||
return Array.from(clientScenarios.keys());
|
||||
}
|
||||
|
||||
export function listActiveClientScenarios(): string[] {
|
||||
return activeClientScenariosList.map((scenario) => scenario.name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue