Skip to content

Comments

Add ServiceCollectionExtensions with per-module DI registration for ACAT core#250

Merged
michaelbeale-IL merged 2 commits intomasterfrom
copilot/setup-service-container
Feb 21, 2026
Merged

Add ServiceCollectionExtensions with per-module DI registration for ACAT core#250
michaelbeale-IL merged 2 commits intomasterfrom
copilot/setup-service-container

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

The DI setup was a single monolithic AddACATServices() in Utility/ServiceConfiguration.cs with no per-module granularity, and the required DependencyInjection/ServiceCollectionExtensions.cs file was absent.

Changes

  • New: ACATCore/DependencyInjection/ServiceCollectionExtensions.cs
    Per-module IServiceCollection extension methods in the ACAT.Core.DependencyInjection namespace:

    Method Registers
    AddActuatorManagement() ActuatorManager, IActuatorManager, IActuatorManagerFactory
    AddAgentManagement() AgentManager, IAgentManager, IAgentManagerFactory
    AddTTSManagement() TTSManager, ITTSManager, ITTSManagerFactory
    AddPanelManagement() PanelManager, IPanelManager, IPanelManagerFactory
    AddThemeManagement() ThemeManager, IThemeManager, IThemeManagerFactory
    AddWordPrediction() WordPredictionManager + interface + factory
    AddSpellChecking() SpellCheckManager + interface + factory
    AddAbbreviationsManagement() AbbreviationsManager + interface + factory
    AddCommandManagement() CommandManager + interface + factory
    AddEventManagement() AutomationEventManager, IEventBus + factory
    AddCQRSHandlers() Command/query handlers (Transient)
    AddRepositories() IRepository<Theme>
    AddDiagnostics() PanelActivityMonitor
    AddACATCoreModules() Aggregate — calls all of the above
  • Updated: ServiceConfiguration.AddACATServices() now delegates to AddACATCoreModules(), eliminating the inline duplication while keeping the existing public API intact.

  • Updated: ACAT.Core.csproj — explicit <Compile> entry added (required; project has EnableDefaultCompileItems=false).

Host applications that only need a subset of ACAT can now opt in per module:

services
    .AddTTSManagement()
    .AddWordPrediction();

Or register everything at once (existing pattern, unchanged):

services.AddACATServices(); // delegates to AddACATCoreModules() internally

All managers remain Singleton-scoped to match the existing static-singleton behaviour.

Original prompt

This section details on the original issue you should resolve

<issue_title>Setup Service Container</issue_title>
<issue_description>Configure Microsoft.Extensions.DependencyInjection in Program.cs and establish service registration patterns.

Acceptance Criteria:

  • ServiceCollection configured in ACATApp and ACATTalk
  • ServiceCollectionExtensions created for core modules
  • Service lifetimes properly configured
  • Documentation for service registration patterns
  • Build passing, no regressions

Technical Details:

  • Add Microsoft.Extensions.DependencyInjection NuGet package
  • Create ConfigureServices() method in Program.cs
  • Register logging infrastructure
  • Register configuration services
  • Create extension methods for module registration

Files to Modify:

  • Applications/ACATApp/Program.cs
  • Applications/ACATTalk/Program.cs
  • Create Libraries/ACATCore/DependencyInjection/ServiceCollectionExtensions.cs

Epic: Dependency Injection Infrastructure

Estimated Effort: 2 days

</issue_description>

<agent_instructions>Review any existing work done on this task, as well as the current state of the Phase 2 Status update to determine what needs to be done to complete this task.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…thods

Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Copilot AI changed the title [WIP] Configure service container in Program.cs Add ServiceCollectionExtensions with per-module DI registration for ACAT core Feb 21, 2026
@michaelbeale-IL michaelbeale-IL marked this pull request as ready for review February 21, 2026 20:34
@michaelbeale-IL michaelbeale-IL merged commit bc4083e into master Feb 21, 2026
2 checks passed
@michaelbeale-IL michaelbeale-IL deleted the copilot/setup-service-container branch February 21, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup Service Container

2 participants