Skip to content

[Mate] Future Improvements #1162

@wachterjohannes

Description

@wachterjohannes

During the review of PR #1146, several ideas for improving the Mate component came up. This issue tracks those improvements for future implementation.

Composer Plugin Integration

Currently, users need to manually run vendor/bin/mate discover after installing extensions to update the .mate/extensions.php configuration. We could improve this by registering Mate as a Composer plugin (similar to PHPStan) that automatically triggers discovery when packages are installed/updated.

Benefits:

  • No manual discovery step needed
  • Extensions automatically available after composer install/update
  • Better developer experience

Reference: https://getcomposer.org/doc/articles/plugins.md

Original Discussion: #1146 (comment)

PHAR Distribution

Right now Mate is installed as a regular Composer package, which means it shares dependency versions with the main application. This can lead to version conflicts, especially with Symfony components.

We should provide a PHAR distribution as an alternative installation method. The PHAR would be self-contained with all dependencies bundled, eliminating any conflicts.

Benefits:

  • Zero dependency conflicts
  • Consistent behavior across different projects
  • Smaller footprint in project vendor directory

Original Discussion: #1146 (comment)

Autowiring for Bridge Services

The bridge configuration files (src/Bridge/*/config/services.php) currently use manual service definitions with explicit args() configuration. We should enable autowiring to simplify service registration and make the configuration more maintainable.

Current approach:

$configurator->services()
    ->set(Monolog\Service\LogReader::class)
        ->args([
            service(Monolog\Service\LogParser::class),
            '%ai_mate_monolog.log_dir%',
        ]);

Proposed approach:

$configurator->services()
    ->defaults()
        ->autowire()
        ->autoconfigure()
    
    ->set(Monolog\Service\LogReader::class)
        ->arg('$logDir', '%ai_mate_monolog.log_dir%');

Benefits:

  • Simpler configuration for services with many dependencies
  • Consistent with main default.services.php pattern
  • Less maintenance when constructor signatures change
  • Only need to explicitly define scalar/parameter arguments

Metadata

Metadata

Assignees

No one assigned

    Labels

    MateIssues & PRs about the AI Mate component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions