305
306
private _applyOne(server: ISdkMcpServer, tx: ITransaction): void {
308
>
const state = this._stateForUpdate(previous?.state, server.state);
309
>
const enabled = server.enabled ?? previous?.enabled ?? true;
310
>
// Once promoted to a top-level entry, stay top-level for the
311
>
// session — flipping back to a child mid-stream would orphan the
312
>
// previously-published top-level id.
313
>
let topLevelId = previous?.topLevelId;
314
>
if (topLevelId === undefined) {
315
>
const childId = this._options.resolveChildId(server.name);
316
>
if (childId !== undefined) {
317
this._setLiveEntry(server.name, { serverName: server.name, state, enabled, topLevelId: undefined }, tx);
318
this._options.emit({