-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplicationServiceRegistration.cs
More file actions
136 lines (126 loc) · 7.54 KB
/
ApplicationServiceRegistration.cs
File metadata and controls
136 lines (126 loc) · 7.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
using Taskdeck.Api.Health;
using Taskdeck.Api.Realtime;
using Taskdeck.Api.Services;
using Taskdeck.Application.Connectors;
using Taskdeck.Application.Interfaces;
using Taskdeck.Application.Services;
using Taskdeck.Application.Services.Tools;
using Taskdeck.Domain.Agents;
namespace Taskdeck.Api.Extensions;
public static class ApplicationServiceRegistration
{
public static IServiceCollection AddApplicationServices(this IServiceCollection services)
{
services.AddScoped<BoardService>(sp =>
new BoardService(
sp.GetRequiredService<IUnitOfWork>(),
sp.GetService<IAuthorizationService>(),
sp.GetService<IBoardRealtimeNotifier>(),
sp.GetService<IHistoryService>(),
sp.GetService<ICacheService>(),
sp.GetService<CacheSettings>()));
services.AddScoped<ColumnService>();
services.AddScoped<CardService>();
services.AddScoped<CardCommentService>();
services.AddScoped<LabelService>();
services.AddScoped<AuthenticationService>();
services.AddScoped<AuthorizationService>();
services.AddScoped<MfaService>();
services.AddSingleton<OAuthScopeValidator>();
services.AddScoped<IAuthorizationService>(sp => sp.GetRequiredService<AuthorizationService>());
services.AddScoped<UserService>();
services.AddScoped<BoardAccessService>();
services.AddScoped<IBoardJsonExportImportService, BoardJsonExportImportService>();
services.AddScoped<IDatabaseFileExportImportService, DatabaseFileExportImportService>();
services.AddScoped<IExportImportService>(sp =>
new ExportImportService(
sp.GetRequiredService<IBoardJsonExportImportService>(),
sp.GetRequiredService<IDatabaseFileExportImportService>()));
services.AddScoped<IExternalImportService, ExternalImportService>();
services.AddScoped<IExternalImportAdapter, CsvExternalImportAdapter>();
services.AddScoped<LlmQueueService>();
services.AddScoped<ICaptureService, CaptureService>();
services.AddScoped<INoteImportService, NoteImportService>();
services.AddScoped<ICaptureTriageService, CaptureTriageService>();
services.AddScoped<HistoryService>();
services.AddScoped<IHistoryService>(sp => sp.GetRequiredService<HistoryService>());
services.AddScoped<IAutomationProposalService, AutomationProposalService>();
services.AddScoped<ICardHistoryService, CardHistoryService>();
services.AddScoped<ISideEffectAnalyzer, SideEffectAnalyzer>();
services.AddScoped<IProposalRevisionService, ProposalRevisionService>();
services.AddScoped<ISimilarDecisionService, SimilarDecisionService>();
services.AddScoped<IAutomationPolicyEngine, AutomationPolicyEngine>();
services.AddScoped<IAutomationPlannerService, AutomationPlannerService>();
services.AddScoped<IAutomationExecutorService, AutomationExecutorService>();
services.AddScoped<IArchiveRecoveryService, ArchiveRecoveryService>();
services.AddScoped<IOpsCliService, OpsCliService>();
services.AddScoped<IBoardContextBuilder, BoardContextBuilder>();
services.AddScoped<IChatService, ChatService>();
services.AddScoped<ILogQueryService, LogQueryService>();
services.AddScoped<ICadenceService>(sp =>
new CadenceService(sp.GetRequiredService<IUnitOfWork>().AuditLogs));
services.AddScoped<INotificationService, NotificationService>();
services.AddScoped<IKnowledgeService, KnowledgeService>();
services.AddScoped<IWorkspaceService, WorkspaceService>();
services.AddScoped<ITomorrowNoteService, TomorrowNoteService>();
services.AddScoped<ISearchService, SearchService>();
services.AddScoped<IStarterPackManifestValidator, StarterPackManifestValidator>();
services.AddScoped<IStarterPackApplyService, StarterPackApplyService>();
services.AddScoped<IStarterPackCatalogService, StarterPackCatalogService>();
services.AddScoped<IOutboundWebhookService, OutboundWebhookService>();
services.AddScoped<IIntegrationRegistryService, IntegrationRegistryService>();
services.AddScoped<IDataExportService, DataExportService>();
services.AddScoped<IAccountDeletionService, AccountDeletionService>();
services.AddSingleton<InMemoryActiveUserCache>();
services.AddSingleton<IActiveUserCache>(sp => sp.GetRequiredService<InMemoryActiveUserCache>());
services.AddScoped<IBoardMetricsService>(sp =>
new BoardMetricsService(
sp.GetRequiredService<IUnitOfWork>(),
sp.GetRequiredService<IAuthorizationService>()));
services.AddScoped<IStreakService, StreakService>();
services.AddScoped<ApiKeyService>();
services.AddScoped<IForecastingService>(sp =>
new ForecastingService(
sp.GetRequiredService<IUnitOfWork>(),
sp.GetRequiredService<IAuthorizationService>()));
services.AddScoped<IMetricsExportService>(sp =>
new MetricsExportService(
sp.GetRequiredService<IBoardMetricsService>()));
services.AddScoped<AgentProfileService>();
services.AddScoped<AgentRunService>();
services.AddScoped<SignalRBoardRealtimeNotifier>();
services.AddScoped<WebhookBoardMutationNotifier>();
services.AddScoped<IBoardRealtimeNotifier, CompositeBoardRealtimeNotifier>();
services.AddSingleton<IBoardPresenceTracker, InMemoryBoardPresenceTracker>();
services.AddSingleton<RedisBackplaneHealthCheck>();
// Connector services (provider registration is in Infrastructure DI)
services.AddScoped<ConnectorExecutionService>();
services.AddScoped<IConnectorCredentialService, ConnectorCredentialService>();
// Agent tool registry (singleton — populated once at startup, read concurrently)
var toolRegistry = new TaskdeckToolRegistry();
toolRegistry.RegisterTool(InboxTriageAssistant.GetToolDefinition());
services.AddSingleton<ITaskdeckToolRegistry>(toolRegistry);
// Agent policy evaluator and inbox triage assistant
services.AddScoped<IAgentPolicyEvaluator, AgentPolicyEvaluator>();
services.AddScoped<InboxTriageAssistant>();
// Tool-calling infrastructure (read tools)
services.AddScoped<IToolExecutor, ListBoardColumnsExecutor>();
services.AddScoped<IToolExecutor, ListCardsInColumnExecutor>();
services.AddScoped<IToolExecutor, GetCardDetailsExecutor>();
services.AddScoped<IToolExecutor, SearchCardsExecutor>();
services.AddScoped<IToolExecutor, GetBoardLabelsExecutor>();
// Tool-calling infrastructure (write tools — always produce proposals, GP-06)
services.AddScoped<IToolExecutor, ProposeCreateCardExecutor>();
services.AddScoped<IToolExecutor, ProposeMoveCardExecutor>();
services.AddScoped<IToolExecutor, ProposeArchiveCardExecutor>();
services.AddScoped<IToolExecutor, ProposeUpdateCardExecutor>();
services.AddScoped<IToolExecutor, ProposeBulkMoveExecutor>();
services.AddScoped<IToolExecutor, ProposeCreateColumnExecutor>();
services.AddScoped<IDailySealService, DailySealService>();
services.AddScoped<ToolExecutorRegistry>(sp =>
new ToolExecutorRegistry(sp.GetServices<IToolExecutor>()));
services.AddScoped<IToolStatusNotifier, SignalRToolStatusNotifier>();
services.AddScoped<ToolCallingChatOrchestrator>();
return services;
}
}