162
163
constructor(
165
>
@ILogService private readonly _logService: ILogService,
166
>
private readonly _rootConfigResource?: URI,
167
>
providerConfigurations: readonly IAgentCustomizationSettingsRegistration[] = [],
168
>
) {
169
>
super();
170
>
// Merge our customization schema/values into the existing root config
171
>
// (which already carries platform properties like permissions) rather
172
>
// than replacing it.
173
>
const existing = this._stateManager.rootState.config;
174
>
const ownSchema = agentHostCustomizationConfigSchema.toProtocol();
175
>
const sandboxSchema = sandboxConfigSchema.toProtocol();
176
>
const copilotCliSchema = copilotCliConfigSchema.toProtocol();
177
>
this._stateManager.rootState.config = {
178
>
schema: {
179
>
type: 'object',
180
>
properties: { ...existing?.schema.properties, ...ownSchema.properties, ...sandboxSchema.properties, ...copilotCliSchema.properties },
181
>
},
182
>
values: { ...existing?.values, ...this._loadPersistedRootConfig() },
183
>
};
184
>
for (const registration of providerConfigurations) {
185
this.registerProviderConfiguration(registration);
186
}
188
>
this._register(this._stateManager.onDidEmitEnvelope(envelope => {
189
if (envelope.action.type === ActionType.RootConfigChanged) {
190
this._onDidRootConfigChange.fire();