439
440
constructor(
442
>
defaultHarness: string,
443
>
private readonly promptsService: IPromptsService,
444
>
) {
445
>
this._staticHarnesses = staticHarnesses;
446
>
this.promptsService = promptsService;
447
>
this._activeSessionResource = observableValue<URI>(this, this.getSessionResourceForHarness(defaultHarness));
448
>
this.activeSessionResource = this._activeSessionResource;
449
>
this._activeHarness = derived(this, reader => getChatSessionType(this._activeSessionResource.read(reader)));
450
>
this.activeHarness = this._activeHarness;
451
>
this._availableHarnesses = observableValue<readonly IHarnessDescriptor[]>(this, [...this._staticHarnesses]);
452
>
this.availableHarnesses = this._availableHarnesses;
453
>
this._rebindProviderListeners();
454
>
}
455
456
private _getAllHarnesses(): readonly IHarnessDescriptor[] {
458
>
// extension-contributed harnesses can upgrade a built-in entry.
459
>
const externalIds = new Set(this._externalHarnesses.map(h => h.id));
460
>
return [
461
>
...this._staticHarnesses.filter(h => !externalIds.has(h.id)),
462
>
...this._externalHarnesses,
463
>
];
464
>
}
465
466
private _refreshAvailableHarnesses(): void {