Kai Ole Hartwig

sylius-agent-contracts — the foundation that ships nothing itself.

Provider interfaces, registries and the channel-aware request context the other bundles in the family build on. The package brings no endpoint of its own — it only defines how the others talk to each other. Implement one of the interfaces and you are registered, without a line of configuration.

A package without endpoints cannot break any either

sylius-agent-contracts is a dependency of every other bundle in the family. If it brought routes of its own, installing any single package would automatically publish endpoints nobody asked for. That is why it contains nothing but interfaces, registries and the request context — what a shop offers to the outside is decided solely by which of the other bundles are installed.

Registration runs through the container rather than a configuration file: a class that implements one of the provider interfaces is collected automatically — including when it lives in your own app namespace under App\ and not in a bundle. The fault this avoids is the most inconspicuous one there is: a provider is written, works in its unit test, but is never registered — and is then silently missing from the output, without an error showing up anywhere.

The request context carries channel, base URL and locale, and all cache keys go through it. That is not convenience, it is the dividing line between the channels: if you build a cache key from the document type alone, you serve the second channel the documents of the first — with its base URL, its language and its range. Faults like that never occur in a single-channel development environment and occur immediately in production.

Interfaces and context — the rest comes from the other packages

Sylius: 2.0+ · PHP: 8.2+ · Licence: MIT · Version: 1.2.0

Source code & documentation

Composer package

MIT · Sylius 2.0+ · PHP 8.2+

composer require koh/sylius-agent-contracts

Built, tested and released under MIT. Public distribution via Packagist is being prepared (coming soon).

Part of the family

MIT

This package belongs to koh/sylius-agent-ready — seventeen bundles that make a Sylius shop usable for AI agents. Each one is usable on its own.

To the overview
Part of the family