81
this._state.set({ synced: this._mergedSynced() }, undefined);
82
}
84
>
85
>
/**
86
>
* Tracks "has the **client-pushed** customization snapshot changed
87
>
* since the SDK was last (re)started against it?". Subscribes to
88
>
* {@link SessionClientCustomizationsModel.state}, with the state
89
>
* observable's equalsFn structurally comparing the meaningful
90
>
* fields (URI list, nonce, status, user-visible
91
>
* metadata). Same race semantics as `SessionClientToolsDiff`: a
92
>
* write that lands during an in-flight rebind re-flips dirty via
93
>
* the autorun, so callers don't need to snapshot-compare.
94
>
*
95
>
* The SDK captures `Options.plugins` at startup. Synced customization changes
96
>
* mark the diff dirty, while reducer-backed enablement drift is detected by
97
>
* comparing desired plugin paths with the last successfully applied paths.
98
>
*
99
>
* Server-side (SDK-discovered) customizations are NOT tracked
100
>
* here — the SDK manages its own discovery lifecycle, and
101
>
* changes to server-side data flow to the workbench via separate
102
>
* event fires (post-materialize, post-rebind).
103
>
*
104
>
* On rebind throw the bit is left set — the SDK is still running
105
>
* with the previous plugin set, so the next sendMessage should
106
>
* retry.
107
>
*/
108
>
export class SessionClientCustomizationsDiff extends Disposable {
109
>
110
>
readonly model: SessionClientCustomizationsModel = new SessionClientCustomizationsModel();
111
>
112
>
private _dirty = false;
113
>
private _appliedPluginPaths: readonly URI[] = [];
114
>
// `autorun` invokes its callback once at registration for dependency
115
>
// tracking. Skip that initial run so a brand-new diff doesn't
116
>
// report dirty before any mutation has happened.
117
>
private _ignoreNextFire = true;
118
>
119
>
/**
120
>
* Outward fire-and-forget signal that the underlying state
121
>
* changed. Derived from the observable so external listeners
122
>
* (e.g. agent-level event aggregation) don't have to subscribe to
123
>
* the observable directly.
124
>
*/
125
>
readonly onDidChange: Event<void> = Event.fromObservableLight(this.model.state);
126
>
127
>
constructor() {
128
super();
129
this._register(autorun(reader => {