-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathservices.yaml
More file actions
241 lines (188 loc) · 11.8 KB
/
services.yaml
File metadata and controls
241 lines (188 loc) · 11.8 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters:
# Mail configuration (sender address and name; name can be overridden per env via .env.*.local)
app.mail.default_sender_address: "%env(MAIL_DEFAULT_SENDER_ADDRESS)%"
app.mail.default_sender_name_fallback: "SiteBuilder"
app.mail.default_sender_name: "%env(default:app.mail.default_sender_name_fallback:MAIL_DEFAULT_SENDER_NAME)%"
# Workspace root directory for all workspace operations
workspace_mgmt.workspace_root_default: "/var/www/public/workspaces"
workspace_mgmt.workspace_root: "%env(default:workspace_mgmt.workspace_root_default:WORKSPACE_ROOT)%"
# Host path mapping for Docker-in-Docker volume mounts
# When running Docker commands from inside a container, paths must be translated
# to host paths. This maps /var/www (container) to the host project path.
docker.container_base_path: "/var/www"
docker.host_base_path_default: "/var/www"
docker.host_base_path: "%env(default:docker.host_base_path_default:HOST_PROJECT_PATH)%"
# PhotoBuilder image generation request timeouts (in seconds)
photo_builder.gemini_timeout_seconds: 120
photo_builder.openai_timeout_seconds: 120
llm_content_editor.simulate: "%env(bool:LLM_CONTENT_EDITOR_SIMULATE)%"
# E2E workspace fixture (used by SimulatedGitAdapter when APP_ENV=test)
e2e.workspace_fixture_path: "%kernel.project_dir%/tests/fixtures/e2e-workspace-template"
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: "../src/"
exclude:
- "../src/DependencyInjection/"
- "../src/Entity/"
- "../src/Kernel.php"
Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler:
arguments:
- "%env(resolve:DATABASE_PRODUCT)%://%env(resolve:DATABASE_USER)%:%env(resolve:DATABASE_PASSWORD)%@%env(resolve:DATABASE_HOST)%:%env(resolve:DATABASE_PORT)%/%env(resolve:DATABASE_DB)%?serverVersion=%env(resolve:DATABASE_SERVERVERSION)%"
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
# Secure path resolver for workspace isolation
App\WorkspaceTooling\Infrastructure\Security\SecurePathResolver:
arguments:
- "%workspace_mgmt.workspace_root%"
# Docker executor for running commands in isolated containers
# Configured with path mapping for Docker-in-Docker volume mounts
App\WorkspaceTooling\Infrastructure\Execution\DockerExecutor:
arguments:
- "%docker.container_base_path%"
- "%docker.host_base_path%"
# Agent execution context - holds workspace/conversation info for container naming
App\WorkspaceTooling\Infrastructure\Execution\AgentExecutionContext: ~
App\WorkspaceTooling\Facade\AgentExecutionContextInterface:
alias: App\WorkspaceTooling\Infrastructure\Execution\AgentExecutionContext
# Base file operations service (inner service for decorator)
EtfsCodingAgent\Service\FileOperationsService: ~
# Secure file operations decorator - wraps base service with path validation
# Also translates /workspace paths to actual workspace paths via execution context
App\WorkspaceTooling\Infrastructure\Security\SecureFileOperationsService:
arguments:
- '@EtfsCodingAgent\Service\FileOperationsService'
- '@App\WorkspaceTooling\Infrastructure\Security\SecurePathResolver'
- '@App\WorkspaceTooling\Infrastructure\Execution\AgentExecutionContext'
- "%workspace_mgmt.workspace_root%"
# Wire FileOperationsServiceInterface to the secure decorator
EtfsCodingAgent\Service\FileOperationsServiceInterface:
alias: App\WorkspaceTooling\Infrastructure\Security\SecureFileOperationsService
# Isolated shell executor - runs commands in Docker containers
# Uses execution context (set by handler) for workspace path and agent image
App\WorkspaceTooling\Infrastructure\Execution\IsolatedShellExecutor:
arguments:
- '@App\WorkspaceTooling\Infrastructure\Execution\DockerExecutor'
- '@App\WorkspaceTooling\Infrastructure\Execution\AgentExecutionContext'
# Wire ShellOperationsServiceInterface to the isolated executor
EtfsCodingAgent\Service\ShellOperationsServiceInterface:
alias: App\WorkspaceTooling\Infrastructure\Execution\IsolatedShellExecutor
EtfsCodingAgent\Service\TextOperationsService:
arguments:
- "@EtfsCodingAgent\\Service\\FileOperationsServiceInterface"
# Remote content assets infrastructure bindings
App\RemoteContentAssets\Infrastructure\RemoteImageInfoFetcherInterface:
class: App\RemoteContentAssets\Infrastructure\RemoteImageInfoFetcher
App\RemoteContentAssets\Infrastructure\RemoteManifestValidatorInterface:
class: App\RemoteContentAssets\Infrastructure\RemoteManifestValidator
App\RemoteContentAssets\Infrastructure\RemoteManifestFetcherInterface:
class: App\RemoteContentAssets\Infrastructure\RemoteManifestFetcher
App\RemoteContentAssets\Infrastructure\S3AssetUploaderInterface:
class: App\RemoteContentAssets\Infrastructure\S3AssetUploader
# Remote content assets facade - metadata for remote images (dimensions, size, mime type),
# manifest validation and fetching
App\RemoteContentAssets\Facade\RemoteContentAssetsFacadeInterface:
class: App\RemoteContentAssets\Facade\RemoteContentAssetsFacade
arguments:
- "@App\\RemoteContentAssets\\Infrastructure\\RemoteImageInfoFetcherInterface"
- "@App\\RemoteContentAssets\\Infrastructure\\RemoteManifestValidatorInterface"
- "@App\\RemoteContentAssets\\Infrastructure\\RemoteManifestFetcherInterface"
- "@App\\RemoteContentAssets\\Infrastructure\\S3AssetUploaderInterface"
# Sitebuilder-specific workspace tooling facade
App\WorkspaceTooling\Facade\WorkspaceToolingFacadeInterface:
class: App\WorkspaceTooling\Facade\WorkspaceToolingFacade
arguments:
- "@EtfsCodingAgent\\Service\\FileOperationsServiceInterface"
- "@EtfsCodingAgent\\Service\\TextOperationsService"
- "@EtfsCodingAgent\\Service\\ShellOperationsServiceInterface"
- "@App\\WorkspaceTooling\\Infrastructure\\Execution\\AgentExecutionContext"
- "@App\\RemoteContentAssets\\Facade\\RemoteContentAssetsFacadeInterface"
# Facade bindings
App\Prefab\Facade\PrefabFacadeInterface:
class: App\Prefab\Facade\PrefabFacade
App\ProjectMgmt\Facade\ProjectMgmtFacadeInterface:
class: App\ProjectMgmt\Facade\ProjectMgmtFacade
App\WorkspaceMgmt\Facade\WorkspaceMgmtFacadeInterface:
class: App\WorkspaceMgmt\Facade\WorkspaceMgmtFacade
App\ChatBasedContentEditor\Facade\ChatBasedContentEditorFacadeInterface:
class: App\ChatBasedContentEditor\Facade\ChatBasedContentEditorFacade
# Domain service bindings
App\WorkspaceMgmt\Domain\Service\WorkspaceStatusGuardInterface:
class: App\WorkspaceMgmt\Domain\Service\WorkspaceStatusGuard
# Infrastructure adapter bindings
App\WorkspaceMgmt\Infrastructure\Adapter\GitAdapterInterface:
class: App\WorkspaceMgmt\Infrastructure\Adapter\GitCliAdapter
App\WorkspaceMgmt\Infrastructure\Adapter\GitHubAdapterInterface:
class: App\WorkspaceMgmt\Infrastructure\Adapter\GitHubApiAdapter
App\WorkspaceMgmt\Infrastructure\Adapter\FilesystemAdapterInterface:
class: App\WorkspaceMgmt\Infrastructure\Adapter\LocalFilesystemAdapter
# Setup steps providers - tagged for collection by registry
_instanceof:
App\WorkspaceMgmt\Infrastructure\SetupSteps\ProjectSetupStepsProviderInterface:
tags: ["workspace_mgmt.setup_steps_provider"]
# Setup steps infrastructure
App\WorkspaceMgmt\Infrastructure\SetupSteps\ProjectSetupStepsRegistryInterface:
class: App\WorkspaceMgmt\Infrastructure\SetupSteps\ProjectSetupStepsRegistry
App\WorkspaceMgmt\Infrastructure\SetupSteps\SetupStepsExecutorInterface:
class: App\WorkspaceMgmt\Infrastructure\SetupSteps\SetupStepsExecutor
# LLM wire log processor - enriches llm_wire log records with conversation context
App\LlmContentEditor\Infrastructure\WireLog\LlmWireLogProcessor:
tags:
- { name: monolog.processor, channel: llm_wire }
- { name: monolog.processor, channel: llm_conversation }
# Conversation log formatter - human-readable plain-text output
App\LlmContentEditor\Infrastructure\ConversationLog\ConversationLogFormatter: ~
# PhotoBuilder infrastructure bindings
App\PhotoBuilder\Infrastructure\Storage\GeneratedImageStorage:
arguments:
- "%kernel.project_dir%/var/photo-builder"
App\PhotoBuilder\Infrastructure\Adapter\PromptGeneratorInterface:
class: App\PhotoBuilder\Infrastructure\Adapter\OpenAiPromptGenerator
App\PhotoBuilder\Infrastructure\Adapter\ImageGeneratorInterface:
class: App\PhotoBuilder\Infrastructure\Adapter\OpenAiImageGenerator
App\PhotoBuilder\Infrastructure\Adapter\OpenAiImageGenerator:
arguments:
$photoBuilderOpenAiTimeoutSeconds: "%photo_builder.openai_timeout_seconds%"
App\PhotoBuilder\Infrastructure\Adapter\GeminiImageGenerator:
arguments:
$photoBuilderGeminiTimeoutSeconds: "%photo_builder.gemini_timeout_seconds%"
App\PhotoBuilder\Infrastructure\Adapter\FileNameGeneratorInterface:
class: App\PhotoBuilder\Infrastructure\Adapter\LlmFileNameGenerator
App\PhotoBuilder\Infrastructure\Adapter\ImageGeneratorFactory: ~
# LLM content editor facade - inject loggers + enable flag
App\LlmContentEditor\Facade\LlmContentEditorFacade:
arguments:
$llmWireLogger: "@monolog.logger.llm_wire"
$llmConversationLogger: "@monolog.logger.llm_conversation"
$llmWireLogEnabled: "%env(bool:LLM_WIRE_LOG_ENABLED)%"
App\LlmContentEditor\Facade\SwitchableLlmContentEditorFacade:
arguments:
$simulate: "%llm_content_editor.simulate%"
App\LlmContentEditor\Facade\LlmContentEditorFacadeInterface:
alias: App\LlmContentEditor\Facade\SwitchableLlmContentEditorFacade
when@test:
services:
# E2E/test doubles: no external HTTP or git/GitHub calls
App\RemoteContentAssets\Infrastructure\RemoteManifestValidatorInterface:
class: App\RemoteContentAssets\TestHarness\SimulatedRemoteManifestValidator
App\RemoteContentAssets\Infrastructure\S3AssetUploaderInterface:
class: App\RemoteContentAssets\TestHarness\SimulatedS3AssetUploader
App\WorkspaceMgmt\Infrastructure\Adapter\GitAdapterInterface:
class: App\WorkspaceMgmt\TestHarness\SimulatedGitAdapter
arguments:
$workspaceFixturePath: "%e2e.workspace_fixture_path%"
$realGitAdapter: "@App\\WorkspaceMgmt\\Infrastructure\\Adapter\\GitCliAdapter"
App\WorkspaceMgmt\Infrastructure\Adapter\GitHubAdapterInterface:
class: App\WorkspaceMgmt\TestHarness\SimulatedGitHubAdapter
# E2E: no-op setup steps (priority so it is used instead of DefaultProjectSetupStepsProvider)
App\WorkspaceMgmt\TestHarness\E2eNoOpProjectSetupStepsProvider:
tags: [{ name: workspace_mgmt.setup_steps_provider, priority: 100 }]