Skip to content

v0.4.0

Choose a tag to compare

@paulbalandan paulbalandan released this 26 Jul 19:53
· 573 commits to 1.x since this release
v0.4.0
3ced46e

What's Changed

Added

  • Attribute-based registration. Mark methods with #[AsTool], #[AsPrompt], #[AsResource] or #[AsResourceTemplate] and a class with #[AsServer], then register via ServerBuilder::register(object ...$sources). A tool's inputSchema and a prompt's arguments are inferred from the signature and @param docblocks, overridable with #[InputSchema].
  • #[AsServer] supplies server identity and instructions, filling only the gaps an explicit setServerInfo() / setInstructions() left. More than one throws DuplicateServerMetadataException.
  • 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 with MissingDiscoveryAttributeException.
  • 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() and setResourceTemplateStore() 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