v0.4.0
What's Changed
Added
- Attribute-based registration. Mark methods with
#[AsTool],#[AsPrompt],#[AsResource]or#[AsResourceTemplate]and a class with#[AsServer], then register viaServerBuilder::register(object ...$sources). A tool'sinputSchemaand a prompt'sargumentsare inferred from the signature and@paramdocblocks, overridable with#[InputSchema]. #[AsServer]supplies server identity and instructions, filling only the gaps an explicitsetServerInfo()/setInstructions()left. More than one throwsDuplicateServerMetadataException.- A variadic parameter on an
#[AsTool]method maps to an array input and is spread back into the call. ServerBuilder::register()rejects a source carrying no discovery attribute withMissingDiscoveryAttributeException.- An
#[AsTool]parameter typed as an instantiable class is expanded into an object schema built from its constructor. Expansion is one level deep. ServerBuilder::setToolStore(),setPromptStore(),setResourceStore()andsetResourceTemplateStore()swap in custom store implementations.
Changed
- Public accessors follow a verb-first naming scheme:
getMethod(),getErrorCode(),getSessionId(),getDisplayName(),InMemoryTransport::createPair(). - Mutation testing no longer times out while covering the shutdown coroutine drain.
Removed
- The static
Server::builder()/Client::builder()factories. Construct the builders directly.
Full Changelog: v0.3.0...v0.4.0