82 Commits

Author SHA1 Message Date
Christopher Hertel
e3e72d3fe4 feature #1682 [Mate] Add Codex wrappers and refresh agent instructions on discover (wachterjohannes)
This PR was squashed before being merged into the main branch.

Discussion
----------

[Mate] Add Codex wrappers and refresh agent instructions on discover

| Q             | A |
| ------------- | --- |
| Bug fix?      | yes |
| New feature?  | yes |
| Docs?         | yes |
| Issues        | n/a (no related issue) |
| License       | MIT |

## Description

This PR improves Symfony AI Mate integration for Codex and keeps agent instructions in sync with extension discovery.

### What changed

- mate discover now also refreshes agent instruction artifacts:
    - updates mate/AGENT_INSTRUCTIONS.md
    - updates a managed AI Mate section in AGENTS.md
- mate init now scaffolds all integration artifacts (without running discover):
    - keeps mcp.json + .mcp.json behavior
    - adds Codex runtime wrappers:
        - bin/codex (macOS/Linux)
        - bin/codex.bat (Windows)
    - adds mate/AGENT_INSTRUCTIONS.md template
    - updates AGENTS.md managed section from current instruction file
    - prints explicit next step to run vendor/bin/mate discover
- extracted extension sync logic to ExtensionConfigSynchronizer
- added AgentInstructionsMaterializer to centralize writing:
    - mate/AGENT_INSTRUCTIONS.md
    - managed block in AGENTS.md
- extended AgentInstructionsAggregator with aggregateForExtensions(...) to support fresh discovered maps and avoid stale container state
- updated Mate docs and changelog accordingly

## Usage

vendor/bin/mate init
vendor/bin/mate discover
./bin/codex

discover is now the command that refreshes both extension config and instruction artifacts.

Commits
-------

7362bb22 [Mate] Add Codex wrappers and refresh agent instructions on discover
2026-03-17 22:26:39 +01:00
Johannes Wachter
cc515ea080 [Mate] Add Codex wrappers and refresh agent instructions on discover 2026-03-17 22:26:26 +01:00
Christopher Hertel
fba550ff62 Bump versions for v0.6 v0.6.0 2026-03-05 00:27:55 +01:00
Christopher Hertel
230e4329fa feature #1631 [MCP Bundle] Implement PSR-16 adapter session storage (EdouardCourty)
This PR was merged into the main branch.

Discussion
----------

[MCP Bundle] Implement PSR-16 adapter session storage

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| Docs?         | yes
| Issues        | Fix https://github.com/symfony/ai/issues/1612
| License       | MIT

This PR brings compatibility with the underlying SDK's PSR-16 storage capacities for HTTP sessions storage.
New configurations options are made available :
- `cache` value for `mcp.http.session.store` (in addition to the existing `filesystem` and `memory` values
- `cache_pool` option for providing a custom cache pool to be used for storage (if none provided, defaulting to the built-in adapter)

Commits
-------

abe0d7d1 feat(sessions): implement psr-16 adapter session storage
2026-02-28 16:49:27 +01:00
Edouard Courty
bb3771de25 feat(sessions): implement psr-16 adapter session storage 2026-02-28 16:49:10 +01:00
Christopher Hertel
10e9928215 Prepare for v0.5.0 v0.5.0 2026-02-19 19:34:43 +01:00
Christopher Hertel
03db8d8667 Prepare for release v0.4.0 v0.4.0 2026-02-18 23:56:14 +01:00
Oskar Stark
7efb4327a9 Bump phpunit/phpunit to ^11.5.53 across all components 2026-02-18 11:36:38 +01:00
Johannes Wachter
ef4155d58c [Mate] Add RegistryProvider service to eliminate Registry duplication
Problem:
Both ServeCommand and ToolsCallCommand independently created and populated
Registry instances via FilteredDiscoveryLoader, causing duplicate capability
discovery when both commands were used in the same application lifecycle.

Solution:
Created RegistryProvider service that encapsulates Registry creation and
population logic with lazy initialization. Registry is now created only when
first accessed, and both commands share the same populated Registry instance.

- Add RegistryProvider service with lazy initialization
- Register RegistryProvider in service container
- Update ServeCommand to use RegistryProvider (setRegistry instead of addLoader)
- Update ToolsCallCommand to use RegistryProvider and RegistryInterface
- Update tests to use RegistryProvider
2026-02-14 22:12:59 +01:00
Christopher Hertel
4aab553f67 minor #1523 [Mate] Refactor command registration to use service container (wachterjohannes)
This PR was squashed before being merged into the main branch.

Discussion
----------

[Mate] Refactor command registration to use service container

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | yes
| Issues        | N/A
| License       | MIT

## Summary

Refactored the Mate application to use dependency injection container with services for command registration instead of manual instantiation. This improves modularity and makes the application more maintainable.

Commits
-------

ddaf96f9 [Mate] Refactor command registration to use service container
2026-02-04 20:37:41 +01:00
Johannes Wachter
3bf755fe65 [Mate] Refactor command registration to use service container 2026-02-04 20:37:36 +01:00
Johannes Wachter
210b4967fa [Mate] Consolidate profiler documentation into Symfony bridge
- Remove incorrect 'Profiler Bridge' section (symfony/ai-profiler-mate-extension does not exist)
- Add profiler tools and resources to Symfony Bridge section as optional features
- Profiler functionality is part of symfony/ai-symfony-mate-extension, not a separate package
- Update mate README.md with documentation link and proper formatting
- Update formatting to match other component READMEs (use dashes, add docs link)

The profiler tools (symfony-profiler-list, symfony-profiler-latest,
symfony-profiler-search, symfony-profiler-get) and resources
(symfony-profiler://profile/{token}) are now correctly documented as
optional features of the Symfony bridge that activate when
symfony/http-kernel is installed.
2026-01-29 19:58:18 +01:00
Christopher Hertel
eee6cd613c Revert of bumping the branch-alias right away 2026-01-27 23:21:43 +01:00
Christopher Hertel
894be44e4c Bump versions and aliases for v0.3.0 release v0.3.0 2026-01-23 22:29:55 +01:00
Christopher Hertel
446c7a2c24 CS follows Symfony rules update 2026-01-23 21:56:05 +01:00
Johannes Wachter
586b784b71 [Mate][Symfony] Add optional profiler data access capabilities 2026-01-23 21:27:01 +01:00
Johannes Wachter
ae84ff8dbd [Mate] Add agent-instructions support for MCP extensions 2026-01-23 19:52:52 +01:00
Johannes Wachter
406d0a5c68 [Mate] Add mcp:tools:call command for tool execution via JSON input 2026-01-23 14:55:50 +01:00
Christopher Hertel
fe8241f4d3 Fix instantiation of CapabilityCollector after #1388 merge 2026-01-15 00:03:58 +01:00
Johannes Wachter
e7ec546f4b Add mcp:tools:inspect command for detailed tool introspection
Display comprehensive information about specific MCP tools including
full JSON schema.

Features:
- Accept tool name as required argument
- Display tool metadata: name, description, handler, extension
- Show full JSON schema for tool parameters
- Support text (default) and JSON output formats
- Error handling for non-existent tools
2026-01-14 23:03:51 +01:00
Christopher Hertel
dcfb3dbec9 minor #1388 [Mate] Bump mcp/php-sdk in mate to 0.3 (wachterjohannes)
This PR was merged into the main branch.

Discussion
----------

[Mate] Bump mcp/php-sdk in mate to 0.3

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | no
| Issues        | N/A
| License       | MIT

## Summary

Bump mcp/sdk to 0.3

Commits
-------

cdf2967d bump mcp/php-sdk in mate to 0.3
2026-01-14 21:40:11 +01:00
Johannes Wachter
e69933d6c9 Add support for extension exclusion in Mate
Add support for 'extension: false' flag in extra.ai-mate configuration
to exclude packages from being discovered as extensions. This is useful
for vendor packages that use Mate for internal development tooling but
should not be detected as user-facing extensions.

Changes:
- InitCommand now sets 'extension: false' by default in composer.json
- ComposerExtensionDiscovery skips packages with 'extension: false'
- Added informative note in init command output
- Added comprehensive test coverage (7 new test cases)
- Updated documentation (CHANGELOG.md, CLAUDE.md)

When a package is installed in other projects, it will be completely
hidden from extension discovery if the flag is set to false.
2026-01-14 21:04:53 +01:00
Johannes Wachter
ca37567d2d bump mcp/php-sdk in mate to 0.3 2026-01-13 21:18:22 +01:00
Christopher Hertel
e52a30f968 feature #1379 [Mate] Add mcp:tools:list command (wachterjohannes)
This PR was squashed before being merged into the main branch.

Discussion
----------

[Mate] Add mcp:tools:list command

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| Docs?         | yes
| Issues        | N/A
| License       | MIT

## Summary

Add new console command to list available MCP tools with metadata:
- Support filtering by tool name pattern (wildcards)
- Support filtering by extension name
- Provide both table and JSON output formats

Commits
-------

4d12ecf5 [Mate] Add mcp:tools:list command
2026-01-13 18:44:51 +01:00
Johannes Wachter
65edbfd2a6 [Mate] Add mcp:tools:list command 2026-01-13 18:44:38 +01:00
Johannes Wachter
701c864925 Merge bridge tests from mate/Tests into bridge tests
- Merged LogSearchToolTest with comprehensive test coverage
- Merged ServiceToolTest with enhanced test cases
- Added necessary fixtures to support comprehensive testing
- Removed duplicate test files and fixtures from mate test suite
- All tests pass with improved coverage and organization
2026-01-12 22:08:10 +01:00
Johannes Wachter
12d9ac05b1 Fix mate logger failing when log directory doesn't exist
The mate logger was failing to start when the configured log file path
included a non-existing directory, because file_put_contents() does not
automatically create parent directories.

Changes:
- Add ensureDirectoryExists() method to Logger service
- Automatically creates parent directories with 0755 permissions
- Throws clear exception if directory creation fails due to permissions
- Add test coverage for automatic directory creation
- Add test for permission-based directory creation failures
- Update existing test to expect directory creation error message

The implementation uses a simple approach without caching, relying on
the fast is_dir() check and OS filesystem caching for efficiency.
2026-01-09 22:58:30 +01:00
Christopher Hertel
da2c0b0519 minor #1360 Prepare for release v0.2 (chr-hertel)
This PR was merged into the main branch.

Discussion
----------

 Prepare for release v0.2

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | no <!-- required for new features -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

Commits
-------

e1ca6baf Prepare for release v0.2
v0.2.0
2026-01-09 17:20:45 +01:00
Guillaume Loulier
f5796d0db2 conf(tests): executionOrder moved to random 2026-01-08 11:38:03 +01:00
Christopher Hertel
8c196ef879 Prepare for release v0.2 2026-01-08 09:09:35 +01:00
Christopher Hertel
b41ad3c6d1 Bump branch alias to 0.2.x-dev 2026-01-06 15:41:54 +01:00
Christopher Hertel
10685f7fa3 minor #1347 [Mate] Revert " Execute PHP-CS-Fixer" (chr-hertel)
This PR was merged into the main branch.

Discussion
----------

[Mate] Revert " Execute PHP-CS-Fixer"

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | no <!-- required for new features -->
| Issues        |
| License       | MIT

This reverts commit 35fcfa54c148794a38d057ab247d9f91f40a7d19, see #1343

Commits
-------

595491df Revert "[Mate] Execute PHP-CS-Fixer"
2026-01-06 14:27:45 +01:00
Christopher Hertel
a6061c0ac1 minor #1336 [Mate] Refactor ComposerExtensionDiscovery to improve code quality (wachterjohannes)
This PR was merged into the main branch.

Discussion
----------

[Mate] Refactor ComposerExtensionDiscovery to improve code quality

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | no
| Issues        | none
| License       | MIT

## Summary

- Extract complex nested conditions into extractAiMateConfig() helper method
- Improve error logging for file_get_contents failures with error context
- Reduce code duplication in discoverRootProject() method
- Add detailed error messages including last PHP error when file operations fail

Commits
-------

db5a3f7a Refactor ComposerExtensionDiscovery to improve code quality
2026-01-06 14:18:37 +01:00
Christopher Hertel
354191e4e5 minor #1335 [Mate] Improve error message handling in Logger exception path (wachterjohannes)
This PR was merged into the main branch.

Discussion
----------

[Mate] Improve error message handling in Logger exception path

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | no
| Issues        | none
| License       | MIT

## Summary

- Create separate errorMessage variable for cleaner code
- Add explicit [ERROR] prefix when writing to STDERR
- Write both error message and original log message to STDERR
- Ensures complete information is available even when exception is thrown

Commits
-------

dcebacda Improve error message handling in Logger exception path
2026-01-06 14:18:05 +01:00
Christopher Hertel
c459a464b0 Revert "[Mate] Execute PHP-CS-Fixer"
This reverts commit 35fcfa54c148794a38d057ab247d9f91f40a7d19.
2026-01-06 14:08:41 +01:00
Johannes Wachter
635c070094 Improve error message handling in Logger exception path
- Create separate errorMessage variable for cleaner code
- Add explicit [ERROR] prefix when writing to STDERR
- Write both error message and original log message to STDERR
- Ensures complete information is available even when exception is thrown
2026-01-06 14:07:09 +01:00
Johannes Wachter
b3bca5b5c9 Refactor ComposerExtensionDiscovery to improve code quality
- Extract complex nested conditions into extractAiMateConfig() helper method
- Improve error logging for file_get_contents failures with error context
- Reduce code duplication in discoverRootProject() method
- Add detailed error messages including last PHP error when file operations fail
2026-01-06 14:06:11 +01:00
Johannes Wachter
bad0c7360f Add error handling for PID file creation in ServeCommand
- Check return value of file_put_contents() when creating PID file
- Log warning if PID file creation fails instead of silently failing
- Add file_exists() check before cleanup in finally block
- Use error suppression operator to prevent PHP warnings
2026-01-06 13:59:31 +01:00
Christopher Hertel
63eabc271c minor #1326 [Mate] Remove exception factory methods (wachterjohannes)
This PR was squashed before being merged into the main branch.

Discussion
----------

[Mate] Remove exception factory methods

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | no
| Issues        | none
| License       | MIT

## Summary

Remove static factory methods from all exception classes in the mate component
and replace them with constructor parameters that format messages internally.

Commits
-------

04bdfe1f [Mate] Remove exception factory methods
2026-01-06 13:56:43 +01:00
Johannes Wachter
27825adcd5 [Mate] Remove exception factory methods 2026-01-06 13:56:28 +01:00
Tim Lochmüller
782788e8ad [Mate] Execute PHP-CS-Fixer 2026-01-05 16:34:30 +01:00
Christopher Hertel
49d1e78145 bug #1299 [Mate] Put log file inside mate.root_dir (Nyholm)
This PR was merged into the main branch.

Discussion
----------

[Mate] Put log file inside `mate.root_dir`

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Docs?         | no
| Issues        |
| License       | MIT

If you run mate from a non-root dir, you still want the log file to be put in the project

Commits
-------

fae38577 [Mate] Put log file inside mate.root_dir
2026-01-02 17:01:59 +01:00
Johannes Wachter
739033f165 Add debug:extensions command for mate component
Implements a new debug:extensions command that displays detailed information
about discovered and loaded MCP extensions, helping developers troubleshoot
extension discovery and loading issues.

Features:
- Shows discovered vs enabled vs loaded extension status
- Displays scan directories and include files per extension
- Differentiates between [enabled] and [loaded] states
- Supports --show-all flag to display disabled extensions
- JSON output format for scripting (--format=json)
- Root project (_custom) extension details

Status indicators:
- [enabled]: Extension configured in mate/extensions.php
- [loaded]: Extension successfully loaded into DI container
- [not loaded]: Extension configured but failed to load (useful for debugging)

Changes:
- Add DebugExtensionsCommand with comprehensive extension inspection
- Add mate.enabled_extensions container parameter in ContainerFactory
- Add command tests with 9 test cases covering all scenarios
- Update documentation (mate.rst, CLAUDE.md)
- Register command in App

Related to debug:capabilities command for complete debugging workflow.
2025-12-30 22:25:22 +01:00
Johannes Wachter
4a97ef7cad [Mate] Add debug:capabilities command 2025-12-30 22:19:30 +01:00
Johannes Wachter
0cd73fca2a Refactor discovery loader to extract per-extension logic
Move initialization code from execute() methods to constructors in
ServeCommand and DiscoverCommand for better separation of concerns.

Extract FilteredDiscoveryLoader filtering logic into public
loadByExtension() method to allow per-extension capability inspection.
2025-12-30 00:46:59 +01:00
Johannes Wachter
866525f165 Rename ComposerTypeDiscovery to ComposerExtensionDiscovery
- Rename class ComposerTypeDiscovery to ComposerExtensionDiscovery
- Add file existence check in discoverRootProject() method to prevent warnings
- Update all references in tests, commands, and container factory
2025-12-29 21:54:10 +01:00
Tobias Nyholm
013cec333d [Mate] Put log file inside mate.root_dir 2025-12-28 13:56:40 +01:00
Johannes Wachter
ce92007db8 Refactor ContainerFactory to extract mixed concerns
Extracted container building logic into focused private methods:
- registerCoreServices(): Loads default config and sets parameters
- loadBridges(): Discovers and loads MCP extension bridges
- registerUserServices(): Loads user-defined service configurations
- loadEnvironmentVariables(): Loads environment variables from .env files

The create() method now orchestrates these four steps with clear
separation of concerns and improved maintainability.

Also fixed bug in environment variable loading where .env.local file
was being added to the load list when it didn't exist (inverted logic).

All 27 existing tests pass, confirming backward compatibility.
2025-12-28 13:28:00 +01:00
Tobias Nyholm
1cd9b28c9b minor #1296 [Mate] Add support for _composer_autoload_path super global (Nyholm)
This PR was merged into the main branch.

Discussion
----------

[Mate] Add support for _composer_autoload_path super global

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | no
| Issues        | no
| License       | MIT

If `$_GLOBALS['_composer_autoload_path']` is defined, then use it. It is defined my composer on each "bin" script.

(See your `vendor/bin/*`)

Commits
-------

da436902 add support for _composer_autoload_path super global
2025-12-28 11:48:02 +01:00
Tobias Nyholm
7f1206e86b remove $_ENV['MATE_ROOT_DIR'] 2025-12-28 08:31:22 +01:00