243
244
constructor(
246
>
options: IAgentHostStateManagerOptions = {},
247
>
) {
248
>
super();
249
>
this._changesets = new AgentHostChangesetStateCache(options.changesetStateRetention);
250
>
this._rootState = createRootState();
251
>
// Seed the host-level configuration schema + default values so that
252
>
// RootConfigChanged actions can merge into it, and clients see the
253
>
// schema immediately upon subscribing to `agenthost:/root`. See
254
>
// `platformRootSchema` for the set of platform-owned properties.
255
>
this._rootState = {
256
>
...this._rootState,
257
>
config: {
258
>
schema: platformRootSchema.toProtocol(),
259
>
values: platformRootSchema.validateOrDefault({}, {
260
>
[SessionConfigKey.Permissions]: { allow: [], deny: [] } satisfies IPermissionsValue,
261
>
[AgentHostTelemetryLevelConfigKey]: telemetryLevelToAgentHostConfigValue(TelemetryLevel.USAGE),
262
>
}),
263
>
},
264
>
_meta: withHostBuildInfo(this._rootState._meta, options.hostBuildInfo),
265
>
};
266
>
this._summaryNotifier = this._register(new SessionSummaryNotifier(
267
>
session => {
268
const entry = this._sessionStates.get(session);
269
return entry ? this._toSummary(session, entry) : undefined;
270
},
272
type: 'root/sessionSummaryChanged',
273
channel: ROOT_STATE_URI,